Copyright | (c) 2015-2016 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Rewrites a source object to a destination object. Optionally overrides metadata.
See: Cloud Storage JSON API Reference for storage.objects.rewrite
.
Synopsis
- type ObjectsRewriteResource = "storage" :> ("v1" :> ("b" :> (Capture "sourceBucket" Text :> ("o" :> (Capture "sourceObject" Text :> ("rewriteTo" :> ("b" :> (Capture "destinationBucket" Text :> ("o" :> (Capture "destinationObject" Text :> (QueryParam "destinationPredefinedAcl" ObjectsRewriteDestinationPredefinedACL :> (QueryParam "ifSourceGenerationMatch" (Textual Int64) :> (QueryParam "ifMetagenerationMatch" (Textual Int64) :> (QueryParam "ifGenerationNotMatch" (Textual Int64) :> (QueryParam "ifSourceMetagenerationNotMatch" (Textual Int64) :> (QueryParam "ifSourceMetagenerationMatch" (Textual Int64) :> (QueryParam "ifGenerationMatch" (Textual Int64) :> (QueryParam "maxBytesRewrittenPerCall" (Textual Int64) :> (QueryParam "userProject" Text :> (QueryParam "ifMetagenerationNotMatch" (Textual Int64) :> (QueryParam "ifSourceGenerationNotMatch" (Textual Int64) :> (QueryParam "projection" ObjectsRewriteProjection :> (QueryParam "sourceGeneration" (Textual Int64) :> (QueryParam "destinationKmsKeyName" Text :> (QueryParam "rewriteToken" Text :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] Object :> Post '[JSON] RewriteResponse)))))))))))))))))))))))))))
- objectsRewrite :: Text -> Text -> Object -> Text -> Text -> ObjectsRewrite
- data ObjectsRewrite
- orDestinationPredefinedACL :: Lens' ObjectsRewrite (Maybe ObjectsRewriteDestinationPredefinedACL)
- orIfSourceGenerationMatch :: Lens' ObjectsRewrite (Maybe Int64)
- orIfMetagenerationMatch :: Lens' ObjectsRewrite (Maybe Int64)
- orIfGenerationNotMatch :: Lens' ObjectsRewrite (Maybe Int64)
- orIfSourceMetagenerationNotMatch :: Lens' ObjectsRewrite (Maybe Int64)
- orIfSourceMetagenerationMatch :: Lens' ObjectsRewrite (Maybe Int64)
- orIfGenerationMatch :: Lens' ObjectsRewrite (Maybe Int64)
- orSourceObject :: Lens' ObjectsRewrite Text
- orMaxBytesRewrittenPerCall :: Lens' ObjectsRewrite (Maybe Int64)
- orSourceBucket :: Lens' ObjectsRewrite Text
- orPayload :: Lens' ObjectsRewrite Object
- orUserProject :: Lens' ObjectsRewrite (Maybe Text)
- orDestinationBucket :: Lens' ObjectsRewrite Text
- orIfMetagenerationNotMatch :: Lens' ObjectsRewrite (Maybe Int64)
- orIfSourceGenerationNotMatch :: Lens' ObjectsRewrite (Maybe Int64)
- orProjection :: Lens' ObjectsRewrite (Maybe ObjectsRewriteProjection)
- orSourceGeneration :: Lens' ObjectsRewrite (Maybe Int64)
- orDestinationKmsKeyName :: Lens' ObjectsRewrite (Maybe Text)
- orRewriteToken :: Lens' ObjectsRewrite (Maybe Text)
- orDestinationObject :: Lens' ObjectsRewrite Text
REST Resource
type ObjectsRewriteResource = "storage" :> ("v1" :> ("b" :> (Capture "sourceBucket" Text :> ("o" :> (Capture "sourceObject" Text :> ("rewriteTo" :> ("b" :> (Capture "destinationBucket" Text :> ("o" :> (Capture "destinationObject" Text :> (QueryParam "destinationPredefinedAcl" ObjectsRewriteDestinationPredefinedACL :> (QueryParam "ifSourceGenerationMatch" (Textual Int64) :> (QueryParam "ifMetagenerationMatch" (Textual Int64) :> (QueryParam "ifGenerationNotMatch" (Textual Int64) :> (QueryParam "ifSourceMetagenerationNotMatch" (Textual Int64) :> (QueryParam "ifSourceMetagenerationMatch" (Textual Int64) :> (QueryParam "ifGenerationMatch" (Textual Int64) :> (QueryParam "maxBytesRewrittenPerCall" (Textual Int64) :> (QueryParam "userProject" Text :> (QueryParam "ifMetagenerationNotMatch" (Textual Int64) :> (QueryParam "ifSourceGenerationNotMatch" (Textual Int64) :> (QueryParam "projection" ObjectsRewriteProjection :> (QueryParam "sourceGeneration" (Textual Int64) :> (QueryParam "destinationKmsKeyName" Text :> (QueryParam "rewriteToken" Text :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] Object :> Post '[JSON] RewriteResponse))))))))))))))))))))))))))) Source #
A resource alias for storage.objects.rewrite
method which the
ObjectsRewrite
request conforms to.
Creating a Request
Creates a value of ObjectsRewrite
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
orDestinationPredefinedACL
orIfSourceGenerationMatch
orIfMetagenerationMatch
orIfGenerationNotMatch
orIfSourceMetagenerationNotMatch
orIfSourceMetagenerationMatch
orIfGenerationMatch
orSourceObject
orMaxBytesRewrittenPerCall
orSourceBucket
orPayload
orUserProject
orDestinationBucket
orIfMetagenerationNotMatch
orIfSourceGenerationNotMatch
orProjection
orSourceGeneration
orDestinationKmsKeyName
orRewriteToken
orDestinationObject
data ObjectsRewrite Source #
Rewrites a source object to a destination object. Optionally overrides metadata.
See: objectsRewrite
smart constructor.
Instances
Request Lenses
orDestinationPredefinedACL :: Lens' ObjectsRewrite (Maybe ObjectsRewriteDestinationPredefinedACL) Source #
Apply a predefined set of access controls to the destination object.
orIfSourceGenerationMatch :: Lens' ObjectsRewrite (Maybe Int64) Source #
Makes the operation conditional on whether the source object's current generation matches the given value.
orIfMetagenerationMatch :: Lens' ObjectsRewrite (Maybe Int64) Source #
Makes the operation conditional on whether the destination object's current metageneration matches the given value.
orIfGenerationNotMatch :: Lens' ObjectsRewrite (Maybe Int64) Source #
Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
orIfSourceMetagenerationNotMatch :: Lens' ObjectsRewrite (Maybe Int64) Source #
Makes the operation conditional on whether the source object's current metageneration does not match the given value.
orIfSourceMetagenerationMatch :: Lens' ObjectsRewrite (Maybe Int64) Source #
Makes the operation conditional on whether the source object's current metageneration matches the given value.
orIfGenerationMatch :: Lens' ObjectsRewrite (Maybe Int64) Source #
Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
orSourceObject :: Lens' ObjectsRewrite Text Source #
Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.
orMaxBytesRewrittenPerCall :: Lens' ObjectsRewrite (Maybe Int64) Source #
The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.
orSourceBucket :: Lens' ObjectsRewrite Text Source #
Name of the bucket in which to find the source object.
orUserProject :: Lens' ObjectsRewrite (Maybe Text) Source #
The project to be billed for this request. Required for Requester Pays buckets.
orDestinationBucket :: Lens' ObjectsRewrite Text Source #
Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.
orIfMetagenerationNotMatch :: Lens' ObjectsRewrite (Maybe Int64) Source #
Makes the operation conditional on whether the destination object's current metageneration does not match the given value.
orIfSourceGenerationNotMatch :: Lens' ObjectsRewrite (Maybe Int64) Source #
Makes the operation conditional on whether the source object's current generation does not match the given value.
orProjection :: Lens' ObjectsRewrite (Maybe ObjectsRewriteProjection) Source #
Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.
orSourceGeneration :: Lens' ObjectsRewrite (Maybe Int64) Source #
If present, selects a specific revision of the source object (as opposed to the latest version, the default).
orDestinationKmsKeyName :: Lens' ObjectsRewrite (Maybe Text) Source #
Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.
orRewriteToken :: Lens' ObjectsRewrite (Maybe Text) Source #
Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.
orDestinationObject :: Lens' ObjectsRewrite Text Source #
Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.