{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.S3.CopyObject
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a copy of an object that is already stored in Amazon S3.
--
-- You can store individual objects of up to 5 TB in Amazon S3. You create
-- a copy of your object up to 5 GB in size in a single atomic action using
-- this API. However, to copy an object greater than 5 GB, you must use the
-- multipart upload Upload Part - Copy API. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingRESTMPUapi.html Copy Object Using the REST Multipart Upload API>.
--
-- All copy requests must be authenticated. Additionally, you must have
-- /read/ access to the source object and /write/ access to the destination
-- bucket. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html REST Authentication>.
-- Both the Region that you want to copy the object from and the Region
-- that you want to copy the object to must be enabled for your account.
--
-- A copy request might return an error when Amazon S3 receives the copy
-- request or while Amazon S3 is copying the files. If the error occurs
-- before the copy action starts, you receive a standard Amazon S3 error.
-- If the error occurs during the copy operation, the error response is
-- embedded in the @200 OK@ response. This means that a @200 OK@ response
-- can contain either a success or an error. Design your application to
-- parse the contents of the response and handle it appropriately.
--
-- If the copy is successful, you receive a response with information about
-- the copied object.
--
-- If the request is an HTTP 1.1 request, the response is chunk encoded. If
-- it were not, it would not contain the content-length, and you would need
-- to read the entire body.
--
-- The copy request charge is based on the storage class and Region that
-- you specify for the destination object. For pricing information, see
-- <http://aws.amazon.com/s3/pricing/ Amazon S3 pricing>.
--
-- Amazon S3 transfer acceleration does not support cross-Region copies. If
-- you request a cross-Region copy using a transfer acceleration endpoint,
-- you get a 400 @Bad Request@ error. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html Transfer Acceleration>.
--
-- __Metadata__
--
-- When copying an object, you can preserve all metadata (default) or
-- specify new metadata. However, the ACL is not preserved and is set to
-- private for the user making the request. To override the default ACL
-- setting, specify a new ACL when generating a copy request. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html Using ACLs>.
--
-- To specify whether you want the object metadata copied from the source
-- object or replaced with metadata provided in the request, you can
-- optionally add the @x-amz-metadata-directive@ header. When you grant
-- permissions, you can use the @s3:x-amz-metadata-directive@ condition key
-- to enforce certain metadata behavior when objects are uploaded. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/amazon-s3-policy-keys.html Specifying Conditions in a Policy>
-- in the /Amazon S3 User Guide/. For a complete list of Amazon S3-specific
-- condition keys, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/list_amazons3.html Actions, Resources, and Condition Keys for Amazon S3>.
--
-- __@x-amz-copy-source-if@ Headers__
--
-- To only copy an object under certain conditions, such as whether the
-- @Etag@ matches or whether the object was modified before or after a
-- specified date, use the following request parameters:
--
-- -   @x-amz-copy-source-if-match@
--
-- -   @x-amz-copy-source-if-none-match@
--
-- -   @x-amz-copy-source-if-unmodified-since@
--
-- -   @x-amz-copy-source-if-modified-since@
--
-- If both the @x-amz-copy-source-if-match@ and
-- @x-amz-copy-source-if-unmodified-since@ headers are present in the
-- request and evaluate as follows, Amazon S3 returns @200 OK@ and copies
-- the data:
--
-- -   @x-amz-copy-source-if-match@ condition evaluates to true
--
-- -   @x-amz-copy-source-if-unmodified-since@ condition evaluates to false
--
-- If both the @x-amz-copy-source-if-none-match@ and
-- @x-amz-copy-source-if-modified-since@ headers are present in the request
-- and evaluate as follows, Amazon S3 returns the @412 Precondition Failed@
-- response code:
--
-- -   @x-amz-copy-source-if-none-match@ condition evaluates to false
--
-- -   @x-amz-copy-source-if-modified-since@ condition evaluates to true
--
-- All headers with the @x-amz-@ prefix, including @x-amz-copy-source@,
-- must be signed.
--
-- __Server-side encryption__
--
-- When you perform a CopyObject operation, you can optionally use the
-- appropriate encryption-related headers to encrypt the object using
-- server-side encryption with Amazon Web Services managed encryption keys
-- (SSE-S3 or SSE-KMS) or a customer-provided encryption key. With
-- server-side encryption, Amazon S3 encrypts your data as it writes it to
-- disks in its data centers and decrypts the data when you access it. For
-- more information about server-side encryption, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html Using Server-Side Encryption>.
--
-- If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the
-- object. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html Amazon S3 Bucket Keys>
-- in the /Amazon S3 User Guide/.
--
-- __Access Control List (ACL)-Specific Request Headers__
--
-- When copying an object, you can optionally use headers to grant
-- ACL-based permissions. By default, all objects are private. Only the
-- owner has full access control. When adding a new object, you can grant
-- permissions to individual Amazon Web Services accounts or to predefined
-- groups defined by Amazon S3. These permissions are then added to the ACL
-- on the object. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html Access Control List (ACL) Overview>
-- and
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html Managing ACLs Using the REST API>.
--
-- __Storage Class Options__
--
-- You can use the @CopyObject@ action to change the storage class of an
-- object that is already stored in Amazon S3 using the @StorageClass@
-- parameter. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html Storage Classes>
-- in the /Amazon S3 User Guide/.
--
-- __Versioning__
--
-- By default, @x-amz-copy-source@ identifies the current version of an
-- object to copy. If the current version is a delete marker, Amazon S3
-- behaves as if the object was deleted. To copy a different version, use
-- the @versionId@ subresource.
--
-- If you enable versioning on the target bucket, Amazon S3 generates a
-- unique version ID for the object being copied. This version ID is
-- different from the version ID of the source object. Amazon S3 returns
-- the version ID of the copied object in the @x-amz-version-id@ response
-- header in the response.
--
-- If you do not enable versioning or suspend it on the target bucket, the
-- version ID that Amazon S3 generates is always null.
--
-- If the source object\'s storage class is GLACIER, you must restore a
-- copy of this object before you can use it as a source object for the
-- copy operation. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html RestoreObject>.
--
-- The following operations are related to @CopyObject@:
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html PutObject>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html GetObject>
--
-- For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjectsExamples.html Copying Objects>.
module Amazonka.S3.CopyObject
  ( -- * Creating a Request
    CopyObject (..),
    newCopyObject,

    -- * Request Lenses
    copyObject_copySourceIfModifiedSince,
    copyObject_copySourceIfUnmodifiedSince,
    copyObject_copySourceSSECustomerKeyMD5,
    copyObject_taggingDirective,
    copyObject_metadataDirective,
    copyObject_objectLockMode,
    copyObject_expires,
    copyObject_grantReadACP,
    copyObject_copySourceIfNoneMatch,
    copyObject_sSECustomerAlgorithm,
    copyObject_sSECustomerKey,
    copyObject_requestPayer,
    copyObject_grantWriteACP,
    copyObject_copySourceIfMatch,
    copyObject_bucketKeyEnabled,
    copyObject_websiteRedirectLocation,
    copyObject_grantRead,
    copyObject_expectedSourceBucketOwner,
    copyObject_storageClass,
    copyObject_sSECustomerKeyMD5,
    copyObject_sSEKMSKeyId,
    copyObject_grantFullControl,
    copyObject_contentEncoding,
    copyObject_tagging,
    copyObject_objectLockRetainUntilDate,
    copyObject_metadata,
    copyObject_sSEKMSEncryptionContext,
    copyObject_cacheControl,
    copyObject_contentLanguage,
    copyObject_copySourceSSECustomerKey,
    copyObject_objectLockLegalHoldStatus,
    copyObject_copySourceSSECustomerAlgorithm,
    copyObject_acl,
    copyObject_contentDisposition,
    copyObject_expectedBucketOwner,
    copyObject_serverSideEncryption,
    copyObject_contentType,
    copyObject_bucket,
    copyObject_copySource,
    copyObject_key,

    -- * Destructuring the Response
    CopyObjectResponse (..),
    newCopyObjectResponse,

    -- * Response Lenses
    copyObjectResponse_requestCharged,
    copyObjectResponse_versionId,
    copyObjectResponse_expiration,
    copyObjectResponse_sSECustomerAlgorithm,
    copyObjectResponse_bucketKeyEnabled,
    copyObjectResponse_copySourceVersionId,
    copyObjectResponse_sSECustomerKeyMD5,
    copyObjectResponse_sSEKMSKeyId,
    copyObjectResponse_sSEKMSEncryptionContext,
    copyObjectResponse_serverSideEncryption,
    copyObjectResponse_copyObjectResult,
    copyObjectResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.S3.Types

-- | /See:/ 'newCopyObject' smart constructor.
data CopyObject = CopyObject'
  { -- | Copies the object if it has been modified since the specified time.
    CopyObject -> Maybe ISO8601
copySourceIfModifiedSince :: Prelude.Maybe Core.ISO8601,
    -- | Copies the object if it hasn\'t been modified since the specified time.
    CopyObject -> Maybe ISO8601
copySourceIfUnmodifiedSince :: Prelude.Maybe Core.ISO8601,
    -- | Specifies the 128-bit MD5 digest of the encryption key according to RFC
    -- 1321. Amazon S3 uses this header for a message integrity check to ensure
    -- that the encryption key was transmitted without error.
    CopyObject -> Maybe Text
copySourceSSECustomerKeyMD5 :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the object tag-set are copied from the source object
    -- or replaced with tag-set provided in the request.
    CopyObject -> Maybe TaggingDirective
taggingDirective :: Prelude.Maybe TaggingDirective,
    -- | Specifies whether the metadata is copied from the source object or
    -- replaced with metadata provided in the request.
    CopyObject -> Maybe MetadataDirective
metadataDirective :: Prelude.Maybe MetadataDirective,
    -- | The Object Lock mode that you want to apply to the copied object.
    CopyObject -> Maybe ObjectLockMode
objectLockMode :: Prelude.Maybe ObjectLockMode,
    -- | The date and time at which the object is no longer cacheable.
    CopyObject -> Maybe ISO8601
expires :: Prelude.Maybe Core.ISO8601,
    -- | Allows grantee to read the object ACL.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    CopyObject -> Maybe Text
grantReadACP :: Prelude.Maybe Prelude.Text,
    -- | Copies the object if its entity tag (ETag) is different than the
    -- specified ETag.
    CopyObject -> Maybe Text
copySourceIfNoneMatch :: Prelude.Maybe Prelude.Text,
    -- | Specifies the algorithm to use to when encrypting the object (for
    -- example, AES256).
    CopyObject -> Maybe Text
sSECustomerAlgorithm :: Prelude.Maybe Prelude.Text,
    -- | Specifies the customer-provided encryption key for Amazon S3 to use in
    -- encrypting data. This value is used to store the object and then it is
    -- discarded; Amazon S3 does not store the encryption key. The key must be
    -- appropriate for use with the algorithm specified in the
    -- @x-amz-server-side-encryption-customer-algorithm@ header.
    CopyObject -> Maybe (Sensitive Text)
sSECustomerKey :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    CopyObject -> Maybe RequestPayer
requestPayer :: Prelude.Maybe RequestPayer,
    -- | Allows grantee to write the ACL for the applicable object.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    CopyObject -> Maybe Text
grantWriteACP :: Prelude.Maybe Prelude.Text,
    -- | Copies the object if its entity tag (ETag) matches the specified tag.
    CopyObject -> Maybe Text
copySourceIfMatch :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether Amazon S3 should use an S3 Bucket Key for object
    -- encryption with server-side encryption using AWS KMS (SSE-KMS). Setting
    -- this header to @true@ causes Amazon S3 to use an S3 Bucket Key for
    -- object encryption with SSE-KMS.
    --
    -- Specifying this header with a COPY action doesn’t affect bucket-level
    -- settings for S3 Bucket Key.
    CopyObject -> Maybe Bool
bucketKeyEnabled :: Prelude.Maybe Prelude.Bool,
    -- | If the bucket is configured as a website, redirects requests for this
    -- object to another object in the same bucket or to an external URL.
    -- Amazon S3 stores the value of this header in the object metadata.
    CopyObject -> Maybe Text
websiteRedirectLocation :: Prelude.Maybe Prelude.Text,
    -- | Allows grantee to read the object data and its metadata.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    CopyObject -> Maybe Text
grantRead :: Prelude.Maybe Prelude.Text,
    -- | The account ID of the expected source bucket owner. If the source bucket
    -- is owned by a different account, the request will fail with an HTTP
    -- @403 (Access Denied)@ error.
    CopyObject -> Maybe Text
expectedSourceBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | By default, Amazon S3 uses the STANDARD Storage Class to store newly
    -- created objects. The STANDARD storage class provides high durability and
    -- high availability. Depending on performance needs, you can specify a
    -- different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS
    -- Storage Class. For more information, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html Storage Classes>
    -- in the /Amazon S3 User Guide/.
    CopyObject -> Maybe StorageClass
storageClass :: Prelude.Maybe StorageClass,
    -- | Specifies the 128-bit MD5 digest of the encryption key according to RFC
    -- 1321. Amazon S3 uses this header for a message integrity check to ensure
    -- that the encryption key was transmitted without error.
    CopyObject -> Maybe Text
sSECustomerKeyMD5 :: Prelude.Maybe Prelude.Text,
    -- | Specifies the Amazon Web Services KMS key ID to use for object
    -- encryption. All GET and PUT requests for an object protected by Amazon
    -- Web Services KMS will fail if not made via SSL or using SigV4. For
    -- information about configuring using any of the officially supported
    -- Amazon Web Services SDKs and Amazon Web Services CLI, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version Specifying the Signature Version in Request Authentication>
    -- in the /Amazon S3 User Guide/.
    CopyObject -> Maybe (Sensitive Text)
sSEKMSKeyId :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the
    -- object.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    CopyObject -> Maybe Text
grantFullControl :: Prelude.Maybe Prelude.Text,
    -- | Specifies what content encodings have been applied to the object and
    -- thus what decoding mechanisms must be applied to obtain the media-type
    -- referenced by the Content-Type header field.
    CopyObject -> Maybe Text
contentEncoding :: Prelude.Maybe Prelude.Text,
    -- | The tag-set for the object destination object this value must be used in
    -- conjunction with the @TaggingDirective@. The tag-set must be encoded as
    -- URL Query parameters.
    CopyObject -> Maybe Text
tagging :: Prelude.Maybe Prelude.Text,
    -- | The date and time when you want the copied object\'s Object Lock to
    -- expire.
    CopyObject -> Maybe ISO8601
objectLockRetainUntilDate :: Prelude.Maybe Core.ISO8601,
    -- | A map of metadata to store with the object in S3.
    CopyObject -> HashMap Text Text
metadata :: Prelude.HashMap Prelude.Text Prelude.Text,
    -- | Specifies the Amazon Web Services KMS Encryption Context to use for
    -- object encryption. The value of this header is a base64-encoded UTF-8
    -- string holding JSON with the encryption context key-value pairs.
    CopyObject -> Maybe (Sensitive Text)
sSEKMSEncryptionContext :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Specifies caching behavior along the request\/reply chain.
    CopyObject -> Maybe Text
cacheControl :: Prelude.Maybe Prelude.Text,
    -- | The language the content is in.
    CopyObject -> Maybe Text
contentLanguage :: Prelude.Maybe Prelude.Text,
    -- | Specifies the customer-provided encryption key for Amazon S3 to use to
    -- decrypt the source object. The encryption key provided in this header
    -- must be one that was used when the source object was created.
    CopyObject -> Maybe (Sensitive Text)
copySourceSSECustomerKey :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Specifies whether you want to apply a Legal Hold to the copied object.
    CopyObject -> Maybe ObjectLockLegalHoldStatus
objectLockLegalHoldStatus :: Prelude.Maybe ObjectLockLegalHoldStatus,
    -- | Specifies the algorithm to use when decrypting the source object (for
    -- example, AES256).
    CopyObject -> Maybe Text
copySourceSSECustomerAlgorithm :: Prelude.Maybe Prelude.Text,
    -- | The canned ACL to apply to the object.
    --
    -- This action is not supported by Amazon S3 on Outposts.
    CopyObject -> Maybe ObjectCannedACL
acl :: Prelude.Maybe ObjectCannedACL,
    -- | Specifies presentational information for the object.
    CopyObject -> Maybe Text
contentDisposition :: Prelude.Maybe Prelude.Text,
    -- | The account ID of the expected destination bucket owner. If the
    -- destination bucket is owned by a different account, the request will
    -- fail with an HTTP @403 (Access Denied)@ error.
    CopyObject -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The server-side encryption algorithm used when storing this object in
    -- Amazon S3 (for example, AES256, aws:kms).
    CopyObject -> Maybe ServerSideEncryption
serverSideEncryption :: Prelude.Maybe ServerSideEncryption,
    -- | A standard MIME type describing the format of the object data.
    CopyObject -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
    -- | The name of the destination bucket.
    --
    -- When using this action with an access point, you must direct requests to
    -- the access point hostname. The access point hostname takes the form
    -- /AccessPointName/-/AccountId/.s3-accesspoint./Region/.amazonaws.com.
    -- When using this action with an access point through the Amazon Web
    -- Services SDKs, you provide the access point ARN in place of the bucket
    -- name. For more information about access point ARNs, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
    -- in the /Amazon S3 User Guide/.
    --
    -- When using this action with Amazon S3 on Outposts, you must direct
    -- requests to the S3 on Outposts hostname. The S3 on Outposts hostname
    -- takes the form
    -- /AccessPointName/-/AccountId/./outpostID/.s3-outposts./Region/.amazonaws.com.
    -- When using this action using S3 on Outposts through the Amazon Web
    -- Services SDKs, you provide the Outposts bucket ARN in place of the
    -- bucket name. For more information about S3 on Outposts ARNs, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html Using S3 on Outposts>
    -- in the /Amazon S3 User Guide/.
    CopyObject -> BucketName
bucket :: BucketName,
    -- | Specifies the source object for the copy operation. You specify the
    -- value in one of two formats, depending on whether you want to access the
    -- source object through an
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html access point>:
    --
    -- -   For objects not accessed through an access point, specify the name
    --     of the source bucket and the key of the source object, separated by
    --     a slash (\/). For example, to copy the object @reports\/january.pdf@
    --     from the bucket @awsexamplebucket@, use
    --     @awsexamplebucket\/reports\/january.pdf@. The value must be URL
    --     encoded.
    --
    -- -   For objects accessed through access points, specify the Amazon
    --     Resource Name (ARN) of the object as accessed through the access
    --     point, in the format
    --     @arn:aws:s3:\<Region>:\<account-id>:accesspoint\/\<access-point-name>\/object\/\<key>@.
    --     For example, to copy the object @reports\/january.pdf@ through
    --     access point @my-access-point@ owned by account @123456789012@ in
    --     Region @us-west-2@, use the URL encoding of
    --     @arn:aws:s3:us-west-2:123456789012:accesspoint\/my-access-point\/object\/reports\/january.pdf@.
    --     The value must be URL encoded.
    --
    --     Amazon S3 supports copy operations using access points only when the
    --     source and destination buckets are in the same Amazon Web Services
    --     Region.
    --
    --     Alternatively, for objects accessed through Amazon S3 on Outposts,
    --     specify the ARN of the object as accessed in the format
    --     @arn:aws:s3-outposts:\<Region>:\<account-id>:outpost\/\<outpost-id>\/object\/\<key>@.
    --     For example, to copy the object @reports\/january.pdf@ through
    --     outpost @my-outpost@ owned by account @123456789012@ in Region
    --     @us-west-2@, use the URL encoding of
    --     @arn:aws:s3-outposts:us-west-2:123456789012:outpost\/my-outpost\/object\/reports\/january.pdf@.
    --     The value must be URL encoded.
    --
    -- To copy a specific version of an object, append
    -- @?versionId=\<version-id>@ to the value (for example,
    -- @awsexamplebucket\/reports\/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893@).
    -- If you don\'t specify a version ID, Amazon S3 copies the latest version
    -- of the source object.
    CopyObject -> Text
copySource :: Prelude.Text,
    -- | The key of the destination object.
    CopyObject -> ObjectKey
key :: ObjectKey
  }
  deriving (CopyObject -> CopyObject -> Bool
(CopyObject -> CopyObject -> Bool)
-> (CopyObject -> CopyObject -> Bool) -> Eq CopyObject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CopyObject -> CopyObject -> Bool
$c/= :: CopyObject -> CopyObject -> Bool
== :: CopyObject -> CopyObject -> Bool
$c== :: CopyObject -> CopyObject -> Bool
Prelude.Eq, Int -> CopyObject -> ShowS
[CopyObject] -> ShowS
CopyObject -> String
(Int -> CopyObject -> ShowS)
-> (CopyObject -> String)
-> ([CopyObject] -> ShowS)
-> Show CopyObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CopyObject] -> ShowS
$cshowList :: [CopyObject] -> ShowS
show :: CopyObject -> String
$cshow :: CopyObject -> String
showsPrec :: Int -> CopyObject -> ShowS
$cshowsPrec :: Int -> CopyObject -> ShowS
Prelude.Show, (forall x. CopyObject -> Rep CopyObject x)
-> (forall x. Rep CopyObject x -> CopyObject) -> Generic CopyObject
forall x. Rep CopyObject x -> CopyObject
forall x. CopyObject -> Rep CopyObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CopyObject x -> CopyObject
$cfrom :: forall x. CopyObject -> Rep CopyObject x
Prelude.Generic)

-- |
-- Create a value of 'CopyObject' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'copySourceIfModifiedSince', 'copyObject_copySourceIfModifiedSince' - Copies the object if it has been modified since the specified time.
--
-- 'copySourceIfUnmodifiedSince', 'copyObject_copySourceIfUnmodifiedSince' - Copies the object if it hasn\'t been modified since the specified time.
--
-- 'copySourceSSECustomerKeyMD5', 'copyObject_copySourceSSECustomerKeyMD5' - Specifies the 128-bit MD5 digest of the encryption key according to RFC
-- 1321. Amazon S3 uses this header for a message integrity check to ensure
-- that the encryption key was transmitted without error.
--
-- 'taggingDirective', 'copyObject_taggingDirective' - Specifies whether the object tag-set are copied from the source object
-- or replaced with tag-set provided in the request.
--
-- 'metadataDirective', 'copyObject_metadataDirective' - Specifies whether the metadata is copied from the source object or
-- replaced with metadata provided in the request.
--
-- 'objectLockMode', 'copyObject_objectLockMode' - The Object Lock mode that you want to apply to the copied object.
--
-- 'expires', 'copyObject_expires' - The date and time at which the object is no longer cacheable.
--
-- 'grantReadACP', 'copyObject_grantReadACP' - Allows grantee to read the object ACL.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'copySourceIfNoneMatch', 'copyObject_copySourceIfNoneMatch' - Copies the object if its entity tag (ETag) is different than the
-- specified ETag.
--
-- 'sSECustomerAlgorithm', 'copyObject_sSECustomerAlgorithm' - Specifies the algorithm to use to when encrypting the object (for
-- example, AES256).
--
-- 'sSECustomerKey', 'copyObject_sSECustomerKey' - Specifies the customer-provided encryption key for Amazon S3 to use in
-- encrypting data. This value is used to store the object and then it is
-- discarded; Amazon S3 does not store the encryption key. The key must be
-- appropriate for use with the algorithm specified in the
-- @x-amz-server-side-encryption-customer-algorithm@ header.
--
-- 'requestPayer', 'copyObject_requestPayer' - Undocumented member.
--
-- 'grantWriteACP', 'copyObject_grantWriteACP' - Allows grantee to write the ACL for the applicable object.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'copySourceIfMatch', 'copyObject_copySourceIfMatch' - Copies the object if its entity tag (ETag) matches the specified tag.
--
-- 'bucketKeyEnabled', 'copyObject_bucketKeyEnabled' - Specifies whether Amazon S3 should use an S3 Bucket Key for object
-- encryption with server-side encryption using AWS KMS (SSE-KMS). Setting
-- this header to @true@ causes Amazon S3 to use an S3 Bucket Key for
-- object encryption with SSE-KMS.
--
-- Specifying this header with a COPY action doesn’t affect bucket-level
-- settings for S3 Bucket Key.
--
-- 'websiteRedirectLocation', 'copyObject_websiteRedirectLocation' - If the bucket is configured as a website, redirects requests for this
-- object to another object in the same bucket or to an external URL.
-- Amazon S3 stores the value of this header in the object metadata.
--
-- 'grantRead', 'copyObject_grantRead' - Allows grantee to read the object data and its metadata.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'expectedSourceBucketOwner', 'copyObject_expectedSourceBucketOwner' - The account ID of the expected source bucket owner. If the source bucket
-- is owned by a different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
--
-- 'storageClass', 'copyObject_storageClass' - By default, Amazon S3 uses the STANDARD Storage Class to store newly
-- created objects. The STANDARD storage class provides high durability and
-- high availability. Depending on performance needs, you can specify a
-- different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS
-- Storage Class. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html Storage Classes>
-- in the /Amazon S3 User Guide/.
--
-- 'sSECustomerKeyMD5', 'copyObject_sSECustomerKeyMD5' - Specifies the 128-bit MD5 digest of the encryption key according to RFC
-- 1321. Amazon S3 uses this header for a message integrity check to ensure
-- that the encryption key was transmitted without error.
--
-- 'sSEKMSKeyId', 'copyObject_sSEKMSKeyId' - Specifies the Amazon Web Services KMS key ID to use for object
-- encryption. All GET and PUT requests for an object protected by Amazon
-- Web Services KMS will fail if not made via SSL or using SigV4. For
-- information about configuring using any of the officially supported
-- Amazon Web Services SDKs and Amazon Web Services CLI, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version Specifying the Signature Version in Request Authentication>
-- in the /Amazon S3 User Guide/.
--
-- 'grantFullControl', 'copyObject_grantFullControl' - Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the
-- object.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'contentEncoding', 'copyObject_contentEncoding' - Specifies what content encodings have been applied to the object and
-- thus what decoding mechanisms must be applied to obtain the media-type
-- referenced by the Content-Type header field.
--
-- 'tagging', 'copyObject_tagging' - The tag-set for the object destination object this value must be used in
-- conjunction with the @TaggingDirective@. The tag-set must be encoded as
-- URL Query parameters.
--
-- 'objectLockRetainUntilDate', 'copyObject_objectLockRetainUntilDate' - The date and time when you want the copied object\'s Object Lock to
-- expire.
--
-- 'metadata', 'copyObject_metadata' - A map of metadata to store with the object in S3.
--
-- 'sSEKMSEncryptionContext', 'copyObject_sSEKMSEncryptionContext' - Specifies the Amazon Web Services KMS Encryption Context to use for
-- object encryption. The value of this header is a base64-encoded UTF-8
-- string holding JSON with the encryption context key-value pairs.
--
-- 'cacheControl', 'copyObject_cacheControl' - Specifies caching behavior along the request\/reply chain.
--
-- 'contentLanguage', 'copyObject_contentLanguage' - The language the content is in.
--
-- 'copySourceSSECustomerKey', 'copyObject_copySourceSSECustomerKey' - Specifies the customer-provided encryption key for Amazon S3 to use to
-- decrypt the source object. The encryption key provided in this header
-- must be one that was used when the source object was created.
--
-- 'objectLockLegalHoldStatus', 'copyObject_objectLockLegalHoldStatus' - Specifies whether you want to apply a Legal Hold to the copied object.
--
-- 'copySourceSSECustomerAlgorithm', 'copyObject_copySourceSSECustomerAlgorithm' - Specifies the algorithm to use when decrypting the source object (for
-- example, AES256).
--
-- 'acl', 'copyObject_acl' - The canned ACL to apply to the object.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- 'contentDisposition', 'copyObject_contentDisposition' - Specifies presentational information for the object.
--
-- 'expectedBucketOwner', 'copyObject_expectedBucketOwner' - The account ID of the expected destination bucket owner. If the
-- destination bucket is owned by a different account, the request will
-- fail with an HTTP @403 (Access Denied)@ error.
--
-- 'serverSideEncryption', 'copyObject_serverSideEncryption' - The server-side encryption algorithm used when storing this object in
-- Amazon S3 (for example, AES256, aws:kms).
--
-- 'contentType', 'copyObject_contentType' - A standard MIME type describing the format of the object data.
--
-- 'bucket', 'copyObject_bucket' - The name of the destination bucket.
--
-- When using this action with an access point, you must direct requests to
-- the access point hostname. The access point hostname takes the form
-- /AccessPointName/-/AccountId/.s3-accesspoint./Region/.amazonaws.com.
-- When using this action with an access point through the Amazon Web
-- Services SDKs, you provide the access point ARN in place of the bucket
-- name. For more information about access point ARNs, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
-- in the /Amazon S3 User Guide/.
--
-- When using this action with Amazon S3 on Outposts, you must direct
-- requests to the S3 on Outposts hostname. The S3 on Outposts hostname
-- takes the form
-- /AccessPointName/-/AccountId/./outpostID/.s3-outposts./Region/.amazonaws.com.
-- When using this action using S3 on Outposts through the Amazon Web
-- Services SDKs, you provide the Outposts bucket ARN in place of the
-- bucket name. For more information about S3 on Outposts ARNs, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html Using S3 on Outposts>
-- in the /Amazon S3 User Guide/.
--
-- 'copySource', 'copyObject_copySource' - Specifies the source object for the copy operation. You specify the
-- value in one of two formats, depending on whether you want to access the
-- source object through an
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html access point>:
--
-- -   For objects not accessed through an access point, specify the name
--     of the source bucket and the key of the source object, separated by
--     a slash (\/). For example, to copy the object @reports\/january.pdf@
--     from the bucket @awsexamplebucket@, use
--     @awsexamplebucket\/reports\/january.pdf@. The value must be URL
--     encoded.
--
-- -   For objects accessed through access points, specify the Amazon
--     Resource Name (ARN) of the object as accessed through the access
--     point, in the format
--     @arn:aws:s3:\<Region>:\<account-id>:accesspoint\/\<access-point-name>\/object\/\<key>@.
--     For example, to copy the object @reports\/january.pdf@ through
--     access point @my-access-point@ owned by account @123456789012@ in
--     Region @us-west-2@, use the URL encoding of
--     @arn:aws:s3:us-west-2:123456789012:accesspoint\/my-access-point\/object\/reports\/january.pdf@.
--     The value must be URL encoded.
--
--     Amazon S3 supports copy operations using access points only when the
--     source and destination buckets are in the same Amazon Web Services
--     Region.
--
--     Alternatively, for objects accessed through Amazon S3 on Outposts,
--     specify the ARN of the object as accessed in the format
--     @arn:aws:s3-outposts:\<Region>:\<account-id>:outpost\/\<outpost-id>\/object\/\<key>@.
--     For example, to copy the object @reports\/january.pdf@ through
--     outpost @my-outpost@ owned by account @123456789012@ in Region
--     @us-west-2@, use the URL encoding of
--     @arn:aws:s3-outposts:us-west-2:123456789012:outpost\/my-outpost\/object\/reports\/january.pdf@.
--     The value must be URL encoded.
--
-- To copy a specific version of an object, append
-- @?versionId=\<version-id>@ to the value (for example,
-- @awsexamplebucket\/reports\/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893@).
-- If you don\'t specify a version ID, Amazon S3 copies the latest version
-- of the source object.
--
-- 'key', 'copyObject_key' - The key of the destination object.
newCopyObject ::
  -- | 'bucket'
  BucketName ->
  -- | 'copySource'
  Prelude.Text ->
  -- | 'key'
  ObjectKey ->
  CopyObject
newCopyObject :: BucketName -> Text -> ObjectKey -> CopyObject
newCopyObject BucketName
pBucket_ Text
pCopySource_ ObjectKey
pKey_ =
  CopyObject' :: Maybe ISO8601
-> Maybe ISO8601
-> Maybe Text
-> Maybe TaggingDirective
-> Maybe MetadataDirective
-> Maybe ObjectLockMode
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe RequestPayer
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe StorageClass
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> HashMap Text Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe ObjectLockLegalHoldStatus
-> Maybe Text
-> Maybe ObjectCannedACL
-> Maybe Text
-> Maybe Text
-> Maybe ServerSideEncryption
-> Maybe Text
-> BucketName
-> Text
-> ObjectKey
-> CopyObject
CopyObject'
    { $sel:copySourceIfModifiedSince:CopyObject' :: Maybe ISO8601
copySourceIfModifiedSince =
        Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:copySourceIfUnmodifiedSince:CopyObject' :: Maybe ISO8601
copySourceIfUnmodifiedSince = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:copySourceSSECustomerKeyMD5:CopyObject' :: Maybe Text
copySourceSSECustomerKeyMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taggingDirective:CopyObject' :: Maybe TaggingDirective
taggingDirective = Maybe TaggingDirective
forall a. Maybe a
Prelude.Nothing,
      $sel:metadataDirective:CopyObject' :: Maybe MetadataDirective
metadataDirective = Maybe MetadataDirective
forall a. Maybe a
Prelude.Nothing,
      $sel:objectLockMode:CopyObject' :: Maybe ObjectLockMode
objectLockMode = Maybe ObjectLockMode
forall a. Maybe a
Prelude.Nothing,
      $sel:expires:CopyObject' :: Maybe ISO8601
expires = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:grantReadACP:CopyObject' :: Maybe Text
grantReadACP = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:copySourceIfNoneMatch:CopyObject' :: Maybe Text
copySourceIfNoneMatch = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sSECustomerAlgorithm:CopyObject' :: Maybe Text
sSECustomerAlgorithm = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sSECustomerKey:CopyObject' :: Maybe (Sensitive Text)
sSECustomerKey = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:requestPayer:CopyObject' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
forall a. Maybe a
Prelude.Nothing,
      $sel:grantWriteACP:CopyObject' :: Maybe Text
grantWriteACP = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:copySourceIfMatch:CopyObject' :: Maybe Text
copySourceIfMatch = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketKeyEnabled:CopyObject' :: Maybe Bool
bucketKeyEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:websiteRedirectLocation:CopyObject' :: Maybe Text
websiteRedirectLocation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:grantRead:CopyObject' :: Maybe Text
grantRead = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedSourceBucketOwner:CopyObject' :: Maybe Text
expectedSourceBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:storageClass:CopyObject' :: Maybe StorageClass
storageClass = Maybe StorageClass
forall a. Maybe a
Prelude.Nothing,
      $sel:sSECustomerKeyMD5:CopyObject' :: Maybe Text
sSECustomerKeyMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sSEKMSKeyId:CopyObject' :: Maybe (Sensitive Text)
sSEKMSKeyId = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:grantFullControl:CopyObject' :: Maybe Text
grantFullControl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentEncoding:CopyObject' :: Maybe Text
contentEncoding = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tagging:CopyObject' :: Maybe Text
tagging = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:objectLockRetainUntilDate:CopyObject' :: Maybe ISO8601
objectLockRetainUntilDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:metadata:CopyObject' :: HashMap Text Text
metadata = HashMap Text Text
forall a. Monoid a => a
Prelude.mempty,
      $sel:sSEKMSEncryptionContext:CopyObject' :: Maybe (Sensitive Text)
sSEKMSEncryptionContext = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheControl:CopyObject' :: Maybe Text
cacheControl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentLanguage:CopyObject' :: Maybe Text
contentLanguage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:copySourceSSECustomerKey:CopyObject' :: Maybe (Sensitive Text)
copySourceSSECustomerKey = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:objectLockLegalHoldStatus:CopyObject' :: Maybe ObjectLockLegalHoldStatus
objectLockLegalHoldStatus = Maybe ObjectLockLegalHoldStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:copySourceSSECustomerAlgorithm:CopyObject' :: Maybe Text
copySourceSSECustomerAlgorithm = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:acl:CopyObject' :: Maybe ObjectCannedACL
acl = Maybe ObjectCannedACL
forall a. Maybe a
Prelude.Nothing,
      $sel:contentDisposition:CopyObject' :: Maybe Text
contentDisposition = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:CopyObject' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serverSideEncryption:CopyObject' :: Maybe ServerSideEncryption
serverSideEncryption = Maybe ServerSideEncryption
forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:CopyObject' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:CopyObject' :: BucketName
bucket = BucketName
pBucket_,
      $sel:copySource:CopyObject' :: Text
copySource = Text
pCopySource_,
      $sel:key:CopyObject' :: ObjectKey
key = ObjectKey
pKey_
    }

-- | Copies the object if it has been modified since the specified time.
copyObject_copySourceIfModifiedSince :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.UTCTime)
copyObject_copySourceIfModifiedSince :: (Maybe UTCTime -> f (Maybe UTCTime)) -> CopyObject -> f CopyObject
copyObject_copySourceIfModifiedSince = (CopyObject -> Maybe ISO8601)
-> (CopyObject -> Maybe ISO8601 -> CopyObject)
-> Lens CopyObject CopyObject (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe ISO8601
copySourceIfModifiedSince :: Maybe ISO8601
$sel:copySourceIfModifiedSince:CopyObject' :: CopyObject -> Maybe ISO8601
copySourceIfModifiedSince} -> Maybe ISO8601
copySourceIfModifiedSince) (\s :: CopyObject
s@CopyObject' {} Maybe ISO8601
a -> CopyObject
s {$sel:copySourceIfModifiedSince:CopyObject' :: Maybe ISO8601
copySourceIfModifiedSince = Maybe ISO8601
a} :: CopyObject) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> CopyObject -> f CopyObject)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CopyObject
-> f CopyObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Copies the object if it hasn\'t been modified since the specified time.
copyObject_copySourceIfUnmodifiedSince :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.UTCTime)
copyObject_copySourceIfUnmodifiedSince :: (Maybe UTCTime -> f (Maybe UTCTime)) -> CopyObject -> f CopyObject
copyObject_copySourceIfUnmodifiedSince = (CopyObject -> Maybe ISO8601)
-> (CopyObject -> Maybe ISO8601 -> CopyObject)
-> Lens CopyObject CopyObject (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe ISO8601
copySourceIfUnmodifiedSince :: Maybe ISO8601
$sel:copySourceIfUnmodifiedSince:CopyObject' :: CopyObject -> Maybe ISO8601
copySourceIfUnmodifiedSince} -> Maybe ISO8601
copySourceIfUnmodifiedSince) (\s :: CopyObject
s@CopyObject' {} Maybe ISO8601
a -> CopyObject
s {$sel:copySourceIfUnmodifiedSince:CopyObject' :: Maybe ISO8601
copySourceIfUnmodifiedSince = Maybe ISO8601
a} :: CopyObject) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> CopyObject -> f CopyObject)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CopyObject
-> f CopyObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Specifies the 128-bit MD5 digest of the encryption key according to RFC
-- 1321. Amazon S3 uses this header for a message integrity check to ensure
-- that the encryption key was transmitted without error.
copyObject_copySourceSSECustomerKeyMD5 :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_copySourceSSECustomerKeyMD5 :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_copySourceSSECustomerKeyMD5 = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
copySourceSSECustomerKeyMD5 :: Maybe Text
$sel:copySourceSSECustomerKeyMD5:CopyObject' :: CopyObject -> Maybe Text
copySourceSSECustomerKeyMD5} -> Maybe Text
copySourceSSECustomerKeyMD5) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:copySourceSSECustomerKeyMD5:CopyObject' :: Maybe Text
copySourceSSECustomerKeyMD5 = Maybe Text
a} :: CopyObject)

-- | Specifies whether the object tag-set are copied from the source object
-- or replaced with tag-set provided in the request.
copyObject_taggingDirective :: Lens.Lens' CopyObject (Prelude.Maybe TaggingDirective)
copyObject_taggingDirective :: (Maybe TaggingDirective -> f (Maybe TaggingDirective))
-> CopyObject -> f CopyObject
copyObject_taggingDirective = (CopyObject -> Maybe TaggingDirective)
-> (CopyObject -> Maybe TaggingDirective -> CopyObject)
-> Lens
     CopyObject
     CopyObject
     (Maybe TaggingDirective)
     (Maybe TaggingDirective)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe TaggingDirective
taggingDirective :: Maybe TaggingDirective
$sel:taggingDirective:CopyObject' :: CopyObject -> Maybe TaggingDirective
taggingDirective} -> Maybe TaggingDirective
taggingDirective) (\s :: CopyObject
s@CopyObject' {} Maybe TaggingDirective
a -> CopyObject
s {$sel:taggingDirective:CopyObject' :: Maybe TaggingDirective
taggingDirective = Maybe TaggingDirective
a} :: CopyObject)

-- | Specifies whether the metadata is copied from the source object or
-- replaced with metadata provided in the request.
copyObject_metadataDirective :: Lens.Lens' CopyObject (Prelude.Maybe MetadataDirective)
copyObject_metadataDirective :: (Maybe MetadataDirective -> f (Maybe MetadataDirective))
-> CopyObject -> f CopyObject
copyObject_metadataDirective = (CopyObject -> Maybe MetadataDirective)
-> (CopyObject -> Maybe MetadataDirective -> CopyObject)
-> Lens
     CopyObject
     CopyObject
     (Maybe MetadataDirective)
     (Maybe MetadataDirective)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe MetadataDirective
metadataDirective :: Maybe MetadataDirective
$sel:metadataDirective:CopyObject' :: CopyObject -> Maybe MetadataDirective
metadataDirective} -> Maybe MetadataDirective
metadataDirective) (\s :: CopyObject
s@CopyObject' {} Maybe MetadataDirective
a -> CopyObject
s {$sel:metadataDirective:CopyObject' :: Maybe MetadataDirective
metadataDirective = Maybe MetadataDirective
a} :: CopyObject)

-- | The Object Lock mode that you want to apply to the copied object.
copyObject_objectLockMode :: Lens.Lens' CopyObject (Prelude.Maybe ObjectLockMode)
copyObject_objectLockMode :: (Maybe ObjectLockMode -> f (Maybe ObjectLockMode))
-> CopyObject -> f CopyObject
copyObject_objectLockMode = (CopyObject -> Maybe ObjectLockMode)
-> (CopyObject -> Maybe ObjectLockMode -> CopyObject)
-> Lens
     CopyObject CopyObject (Maybe ObjectLockMode) (Maybe ObjectLockMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe ObjectLockMode
objectLockMode :: Maybe ObjectLockMode
$sel:objectLockMode:CopyObject' :: CopyObject -> Maybe ObjectLockMode
objectLockMode} -> Maybe ObjectLockMode
objectLockMode) (\s :: CopyObject
s@CopyObject' {} Maybe ObjectLockMode
a -> CopyObject
s {$sel:objectLockMode:CopyObject' :: Maybe ObjectLockMode
objectLockMode = Maybe ObjectLockMode
a} :: CopyObject)

-- | The date and time at which the object is no longer cacheable.
copyObject_expires :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.UTCTime)
copyObject_expires :: (Maybe UTCTime -> f (Maybe UTCTime)) -> CopyObject -> f CopyObject
copyObject_expires = (CopyObject -> Maybe ISO8601)
-> (CopyObject -> Maybe ISO8601 -> CopyObject)
-> Lens CopyObject CopyObject (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe ISO8601
expires :: Maybe ISO8601
$sel:expires:CopyObject' :: CopyObject -> Maybe ISO8601
expires} -> Maybe ISO8601
expires) (\s :: CopyObject
s@CopyObject' {} Maybe ISO8601
a -> CopyObject
s {$sel:expires:CopyObject' :: Maybe ISO8601
expires = Maybe ISO8601
a} :: CopyObject) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> CopyObject -> f CopyObject)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CopyObject
-> f CopyObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Allows grantee to read the object ACL.
--
-- This action is not supported by Amazon S3 on Outposts.
copyObject_grantReadACP :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_grantReadACP :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_grantReadACP = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
grantReadACP :: Maybe Text
$sel:grantReadACP:CopyObject' :: CopyObject -> Maybe Text
grantReadACP} -> Maybe Text
grantReadACP) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:grantReadACP:CopyObject' :: Maybe Text
grantReadACP = Maybe Text
a} :: CopyObject)

-- | Copies the object if its entity tag (ETag) is different than the
-- specified ETag.
copyObject_copySourceIfNoneMatch :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_copySourceIfNoneMatch :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_copySourceIfNoneMatch = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
copySourceIfNoneMatch :: Maybe Text
$sel:copySourceIfNoneMatch:CopyObject' :: CopyObject -> Maybe Text
copySourceIfNoneMatch} -> Maybe Text
copySourceIfNoneMatch) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:copySourceIfNoneMatch:CopyObject' :: Maybe Text
copySourceIfNoneMatch = Maybe Text
a} :: CopyObject)

-- | Specifies the algorithm to use to when encrypting the object (for
-- example, AES256).
copyObject_sSECustomerAlgorithm :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_sSECustomerAlgorithm :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_sSECustomerAlgorithm = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
sSECustomerAlgorithm :: Maybe Text
$sel:sSECustomerAlgorithm:CopyObject' :: CopyObject -> Maybe Text
sSECustomerAlgorithm} -> Maybe Text
sSECustomerAlgorithm) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:sSECustomerAlgorithm:CopyObject' :: Maybe Text
sSECustomerAlgorithm = Maybe Text
a} :: CopyObject)

-- | Specifies the customer-provided encryption key for Amazon S3 to use in
-- encrypting data. This value is used to store the object and then it is
-- discarded; Amazon S3 does not store the encryption key. The key must be
-- appropriate for use with the algorithm specified in the
-- @x-amz-server-side-encryption-customer-algorithm@ header.
copyObject_sSECustomerKey :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_sSECustomerKey :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_sSECustomerKey = (CopyObject -> Maybe (Sensitive Text))
-> (CopyObject -> Maybe (Sensitive Text) -> CopyObject)
-> Lens
     CopyObject
     CopyObject
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe (Sensitive Text)
sSECustomerKey :: Maybe (Sensitive Text)
$sel:sSECustomerKey:CopyObject' :: CopyObject -> Maybe (Sensitive Text)
sSECustomerKey} -> Maybe (Sensitive Text)
sSECustomerKey) (\s :: CopyObject
s@CopyObject' {} Maybe (Sensitive Text)
a -> CopyObject
s {$sel:sSECustomerKey:CopyObject' :: Maybe (Sensitive Text)
sSECustomerKey = Maybe (Sensitive Text)
a} :: CopyObject) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CopyObject -> f CopyObject)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CopyObject
-> f CopyObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | Undocumented member.
copyObject_requestPayer :: Lens.Lens' CopyObject (Prelude.Maybe RequestPayer)
copyObject_requestPayer :: (Maybe RequestPayer -> f (Maybe RequestPayer))
-> CopyObject -> f CopyObject
copyObject_requestPayer = (CopyObject -> Maybe RequestPayer)
-> (CopyObject -> Maybe RequestPayer -> CopyObject)
-> Lens
     CopyObject CopyObject (Maybe RequestPayer) (Maybe RequestPayer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe RequestPayer
requestPayer :: Maybe RequestPayer
$sel:requestPayer:CopyObject' :: CopyObject -> Maybe RequestPayer
requestPayer} -> Maybe RequestPayer
requestPayer) (\s :: CopyObject
s@CopyObject' {} Maybe RequestPayer
a -> CopyObject
s {$sel:requestPayer:CopyObject' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
a} :: CopyObject)

-- | Allows grantee to write the ACL for the applicable object.
--
-- This action is not supported by Amazon S3 on Outposts.
copyObject_grantWriteACP :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_grantWriteACP :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_grantWriteACP = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
grantWriteACP :: Maybe Text
$sel:grantWriteACP:CopyObject' :: CopyObject -> Maybe Text
grantWriteACP} -> Maybe Text
grantWriteACP) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:grantWriteACP:CopyObject' :: Maybe Text
grantWriteACP = Maybe Text
a} :: CopyObject)

-- | Copies the object if its entity tag (ETag) matches the specified tag.
copyObject_copySourceIfMatch :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_copySourceIfMatch :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_copySourceIfMatch = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
copySourceIfMatch :: Maybe Text
$sel:copySourceIfMatch:CopyObject' :: CopyObject -> Maybe Text
copySourceIfMatch} -> Maybe Text
copySourceIfMatch) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:copySourceIfMatch:CopyObject' :: Maybe Text
copySourceIfMatch = Maybe Text
a} :: CopyObject)

-- | Specifies whether Amazon S3 should use an S3 Bucket Key for object
-- encryption with server-side encryption using AWS KMS (SSE-KMS). Setting
-- this header to @true@ causes Amazon S3 to use an S3 Bucket Key for
-- object encryption with SSE-KMS.
--
-- Specifying this header with a COPY action doesn’t affect bucket-level
-- settings for S3 Bucket Key.
copyObject_bucketKeyEnabled :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Bool)
copyObject_bucketKeyEnabled :: (Maybe Bool -> f (Maybe Bool)) -> CopyObject -> f CopyObject
copyObject_bucketKeyEnabled = (CopyObject -> Maybe Bool)
-> (CopyObject -> Maybe Bool -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Bool
bucketKeyEnabled :: Maybe Bool
$sel:bucketKeyEnabled:CopyObject' :: CopyObject -> Maybe Bool
bucketKeyEnabled} -> Maybe Bool
bucketKeyEnabled) (\s :: CopyObject
s@CopyObject' {} Maybe Bool
a -> CopyObject
s {$sel:bucketKeyEnabled:CopyObject' :: Maybe Bool
bucketKeyEnabled = Maybe Bool
a} :: CopyObject)

-- | If the bucket is configured as a website, redirects requests for this
-- object to another object in the same bucket or to an external URL.
-- Amazon S3 stores the value of this header in the object metadata.
copyObject_websiteRedirectLocation :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_websiteRedirectLocation :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_websiteRedirectLocation = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
websiteRedirectLocation :: Maybe Text
$sel:websiteRedirectLocation:CopyObject' :: CopyObject -> Maybe Text
websiteRedirectLocation} -> Maybe Text
websiteRedirectLocation) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:websiteRedirectLocation:CopyObject' :: Maybe Text
websiteRedirectLocation = Maybe Text
a} :: CopyObject)

-- | Allows grantee to read the object data and its metadata.
--
-- This action is not supported by Amazon S3 on Outposts.
copyObject_grantRead :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_grantRead :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_grantRead = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
grantRead :: Maybe Text
$sel:grantRead:CopyObject' :: CopyObject -> Maybe Text
grantRead} -> Maybe Text
grantRead) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:grantRead:CopyObject' :: Maybe Text
grantRead = Maybe Text
a} :: CopyObject)

-- | The account ID of the expected source bucket owner. If the source bucket
-- is owned by a different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
copyObject_expectedSourceBucketOwner :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_expectedSourceBucketOwner :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_expectedSourceBucketOwner = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
expectedSourceBucketOwner :: Maybe Text
$sel:expectedSourceBucketOwner:CopyObject' :: CopyObject -> Maybe Text
expectedSourceBucketOwner} -> Maybe Text
expectedSourceBucketOwner) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:expectedSourceBucketOwner:CopyObject' :: Maybe Text
expectedSourceBucketOwner = Maybe Text
a} :: CopyObject)

-- | By default, Amazon S3 uses the STANDARD Storage Class to store newly
-- created objects. The STANDARD storage class provides high durability and
-- high availability. Depending on performance needs, you can specify a
-- different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS
-- Storage Class. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html Storage Classes>
-- in the /Amazon S3 User Guide/.
copyObject_storageClass :: Lens.Lens' CopyObject (Prelude.Maybe StorageClass)
copyObject_storageClass :: (Maybe StorageClass -> f (Maybe StorageClass))
-> CopyObject -> f CopyObject
copyObject_storageClass = (CopyObject -> Maybe StorageClass)
-> (CopyObject -> Maybe StorageClass -> CopyObject)
-> Lens
     CopyObject CopyObject (Maybe StorageClass) (Maybe StorageClass)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe StorageClass
storageClass :: Maybe StorageClass
$sel:storageClass:CopyObject' :: CopyObject -> Maybe StorageClass
storageClass} -> Maybe StorageClass
storageClass) (\s :: CopyObject
s@CopyObject' {} Maybe StorageClass
a -> CopyObject
s {$sel:storageClass:CopyObject' :: Maybe StorageClass
storageClass = Maybe StorageClass
a} :: CopyObject)

-- | Specifies the 128-bit MD5 digest of the encryption key according to RFC
-- 1321. Amazon S3 uses this header for a message integrity check to ensure
-- that the encryption key was transmitted without error.
copyObject_sSECustomerKeyMD5 :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_sSECustomerKeyMD5 :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_sSECustomerKeyMD5 = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
sSECustomerKeyMD5 :: Maybe Text
$sel:sSECustomerKeyMD5:CopyObject' :: CopyObject -> Maybe Text
sSECustomerKeyMD5} -> Maybe Text
sSECustomerKeyMD5) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:sSECustomerKeyMD5:CopyObject' :: Maybe Text
sSECustomerKeyMD5 = Maybe Text
a} :: CopyObject)

-- | Specifies the Amazon Web Services KMS key ID to use for object
-- encryption. All GET and PUT requests for an object protected by Amazon
-- Web Services KMS will fail if not made via SSL or using SigV4. For
-- information about configuring using any of the officially supported
-- Amazon Web Services SDKs and Amazon Web Services CLI, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version Specifying the Signature Version in Request Authentication>
-- in the /Amazon S3 User Guide/.
copyObject_sSEKMSKeyId :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_sSEKMSKeyId :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_sSEKMSKeyId = (CopyObject -> Maybe (Sensitive Text))
-> (CopyObject -> Maybe (Sensitive Text) -> CopyObject)
-> Lens
     CopyObject
     CopyObject
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe (Sensitive Text)
sSEKMSKeyId :: Maybe (Sensitive Text)
$sel:sSEKMSKeyId:CopyObject' :: CopyObject -> Maybe (Sensitive Text)
sSEKMSKeyId} -> Maybe (Sensitive Text)
sSEKMSKeyId) (\s :: CopyObject
s@CopyObject' {} Maybe (Sensitive Text)
a -> CopyObject
s {$sel:sSEKMSKeyId:CopyObject' :: Maybe (Sensitive Text)
sSEKMSKeyId = Maybe (Sensitive Text)
a} :: CopyObject) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CopyObject -> f CopyObject)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CopyObject
-> f CopyObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the
-- object.
--
-- This action is not supported by Amazon S3 on Outposts.
copyObject_grantFullControl :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_grantFullControl :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_grantFullControl = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
grantFullControl :: Maybe Text
$sel:grantFullControl:CopyObject' :: CopyObject -> Maybe Text
grantFullControl} -> Maybe Text
grantFullControl) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:grantFullControl:CopyObject' :: Maybe Text
grantFullControl = Maybe Text
a} :: CopyObject)

-- | Specifies what content encodings have been applied to the object and
-- thus what decoding mechanisms must be applied to obtain the media-type
-- referenced by the Content-Type header field.
copyObject_contentEncoding :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_contentEncoding :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_contentEncoding = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
contentEncoding :: Maybe Text
$sel:contentEncoding:CopyObject' :: CopyObject -> Maybe Text
contentEncoding} -> Maybe Text
contentEncoding) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:contentEncoding:CopyObject' :: Maybe Text
contentEncoding = Maybe Text
a} :: CopyObject)

-- | The tag-set for the object destination object this value must be used in
-- conjunction with the @TaggingDirective@. The tag-set must be encoded as
-- URL Query parameters.
copyObject_tagging :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_tagging :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_tagging = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
tagging :: Maybe Text
$sel:tagging:CopyObject' :: CopyObject -> Maybe Text
tagging} -> Maybe Text
tagging) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:tagging:CopyObject' :: Maybe Text
tagging = Maybe Text
a} :: CopyObject)

-- | The date and time when you want the copied object\'s Object Lock to
-- expire.
copyObject_objectLockRetainUntilDate :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.UTCTime)
copyObject_objectLockRetainUntilDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> CopyObject -> f CopyObject
copyObject_objectLockRetainUntilDate = (CopyObject -> Maybe ISO8601)
-> (CopyObject -> Maybe ISO8601 -> CopyObject)
-> Lens CopyObject CopyObject (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe ISO8601
objectLockRetainUntilDate :: Maybe ISO8601
$sel:objectLockRetainUntilDate:CopyObject' :: CopyObject -> Maybe ISO8601
objectLockRetainUntilDate} -> Maybe ISO8601
objectLockRetainUntilDate) (\s :: CopyObject
s@CopyObject' {} Maybe ISO8601
a -> CopyObject
s {$sel:objectLockRetainUntilDate:CopyObject' :: Maybe ISO8601
objectLockRetainUntilDate = Maybe ISO8601
a} :: CopyObject) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> CopyObject -> f CopyObject)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CopyObject
-> f CopyObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A map of metadata to store with the object in S3.
copyObject_metadata :: Lens.Lens' CopyObject (Prelude.HashMap Prelude.Text Prelude.Text)
copyObject_metadata :: (HashMap Text Text -> f (HashMap Text Text))
-> CopyObject -> f CopyObject
copyObject_metadata = (CopyObject -> HashMap Text Text)
-> (CopyObject -> HashMap Text Text -> CopyObject)
-> Lens
     CopyObject CopyObject (HashMap Text Text) (HashMap Text Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {HashMap Text Text
metadata :: HashMap Text Text
$sel:metadata:CopyObject' :: CopyObject -> HashMap Text Text
metadata} -> HashMap Text Text
metadata) (\s :: CopyObject
s@CopyObject' {} HashMap Text Text
a -> CopyObject
s {$sel:metadata:CopyObject' :: HashMap Text Text
metadata = HashMap Text Text
a} :: CopyObject) ((HashMap Text Text -> f (HashMap Text Text))
 -> CopyObject -> f CopyObject)
-> ((HashMap Text Text -> f (HashMap Text Text))
    -> HashMap Text Text -> f (HashMap Text Text))
-> (HashMap Text Text -> f (HashMap Text Text))
-> CopyObject
-> f CopyObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text Text -> f (HashMap Text Text))
-> HashMap Text Text -> f (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies the Amazon Web Services KMS Encryption Context to use for
-- object encryption. The value of this header is a base64-encoded UTF-8
-- string holding JSON with the encryption context key-value pairs.
copyObject_sSEKMSEncryptionContext :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_sSEKMSEncryptionContext :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_sSEKMSEncryptionContext = (CopyObject -> Maybe (Sensitive Text))
-> (CopyObject -> Maybe (Sensitive Text) -> CopyObject)
-> Lens
     CopyObject
     CopyObject
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe (Sensitive Text)
sSEKMSEncryptionContext :: Maybe (Sensitive Text)
$sel:sSEKMSEncryptionContext:CopyObject' :: CopyObject -> Maybe (Sensitive Text)
sSEKMSEncryptionContext} -> Maybe (Sensitive Text)
sSEKMSEncryptionContext) (\s :: CopyObject
s@CopyObject' {} Maybe (Sensitive Text)
a -> CopyObject
s {$sel:sSEKMSEncryptionContext:CopyObject' :: Maybe (Sensitive Text)
sSEKMSEncryptionContext = Maybe (Sensitive Text)
a} :: CopyObject) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CopyObject -> f CopyObject)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CopyObject
-> f CopyObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | Specifies caching behavior along the request\/reply chain.
copyObject_cacheControl :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_cacheControl :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_cacheControl = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
cacheControl :: Maybe Text
$sel:cacheControl:CopyObject' :: CopyObject -> Maybe Text
cacheControl} -> Maybe Text
cacheControl) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:cacheControl:CopyObject' :: Maybe Text
cacheControl = Maybe Text
a} :: CopyObject)

-- | The language the content is in.
copyObject_contentLanguage :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_contentLanguage :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_contentLanguage = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
contentLanguage :: Maybe Text
$sel:contentLanguage:CopyObject' :: CopyObject -> Maybe Text
contentLanguage} -> Maybe Text
contentLanguage) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:contentLanguage:CopyObject' :: Maybe Text
contentLanguage = Maybe Text
a} :: CopyObject)

-- | Specifies the customer-provided encryption key for Amazon S3 to use to
-- decrypt the source object. The encryption key provided in this header
-- must be one that was used when the source object was created.
copyObject_copySourceSSECustomerKey :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_copySourceSSECustomerKey :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_copySourceSSECustomerKey = (CopyObject -> Maybe (Sensitive Text))
-> (CopyObject -> Maybe (Sensitive Text) -> CopyObject)
-> Lens
     CopyObject
     CopyObject
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe (Sensitive Text)
copySourceSSECustomerKey :: Maybe (Sensitive Text)
$sel:copySourceSSECustomerKey:CopyObject' :: CopyObject -> Maybe (Sensitive Text)
copySourceSSECustomerKey} -> Maybe (Sensitive Text)
copySourceSSECustomerKey) (\s :: CopyObject
s@CopyObject' {} Maybe (Sensitive Text)
a -> CopyObject
s {$sel:copySourceSSECustomerKey:CopyObject' :: Maybe (Sensitive Text)
copySourceSSECustomerKey = Maybe (Sensitive Text)
a} :: CopyObject) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CopyObject -> f CopyObject)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CopyObject
-> f CopyObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | Specifies whether you want to apply a Legal Hold to the copied object.
copyObject_objectLockLegalHoldStatus :: Lens.Lens' CopyObject (Prelude.Maybe ObjectLockLegalHoldStatus)
copyObject_objectLockLegalHoldStatus :: (Maybe ObjectLockLegalHoldStatus
 -> f (Maybe ObjectLockLegalHoldStatus))
-> CopyObject -> f CopyObject
copyObject_objectLockLegalHoldStatus = (CopyObject -> Maybe ObjectLockLegalHoldStatus)
-> (CopyObject -> Maybe ObjectLockLegalHoldStatus -> CopyObject)
-> Lens
     CopyObject
     CopyObject
     (Maybe ObjectLockLegalHoldStatus)
     (Maybe ObjectLockLegalHoldStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe ObjectLockLegalHoldStatus
objectLockLegalHoldStatus :: Maybe ObjectLockLegalHoldStatus
$sel:objectLockLegalHoldStatus:CopyObject' :: CopyObject -> Maybe ObjectLockLegalHoldStatus
objectLockLegalHoldStatus} -> Maybe ObjectLockLegalHoldStatus
objectLockLegalHoldStatus) (\s :: CopyObject
s@CopyObject' {} Maybe ObjectLockLegalHoldStatus
a -> CopyObject
s {$sel:objectLockLegalHoldStatus:CopyObject' :: Maybe ObjectLockLegalHoldStatus
objectLockLegalHoldStatus = Maybe ObjectLockLegalHoldStatus
a} :: CopyObject)

-- | Specifies the algorithm to use when decrypting the source object (for
-- example, AES256).
copyObject_copySourceSSECustomerAlgorithm :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_copySourceSSECustomerAlgorithm :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_copySourceSSECustomerAlgorithm = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
copySourceSSECustomerAlgorithm :: Maybe Text
$sel:copySourceSSECustomerAlgorithm:CopyObject' :: CopyObject -> Maybe Text
copySourceSSECustomerAlgorithm} -> Maybe Text
copySourceSSECustomerAlgorithm) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:copySourceSSECustomerAlgorithm:CopyObject' :: Maybe Text
copySourceSSECustomerAlgorithm = Maybe Text
a} :: CopyObject)

-- | The canned ACL to apply to the object.
--
-- This action is not supported by Amazon S3 on Outposts.
copyObject_acl :: Lens.Lens' CopyObject (Prelude.Maybe ObjectCannedACL)
copyObject_acl :: (Maybe ObjectCannedACL -> f (Maybe ObjectCannedACL))
-> CopyObject -> f CopyObject
copyObject_acl = (CopyObject -> Maybe ObjectCannedACL)
-> (CopyObject -> Maybe ObjectCannedACL -> CopyObject)
-> Lens
     CopyObject
     CopyObject
     (Maybe ObjectCannedACL)
     (Maybe ObjectCannedACL)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe ObjectCannedACL
acl :: Maybe ObjectCannedACL
$sel:acl:CopyObject' :: CopyObject -> Maybe ObjectCannedACL
acl} -> Maybe ObjectCannedACL
acl) (\s :: CopyObject
s@CopyObject' {} Maybe ObjectCannedACL
a -> CopyObject
s {$sel:acl:CopyObject' :: Maybe ObjectCannedACL
acl = Maybe ObjectCannedACL
a} :: CopyObject)

-- | Specifies presentational information for the object.
copyObject_contentDisposition :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_contentDisposition :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_contentDisposition = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
contentDisposition :: Maybe Text
$sel:contentDisposition:CopyObject' :: CopyObject -> Maybe Text
contentDisposition} -> Maybe Text
contentDisposition) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:contentDisposition:CopyObject' :: Maybe Text
contentDisposition = Maybe Text
a} :: CopyObject)

-- | The account ID of the expected destination bucket owner. If the
-- destination bucket is owned by a different account, the request will
-- fail with an HTTP @403 (Access Denied)@ error.
copyObject_expectedBucketOwner :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_expectedBucketOwner :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_expectedBucketOwner = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:CopyObject' :: CopyObject -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:expectedBucketOwner:CopyObject' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: CopyObject)

-- | The server-side encryption algorithm used when storing this object in
-- Amazon S3 (for example, AES256, aws:kms).
copyObject_serverSideEncryption :: Lens.Lens' CopyObject (Prelude.Maybe ServerSideEncryption)
copyObject_serverSideEncryption :: (Maybe ServerSideEncryption -> f (Maybe ServerSideEncryption))
-> CopyObject -> f CopyObject
copyObject_serverSideEncryption = (CopyObject -> Maybe ServerSideEncryption)
-> (CopyObject -> Maybe ServerSideEncryption -> CopyObject)
-> Lens
     CopyObject
     CopyObject
     (Maybe ServerSideEncryption)
     (Maybe ServerSideEncryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe ServerSideEncryption
serverSideEncryption :: Maybe ServerSideEncryption
$sel:serverSideEncryption:CopyObject' :: CopyObject -> Maybe ServerSideEncryption
serverSideEncryption} -> Maybe ServerSideEncryption
serverSideEncryption) (\s :: CopyObject
s@CopyObject' {} Maybe ServerSideEncryption
a -> CopyObject
s {$sel:serverSideEncryption:CopyObject' :: Maybe ServerSideEncryption
serverSideEncryption = Maybe ServerSideEncryption
a} :: CopyObject)

-- | A standard MIME type describing the format of the object data.
copyObject_contentType :: Lens.Lens' CopyObject (Prelude.Maybe Prelude.Text)
copyObject_contentType :: (Maybe Text -> f (Maybe Text)) -> CopyObject -> f CopyObject
copyObject_contentType = (CopyObject -> Maybe Text)
-> (CopyObject -> Maybe Text -> CopyObject)
-> Lens CopyObject CopyObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Maybe Text
contentType :: Maybe Text
$sel:contentType:CopyObject' :: CopyObject -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: CopyObject
s@CopyObject' {} Maybe Text
a -> CopyObject
s {$sel:contentType:CopyObject' :: Maybe Text
contentType = Maybe Text
a} :: CopyObject)

-- | The name of the destination bucket.
--
-- When using this action with an access point, you must direct requests to
-- the access point hostname. The access point hostname takes the form
-- /AccessPointName/-/AccountId/.s3-accesspoint./Region/.amazonaws.com.
-- When using this action with an access point through the Amazon Web
-- Services SDKs, you provide the access point ARN in place of the bucket
-- name. For more information about access point ARNs, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html Using access points>
-- in the /Amazon S3 User Guide/.
--
-- When using this action with Amazon S3 on Outposts, you must direct
-- requests to the S3 on Outposts hostname. The S3 on Outposts hostname
-- takes the form
-- /AccessPointName/-/AccountId/./outpostID/.s3-outposts./Region/.amazonaws.com.
-- When using this action using S3 on Outposts through the Amazon Web
-- Services SDKs, you provide the Outposts bucket ARN in place of the
-- bucket name. For more information about S3 on Outposts ARNs, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html Using S3 on Outposts>
-- in the /Amazon S3 User Guide/.
copyObject_bucket :: Lens.Lens' CopyObject BucketName
copyObject_bucket :: (BucketName -> f BucketName) -> CopyObject -> f CopyObject
copyObject_bucket = (CopyObject -> BucketName)
-> (CopyObject -> BucketName -> CopyObject)
-> Lens CopyObject CopyObject BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {BucketName
bucket :: BucketName
$sel:bucket:CopyObject' :: CopyObject -> BucketName
bucket} -> BucketName
bucket) (\s :: CopyObject
s@CopyObject' {} BucketName
a -> CopyObject
s {$sel:bucket:CopyObject' :: BucketName
bucket = BucketName
a} :: CopyObject)

-- | Specifies the source object for the copy operation. You specify the
-- value in one of two formats, depending on whether you want to access the
-- source object through an
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html access point>:
--
-- -   For objects not accessed through an access point, specify the name
--     of the source bucket and the key of the source object, separated by
--     a slash (\/). For example, to copy the object @reports\/january.pdf@
--     from the bucket @awsexamplebucket@, use
--     @awsexamplebucket\/reports\/january.pdf@. The value must be URL
--     encoded.
--
-- -   For objects accessed through access points, specify the Amazon
--     Resource Name (ARN) of the object as accessed through the access
--     point, in the format
--     @arn:aws:s3:\<Region>:\<account-id>:accesspoint\/\<access-point-name>\/object\/\<key>@.
--     For example, to copy the object @reports\/january.pdf@ through
--     access point @my-access-point@ owned by account @123456789012@ in
--     Region @us-west-2@, use the URL encoding of
--     @arn:aws:s3:us-west-2:123456789012:accesspoint\/my-access-point\/object\/reports\/january.pdf@.
--     The value must be URL encoded.
--
--     Amazon S3 supports copy operations using access points only when the
--     source and destination buckets are in the same Amazon Web Services
--     Region.
--
--     Alternatively, for objects accessed through Amazon S3 on Outposts,
--     specify the ARN of the object as accessed in the format
--     @arn:aws:s3-outposts:\<Region>:\<account-id>:outpost\/\<outpost-id>\/object\/\<key>@.
--     For example, to copy the object @reports\/january.pdf@ through
--     outpost @my-outpost@ owned by account @123456789012@ in Region
--     @us-west-2@, use the URL encoding of
--     @arn:aws:s3-outposts:us-west-2:123456789012:outpost\/my-outpost\/object\/reports\/january.pdf@.
--     The value must be URL encoded.
--
-- To copy a specific version of an object, append
-- @?versionId=\<version-id>@ to the value (for example,
-- @awsexamplebucket\/reports\/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893@).
-- If you don\'t specify a version ID, Amazon S3 copies the latest version
-- of the source object.
copyObject_copySource :: Lens.Lens' CopyObject Prelude.Text
copyObject_copySource :: (Text -> f Text) -> CopyObject -> f CopyObject
copyObject_copySource = (CopyObject -> Text)
-> (CopyObject -> Text -> CopyObject)
-> Lens CopyObject CopyObject Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {Text
copySource :: Text
$sel:copySource:CopyObject' :: CopyObject -> Text
copySource} -> Text
copySource) (\s :: CopyObject
s@CopyObject' {} Text
a -> CopyObject
s {$sel:copySource:CopyObject' :: Text
copySource = Text
a} :: CopyObject)

-- | The key of the destination object.
copyObject_key :: Lens.Lens' CopyObject ObjectKey
copyObject_key :: (ObjectKey -> f ObjectKey) -> CopyObject -> f CopyObject
copyObject_key = (CopyObject -> ObjectKey)
-> (CopyObject -> ObjectKey -> CopyObject)
-> Lens CopyObject CopyObject ObjectKey ObjectKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObject' {ObjectKey
key :: ObjectKey
$sel:key:CopyObject' :: CopyObject -> ObjectKey
key} -> ObjectKey
key) (\s :: CopyObject
s@CopyObject' {} ObjectKey
a -> CopyObject
s {$sel:key:CopyObject' :: ObjectKey
key = ObjectKey
a} :: CopyObject)

instance Core.AWSRequest CopyObject where
  type AWSResponse CopyObject = CopyObjectResponse
  request :: CopyObject -> Request CopyObject
request =
    Request CopyObject -> Request CopyObject
forall a. Request a -> Request a
Request.s3vhost
      (Request CopyObject -> Request CopyObject)
-> (CopyObject -> Request CopyObject)
-> CopyObject
-> Request CopyObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> CopyObject -> Request CopyObject
forall a. ToRequest a => Service -> a -> Request a
Request.put Service
defaultService
  response :: Logger
-> Service
-> Proxy CopyObject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CopyObject)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse CopyObject))
-> Logger
-> Service
-> Proxy CopyObject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CopyObject)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe RequestCharged
-> Maybe ObjectVersionId
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe ServerSideEncryption
-> Maybe CopyObjectResult
-> Int
-> CopyObjectResponse
CopyObjectResponse'
            (Maybe RequestCharged
 -> Maybe ObjectVersionId
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe (Sensitive Text)
 -> Maybe (Sensitive Text)
 -> Maybe ServerSideEncryption
 -> Maybe CopyObjectResult
 -> Int
 -> CopyObjectResponse)
-> Either String (Maybe RequestCharged)
-> Either
     String
     (Maybe ObjectVersionId
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Maybe CopyObjectResult
      -> Int
      -> CopyObjectResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe RequestCharged)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-request-charged")
            Either
  String
  (Maybe ObjectVersionId
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Maybe CopyObjectResult
   -> Int
   -> CopyObjectResponse)
-> Either String (Maybe ObjectVersionId)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Maybe CopyObjectResult
      -> Int
      -> CopyObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe ObjectVersionId)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-version-id")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Maybe CopyObjectResult
   -> Int
   -> CopyObjectResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Maybe CopyObjectResult
      -> Int
      -> CopyObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-expiration")
            Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Maybe CopyObjectResult
   -> Int
   -> CopyObjectResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Maybe CopyObjectResult
      -> Int
      -> CopyObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( ResponseHeaders
h
                            ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-server-side-encryption-customer-algorithm"
                        )
            Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Maybe CopyObjectResult
   -> Int
   -> CopyObjectResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Maybe CopyObjectResult
      -> Int
      -> CopyObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( ResponseHeaders
h
                            ResponseHeaders -> HeaderName -> Either String (Maybe Bool)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-server-side-encryption-bucket-key-enabled"
                        )
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Maybe CopyObjectResult
   -> Int
   -> CopyObjectResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Maybe CopyObjectResult
      -> Int
      -> CopyObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-copy-source-version-id")
            Either
  String
  (Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Maybe CopyObjectResult
   -> Int
   -> CopyObjectResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Maybe CopyObjectResult
      -> Int
      -> CopyObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( ResponseHeaders
h
                            ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-server-side-encryption-customer-key-MD5"
                        )
            Either
  String
  (Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Maybe CopyObjectResult
   -> Int
   -> CopyObjectResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String
     (Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Maybe CopyObjectResult
      -> Int
      -> CopyObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( ResponseHeaders
h
                            ResponseHeaders
-> HeaderName -> Either String (Maybe (Sensitive Text))
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-server-side-encryption-aws-kms-key-id"
                        )
            Either
  String
  (Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Maybe CopyObjectResult
   -> Int
   -> CopyObjectResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String
     (Maybe ServerSideEncryption
      -> Maybe CopyObjectResult -> Int -> CopyObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe (Sensitive Text))
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-server-side-encryption-context")
            Either
  String
  (Maybe ServerSideEncryption
   -> Maybe CopyObjectResult -> Int -> CopyObjectResponse)
-> Either String (Maybe ServerSideEncryption)
-> Either
     String (Maybe CopyObjectResult -> Int -> CopyObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe ServerSideEncryption)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-server-side-encryption")
            Either String (Maybe CopyObjectResult -> Int -> CopyObjectResponse)
-> Either String (Maybe CopyObjectResult)
-> Either String (Int -> CopyObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node] -> Either String (Maybe CopyObjectResult)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
            Either String (Int -> CopyObjectResponse)
-> Either String Int -> Either String CopyObjectResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CopyObject

instance Prelude.NFData CopyObject

instance Core.ToHeaders CopyObject where
  toHeaders :: CopyObject -> ResponseHeaders
toHeaders CopyObject' {Maybe Bool
Maybe Text
Maybe (Sensitive Text)
Maybe ISO8601
Maybe MetadataDirective
Maybe ObjectCannedACL
Maybe ObjectLockLegalHoldStatus
Maybe ObjectLockMode
Maybe RequestPayer
Maybe ServerSideEncryption
Maybe StorageClass
Maybe TaggingDirective
Text
HashMap Text Text
ObjectKey
BucketName
key :: ObjectKey
copySource :: Text
bucket :: BucketName
contentType :: Maybe Text
serverSideEncryption :: Maybe ServerSideEncryption
expectedBucketOwner :: Maybe Text
contentDisposition :: Maybe Text
acl :: Maybe ObjectCannedACL
copySourceSSECustomerAlgorithm :: Maybe Text
objectLockLegalHoldStatus :: Maybe ObjectLockLegalHoldStatus
copySourceSSECustomerKey :: Maybe (Sensitive Text)
contentLanguage :: Maybe Text
cacheControl :: Maybe Text
sSEKMSEncryptionContext :: Maybe (Sensitive Text)
metadata :: HashMap Text Text
objectLockRetainUntilDate :: Maybe ISO8601
tagging :: Maybe Text
contentEncoding :: Maybe Text
grantFullControl :: Maybe Text
sSEKMSKeyId :: Maybe (Sensitive Text)
sSECustomerKeyMD5 :: Maybe Text
storageClass :: Maybe StorageClass
expectedSourceBucketOwner :: Maybe Text
grantRead :: Maybe Text
websiteRedirectLocation :: Maybe Text
bucketKeyEnabled :: Maybe Bool
copySourceIfMatch :: Maybe Text
grantWriteACP :: Maybe Text
requestPayer :: Maybe RequestPayer
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
copySourceIfNoneMatch :: Maybe Text
grantReadACP :: Maybe Text
expires :: Maybe ISO8601
objectLockMode :: Maybe ObjectLockMode
metadataDirective :: Maybe MetadataDirective
taggingDirective :: Maybe TaggingDirective
copySourceSSECustomerKeyMD5 :: Maybe Text
copySourceIfUnmodifiedSince :: Maybe ISO8601
copySourceIfModifiedSince :: Maybe ISO8601
$sel:key:CopyObject' :: CopyObject -> ObjectKey
$sel:copySource:CopyObject' :: CopyObject -> Text
$sel:bucket:CopyObject' :: CopyObject -> BucketName
$sel:contentType:CopyObject' :: CopyObject -> Maybe Text
$sel:serverSideEncryption:CopyObject' :: CopyObject -> Maybe ServerSideEncryption
$sel:expectedBucketOwner:CopyObject' :: CopyObject -> Maybe Text
$sel:contentDisposition:CopyObject' :: CopyObject -> Maybe Text
$sel:acl:CopyObject' :: CopyObject -> Maybe ObjectCannedACL
$sel:copySourceSSECustomerAlgorithm:CopyObject' :: CopyObject -> Maybe Text
$sel:objectLockLegalHoldStatus:CopyObject' :: CopyObject -> Maybe ObjectLockLegalHoldStatus
$sel:copySourceSSECustomerKey:CopyObject' :: CopyObject -> Maybe (Sensitive Text)
$sel:contentLanguage:CopyObject' :: CopyObject -> Maybe Text
$sel:cacheControl:CopyObject' :: CopyObject -> Maybe Text
$sel:sSEKMSEncryptionContext:CopyObject' :: CopyObject -> Maybe (Sensitive Text)
$sel:metadata:CopyObject' :: CopyObject -> HashMap Text Text
$sel:objectLockRetainUntilDate:CopyObject' :: CopyObject -> Maybe ISO8601
$sel:tagging:CopyObject' :: CopyObject -> Maybe Text
$sel:contentEncoding:CopyObject' :: CopyObject -> Maybe Text
$sel:grantFullControl:CopyObject' :: CopyObject -> Maybe Text
$sel:sSEKMSKeyId:CopyObject' :: CopyObject -> Maybe (Sensitive Text)
$sel:sSECustomerKeyMD5:CopyObject' :: CopyObject -> Maybe Text
$sel:storageClass:CopyObject' :: CopyObject -> Maybe StorageClass
$sel:expectedSourceBucketOwner:CopyObject' :: CopyObject -> Maybe Text
$sel:grantRead:CopyObject' :: CopyObject -> Maybe Text
$sel:websiteRedirectLocation:CopyObject' :: CopyObject -> Maybe Text
$sel:bucketKeyEnabled:CopyObject' :: CopyObject -> Maybe Bool
$sel:copySourceIfMatch:CopyObject' :: CopyObject -> Maybe Text
$sel:grantWriteACP:CopyObject' :: CopyObject -> Maybe Text
$sel:requestPayer:CopyObject' :: CopyObject -> Maybe RequestPayer
$sel:sSECustomerKey:CopyObject' :: CopyObject -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:CopyObject' :: CopyObject -> Maybe Text
$sel:copySourceIfNoneMatch:CopyObject' :: CopyObject -> Maybe Text
$sel:grantReadACP:CopyObject' :: CopyObject -> Maybe Text
$sel:expires:CopyObject' :: CopyObject -> Maybe ISO8601
$sel:objectLockMode:CopyObject' :: CopyObject -> Maybe ObjectLockMode
$sel:metadataDirective:CopyObject' :: CopyObject -> Maybe MetadataDirective
$sel:taggingDirective:CopyObject' :: CopyObject -> Maybe TaggingDirective
$sel:copySourceSSECustomerKeyMD5:CopyObject' :: CopyObject -> Maybe Text
$sel:copySourceIfUnmodifiedSince:CopyObject' :: CopyObject -> Maybe ISO8601
$sel:copySourceIfModifiedSince:CopyObject' :: CopyObject -> Maybe ISO8601
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-copy-source-if-modified-since"
          HeaderName -> Maybe ISO8601 -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ISO8601
copySourceIfModifiedSince,
        HeaderName
"x-amz-copy-source-if-unmodified-since"
          HeaderName -> Maybe ISO8601 -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ISO8601
copySourceIfUnmodifiedSince,
        HeaderName
"x-amz-copy-source-server-side-encryption-customer-key-MD5"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
copySourceSSECustomerKeyMD5,
        HeaderName
"x-amz-tagging-directive" HeaderName -> Maybe TaggingDirective -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe TaggingDirective
taggingDirective,
        HeaderName
"x-amz-metadata-directive" HeaderName -> Maybe MetadataDirective -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe MetadataDirective
metadataDirective,
        HeaderName
"x-amz-object-lock-mode" HeaderName -> Maybe ObjectLockMode -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ObjectLockMode
objectLockMode,
        HeaderName
"Expires" HeaderName -> Maybe ISO8601 -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ISO8601
expires,
        HeaderName
"x-amz-grant-read-acp" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantReadACP,
        HeaderName
"x-amz-copy-source-if-none-match"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
copySourceIfNoneMatch,
        HeaderName
"x-amz-server-side-encryption-customer-algorithm"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
sSECustomerAlgorithm,
        HeaderName
"x-amz-server-side-encryption-customer-key"
          HeaderName -> Maybe (Sensitive Text) -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe (Sensitive Text)
sSECustomerKey,
        HeaderName
"x-amz-request-payer" HeaderName -> Maybe RequestPayer -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe RequestPayer
requestPayer,
        HeaderName
"x-amz-grant-write-acp" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantWriteACP,
        HeaderName
"x-amz-copy-source-if-match"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
copySourceIfMatch,
        HeaderName
"x-amz-server-side-encryption-bucket-key-enabled"
          HeaderName -> Maybe Bool -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Bool
bucketKeyEnabled,
        HeaderName
"x-amz-website-redirect-location"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
websiteRedirectLocation,
        HeaderName
"x-amz-grant-read" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantRead,
        HeaderName
"x-amz-source-expected-bucket-owner"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
expectedSourceBucketOwner,
        HeaderName
"x-amz-storage-class" HeaderName -> Maybe StorageClass -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe StorageClass
storageClass,
        HeaderName
"x-amz-server-side-encryption-customer-key-MD5"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
sSECustomerKeyMD5,
        HeaderName
"x-amz-server-side-encryption-aws-kms-key-id"
          HeaderName -> Maybe (Sensitive Text) -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe (Sensitive Text)
sSEKMSKeyId,
        HeaderName
"x-amz-grant-full-control" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantFullControl,
        HeaderName
"Content-Encoding" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
contentEncoding,
        HeaderName
"x-amz-tagging" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
tagging,
        HeaderName
"x-amz-object-lock-retain-until-date"
          HeaderName -> Maybe ISO8601 -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ISO8601
objectLockRetainUntilDate,
        HeaderName
"x-amz-meta-" HeaderName -> HashMap Text Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# HashMap Text Text
metadata,
        HeaderName
"x-amz-server-side-encryption-context"
          HeaderName -> Maybe (Sensitive Text) -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe (Sensitive Text)
sSEKMSEncryptionContext,
        HeaderName
"Cache-Control" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
cacheControl,
        HeaderName
"Content-Language" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
contentLanguage,
        HeaderName
"x-amz-copy-source-server-side-encryption-customer-key"
          HeaderName -> Maybe (Sensitive Text) -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe (Sensitive Text)
copySourceSSECustomerKey,
        HeaderName
"x-amz-object-lock-legal-hold"
          HeaderName -> Maybe ObjectLockLegalHoldStatus -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ObjectLockLegalHoldStatus
objectLockLegalHoldStatus,
        HeaderName
"x-amz-copy-source-server-side-encryption-customer-algorithm"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
copySourceSSECustomerAlgorithm,
        HeaderName
"x-amz-acl" HeaderName -> Maybe ObjectCannedACL -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ObjectCannedACL
acl,
        HeaderName
"Content-Disposition" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
contentDisposition,
        HeaderName
"x-amz-expected-bucket-owner"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
expectedBucketOwner,
        HeaderName
"x-amz-server-side-encryption"
          HeaderName -> Maybe ServerSideEncryption -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe ServerSideEncryption
serverSideEncryption,
        HeaderName
"Content-Type" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
contentType,
        HeaderName
"x-amz-copy-source" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
copySource
      ]

instance Core.ToPath CopyObject where
  toPath :: CopyObject -> ByteString
toPath CopyObject' {Maybe Bool
Maybe Text
Maybe (Sensitive Text)
Maybe ISO8601
Maybe MetadataDirective
Maybe ObjectCannedACL
Maybe ObjectLockLegalHoldStatus
Maybe ObjectLockMode
Maybe RequestPayer
Maybe ServerSideEncryption
Maybe StorageClass
Maybe TaggingDirective
Text
HashMap Text Text
ObjectKey
BucketName
key :: ObjectKey
copySource :: Text
bucket :: BucketName
contentType :: Maybe Text
serverSideEncryption :: Maybe ServerSideEncryption
expectedBucketOwner :: Maybe Text
contentDisposition :: Maybe Text
acl :: Maybe ObjectCannedACL
copySourceSSECustomerAlgorithm :: Maybe Text
objectLockLegalHoldStatus :: Maybe ObjectLockLegalHoldStatus
copySourceSSECustomerKey :: Maybe (Sensitive Text)
contentLanguage :: Maybe Text
cacheControl :: Maybe Text
sSEKMSEncryptionContext :: Maybe (Sensitive Text)
metadata :: HashMap Text Text
objectLockRetainUntilDate :: Maybe ISO8601
tagging :: Maybe Text
contentEncoding :: Maybe Text
grantFullControl :: Maybe Text
sSEKMSKeyId :: Maybe (Sensitive Text)
sSECustomerKeyMD5 :: Maybe Text
storageClass :: Maybe StorageClass
expectedSourceBucketOwner :: Maybe Text
grantRead :: Maybe Text
websiteRedirectLocation :: Maybe Text
bucketKeyEnabled :: Maybe Bool
copySourceIfMatch :: Maybe Text
grantWriteACP :: Maybe Text
requestPayer :: Maybe RequestPayer
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
copySourceIfNoneMatch :: Maybe Text
grantReadACP :: Maybe Text
expires :: Maybe ISO8601
objectLockMode :: Maybe ObjectLockMode
metadataDirective :: Maybe MetadataDirective
taggingDirective :: Maybe TaggingDirective
copySourceSSECustomerKeyMD5 :: Maybe Text
copySourceIfUnmodifiedSince :: Maybe ISO8601
copySourceIfModifiedSince :: Maybe ISO8601
$sel:key:CopyObject' :: CopyObject -> ObjectKey
$sel:copySource:CopyObject' :: CopyObject -> Text
$sel:bucket:CopyObject' :: CopyObject -> BucketName
$sel:contentType:CopyObject' :: CopyObject -> Maybe Text
$sel:serverSideEncryption:CopyObject' :: CopyObject -> Maybe ServerSideEncryption
$sel:expectedBucketOwner:CopyObject' :: CopyObject -> Maybe Text
$sel:contentDisposition:CopyObject' :: CopyObject -> Maybe Text
$sel:acl:CopyObject' :: CopyObject -> Maybe ObjectCannedACL
$sel:copySourceSSECustomerAlgorithm:CopyObject' :: CopyObject -> Maybe Text
$sel:objectLockLegalHoldStatus:CopyObject' :: CopyObject -> Maybe ObjectLockLegalHoldStatus
$sel:copySourceSSECustomerKey:CopyObject' :: CopyObject -> Maybe (Sensitive Text)
$sel:contentLanguage:CopyObject' :: CopyObject -> Maybe Text
$sel:cacheControl:CopyObject' :: CopyObject -> Maybe Text
$sel:sSEKMSEncryptionContext:CopyObject' :: CopyObject -> Maybe (Sensitive Text)
$sel:metadata:CopyObject' :: CopyObject -> HashMap Text Text
$sel:objectLockRetainUntilDate:CopyObject' :: CopyObject -> Maybe ISO8601
$sel:tagging:CopyObject' :: CopyObject -> Maybe Text
$sel:contentEncoding:CopyObject' :: CopyObject -> Maybe Text
$sel:grantFullControl:CopyObject' :: CopyObject -> Maybe Text
$sel:sSEKMSKeyId:CopyObject' :: CopyObject -> Maybe (Sensitive Text)
$sel:sSECustomerKeyMD5:CopyObject' :: CopyObject -> Maybe Text
$sel:storageClass:CopyObject' :: CopyObject -> Maybe StorageClass
$sel:expectedSourceBucketOwner:CopyObject' :: CopyObject -> Maybe Text
$sel:grantRead:CopyObject' :: CopyObject -> Maybe Text
$sel:websiteRedirectLocation:CopyObject' :: CopyObject -> Maybe Text
$sel:bucketKeyEnabled:CopyObject' :: CopyObject -> Maybe Bool
$sel:copySourceIfMatch:CopyObject' :: CopyObject -> Maybe Text
$sel:grantWriteACP:CopyObject' :: CopyObject -> Maybe Text
$sel:requestPayer:CopyObject' :: CopyObject -> Maybe RequestPayer
$sel:sSECustomerKey:CopyObject' :: CopyObject -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:CopyObject' :: CopyObject -> Maybe Text
$sel:copySourceIfNoneMatch:CopyObject' :: CopyObject -> Maybe Text
$sel:grantReadACP:CopyObject' :: CopyObject -> Maybe Text
$sel:expires:CopyObject' :: CopyObject -> Maybe ISO8601
$sel:objectLockMode:CopyObject' :: CopyObject -> Maybe ObjectLockMode
$sel:metadataDirective:CopyObject' :: CopyObject -> Maybe MetadataDirective
$sel:taggingDirective:CopyObject' :: CopyObject -> Maybe TaggingDirective
$sel:copySourceSSECustomerKeyMD5:CopyObject' :: CopyObject -> Maybe Text
$sel:copySourceIfUnmodifiedSince:CopyObject' :: CopyObject -> Maybe ISO8601
$sel:copySourceIfModifiedSince:CopyObject' :: CopyObject -> Maybe ISO8601
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/", BucketName -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS BucketName
bucket, ByteString
"/", ObjectKey -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ObjectKey
key]

instance Core.ToQuery CopyObject where
  toQuery :: CopyObject -> QueryString
toQuery = QueryString -> CopyObject -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCopyObjectResponse' smart constructor.
data CopyObjectResponse = CopyObjectResponse'
  { CopyObjectResponse -> Maybe RequestCharged
requestCharged :: Prelude.Maybe RequestCharged,
    -- | Version ID of the newly created copy.
    CopyObjectResponse -> Maybe ObjectVersionId
versionId :: Prelude.Maybe ObjectVersionId,
    -- | If the object expiration is configured, the response includes this
    -- header.
    CopyObjectResponse -> Maybe Text
expiration :: Prelude.Maybe Prelude.Text,
    -- | If server-side encryption with a customer-provided encryption key was
    -- requested, the response will include this header confirming the
    -- encryption algorithm used.
    CopyObjectResponse -> Maybe Text
sSECustomerAlgorithm :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the copied object uses an S3 Bucket Key for
    -- server-side encryption with Amazon Web Services KMS (SSE-KMS).
    CopyObjectResponse -> Maybe Bool
bucketKeyEnabled :: Prelude.Maybe Prelude.Bool,
    -- | Version of the copied object in the destination bucket.
    CopyObjectResponse -> Maybe Text
copySourceVersionId :: Prelude.Maybe Prelude.Text,
    -- | If server-side encryption with a customer-provided encryption key was
    -- requested, the response will include this header to provide round-trip
    -- message integrity verification of the customer-provided encryption key.
    CopyObjectResponse -> Maybe Text
sSECustomerKeyMD5 :: Prelude.Maybe Prelude.Text,
    -- | If present, specifies the ID of the Amazon Web Services Key Management
    -- Service (Amazon Web Services KMS) symmetric customer managed key that
    -- was used for the object.
    CopyObjectResponse -> Maybe (Sensitive Text)
sSEKMSKeyId :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | If present, specifies the Amazon Web Services KMS Encryption Context to
    -- use for object encryption. The value of this header is a base64-encoded
    -- UTF-8 string holding JSON with the encryption context key-value pairs.
    CopyObjectResponse -> Maybe (Sensitive Text)
sSEKMSEncryptionContext :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The server-side encryption algorithm used when storing this object in
    -- Amazon S3 (for example, AES256, aws:kms).
    CopyObjectResponse -> Maybe ServerSideEncryption
serverSideEncryption :: Prelude.Maybe ServerSideEncryption,
    -- | Container for all response elements.
    CopyObjectResponse -> Maybe CopyObjectResult
copyObjectResult :: Prelude.Maybe CopyObjectResult,
    -- | The response's http status code.
    CopyObjectResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CopyObjectResponse -> CopyObjectResponse -> Bool
(CopyObjectResponse -> CopyObjectResponse -> Bool)
-> (CopyObjectResponse -> CopyObjectResponse -> Bool)
-> Eq CopyObjectResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CopyObjectResponse -> CopyObjectResponse -> Bool
$c/= :: CopyObjectResponse -> CopyObjectResponse -> Bool
== :: CopyObjectResponse -> CopyObjectResponse -> Bool
$c== :: CopyObjectResponse -> CopyObjectResponse -> Bool
Prelude.Eq, Int -> CopyObjectResponse -> ShowS
[CopyObjectResponse] -> ShowS
CopyObjectResponse -> String
(Int -> CopyObjectResponse -> ShowS)
-> (CopyObjectResponse -> String)
-> ([CopyObjectResponse] -> ShowS)
-> Show CopyObjectResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CopyObjectResponse] -> ShowS
$cshowList :: [CopyObjectResponse] -> ShowS
show :: CopyObjectResponse -> String
$cshow :: CopyObjectResponse -> String
showsPrec :: Int -> CopyObjectResponse -> ShowS
$cshowsPrec :: Int -> CopyObjectResponse -> ShowS
Prelude.Show, (forall x. CopyObjectResponse -> Rep CopyObjectResponse x)
-> (forall x. Rep CopyObjectResponse x -> CopyObjectResponse)
-> Generic CopyObjectResponse
forall x. Rep CopyObjectResponse x -> CopyObjectResponse
forall x. CopyObjectResponse -> Rep CopyObjectResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CopyObjectResponse x -> CopyObjectResponse
$cfrom :: forall x. CopyObjectResponse -> Rep CopyObjectResponse x
Prelude.Generic)

-- |
-- Create a value of 'CopyObjectResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'requestCharged', 'copyObjectResponse_requestCharged' - Undocumented member.
--
-- 'versionId', 'copyObjectResponse_versionId' - Version ID of the newly created copy.
--
-- 'expiration', 'copyObjectResponse_expiration' - If the object expiration is configured, the response includes this
-- header.
--
-- 'sSECustomerAlgorithm', 'copyObjectResponse_sSECustomerAlgorithm' - If server-side encryption with a customer-provided encryption key was
-- requested, the response will include this header confirming the
-- encryption algorithm used.
--
-- 'bucketKeyEnabled', 'copyObjectResponse_bucketKeyEnabled' - Indicates whether the copied object uses an S3 Bucket Key for
-- server-side encryption with Amazon Web Services KMS (SSE-KMS).
--
-- 'copySourceVersionId', 'copyObjectResponse_copySourceVersionId' - Version of the copied object in the destination bucket.
--
-- 'sSECustomerKeyMD5', 'copyObjectResponse_sSECustomerKeyMD5' - If server-side encryption with a customer-provided encryption key was
-- requested, the response will include this header to provide round-trip
-- message integrity verification of the customer-provided encryption key.
--
-- 'sSEKMSKeyId', 'copyObjectResponse_sSEKMSKeyId' - If present, specifies the ID of the Amazon Web Services Key Management
-- Service (Amazon Web Services KMS) symmetric customer managed key that
-- was used for the object.
--
-- 'sSEKMSEncryptionContext', 'copyObjectResponse_sSEKMSEncryptionContext' - If present, specifies the Amazon Web Services KMS Encryption Context to
-- use for object encryption. The value of this header is a base64-encoded
-- UTF-8 string holding JSON with the encryption context key-value pairs.
--
-- 'serverSideEncryption', 'copyObjectResponse_serverSideEncryption' - The server-side encryption algorithm used when storing this object in
-- Amazon S3 (for example, AES256, aws:kms).
--
-- 'copyObjectResult', 'copyObjectResponse_copyObjectResult' - Container for all response elements.
--
-- 'httpStatus', 'copyObjectResponse_httpStatus' - The response's http status code.
newCopyObjectResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CopyObjectResponse
newCopyObjectResponse :: Int -> CopyObjectResponse
newCopyObjectResponse Int
pHttpStatus_ =
  CopyObjectResponse' :: Maybe RequestCharged
-> Maybe ObjectVersionId
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe ServerSideEncryption
-> Maybe CopyObjectResult
-> Int
-> CopyObjectResponse
CopyObjectResponse'
    { $sel:requestCharged:CopyObjectResponse' :: Maybe RequestCharged
requestCharged =
        Maybe RequestCharged
forall a. Maybe a
Prelude.Nothing,
      $sel:versionId:CopyObjectResponse' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
forall a. Maybe a
Prelude.Nothing,
      $sel:expiration:CopyObjectResponse' :: Maybe Text
expiration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sSECustomerAlgorithm:CopyObjectResponse' :: Maybe Text
sSECustomerAlgorithm = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketKeyEnabled:CopyObjectResponse' :: Maybe Bool
bucketKeyEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:copySourceVersionId:CopyObjectResponse' :: Maybe Text
copySourceVersionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sSECustomerKeyMD5:CopyObjectResponse' :: Maybe Text
sSECustomerKeyMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sSEKMSKeyId:CopyObjectResponse' :: Maybe (Sensitive Text)
sSEKMSKeyId = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:sSEKMSEncryptionContext:CopyObjectResponse' :: Maybe (Sensitive Text)
sSEKMSEncryptionContext = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:serverSideEncryption:CopyObjectResponse' :: Maybe ServerSideEncryption
serverSideEncryption = Maybe ServerSideEncryption
forall a. Maybe a
Prelude.Nothing,
      $sel:copyObjectResult:CopyObjectResponse' :: Maybe CopyObjectResult
copyObjectResult = Maybe CopyObjectResult
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CopyObjectResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
copyObjectResponse_requestCharged :: Lens.Lens' CopyObjectResponse (Prelude.Maybe RequestCharged)
copyObjectResponse_requestCharged :: (Maybe RequestCharged -> f (Maybe RequestCharged))
-> CopyObjectResponse -> f CopyObjectResponse
copyObjectResponse_requestCharged = (CopyObjectResponse -> Maybe RequestCharged)
-> (CopyObjectResponse
    -> Maybe RequestCharged -> CopyObjectResponse)
-> Lens
     CopyObjectResponse
     CopyObjectResponse
     (Maybe RequestCharged)
     (Maybe RequestCharged)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObjectResponse' {Maybe RequestCharged
requestCharged :: Maybe RequestCharged
$sel:requestCharged:CopyObjectResponse' :: CopyObjectResponse -> Maybe RequestCharged
requestCharged} -> Maybe RequestCharged
requestCharged) (\s :: CopyObjectResponse
s@CopyObjectResponse' {} Maybe RequestCharged
a -> CopyObjectResponse
s {$sel:requestCharged:CopyObjectResponse' :: Maybe RequestCharged
requestCharged = Maybe RequestCharged
a} :: CopyObjectResponse)

-- | Version ID of the newly created copy.
copyObjectResponse_versionId :: Lens.Lens' CopyObjectResponse (Prelude.Maybe ObjectVersionId)
copyObjectResponse_versionId :: (Maybe ObjectVersionId -> f (Maybe ObjectVersionId))
-> CopyObjectResponse -> f CopyObjectResponse
copyObjectResponse_versionId = (CopyObjectResponse -> Maybe ObjectVersionId)
-> (CopyObjectResponse
    -> Maybe ObjectVersionId -> CopyObjectResponse)
-> Lens
     CopyObjectResponse
     CopyObjectResponse
     (Maybe ObjectVersionId)
     (Maybe ObjectVersionId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObjectResponse' {Maybe ObjectVersionId
versionId :: Maybe ObjectVersionId
$sel:versionId:CopyObjectResponse' :: CopyObjectResponse -> Maybe ObjectVersionId
versionId} -> Maybe ObjectVersionId
versionId) (\s :: CopyObjectResponse
s@CopyObjectResponse' {} Maybe ObjectVersionId
a -> CopyObjectResponse
s {$sel:versionId:CopyObjectResponse' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
a} :: CopyObjectResponse)

-- | If the object expiration is configured, the response includes this
-- header.
copyObjectResponse_expiration :: Lens.Lens' CopyObjectResponse (Prelude.Maybe Prelude.Text)
copyObjectResponse_expiration :: (Maybe Text -> f (Maybe Text))
-> CopyObjectResponse -> f CopyObjectResponse
copyObjectResponse_expiration = (CopyObjectResponse -> Maybe Text)
-> (CopyObjectResponse -> Maybe Text -> CopyObjectResponse)
-> Lens
     CopyObjectResponse CopyObjectResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObjectResponse' {Maybe Text
expiration :: Maybe Text
$sel:expiration:CopyObjectResponse' :: CopyObjectResponse -> Maybe Text
expiration} -> Maybe Text
expiration) (\s :: CopyObjectResponse
s@CopyObjectResponse' {} Maybe Text
a -> CopyObjectResponse
s {$sel:expiration:CopyObjectResponse' :: Maybe Text
expiration = Maybe Text
a} :: CopyObjectResponse)

-- | If server-side encryption with a customer-provided encryption key was
-- requested, the response will include this header confirming the
-- encryption algorithm used.
copyObjectResponse_sSECustomerAlgorithm :: Lens.Lens' CopyObjectResponse (Prelude.Maybe Prelude.Text)
copyObjectResponse_sSECustomerAlgorithm :: (Maybe Text -> f (Maybe Text))
-> CopyObjectResponse -> f CopyObjectResponse
copyObjectResponse_sSECustomerAlgorithm = (CopyObjectResponse -> Maybe Text)
-> (CopyObjectResponse -> Maybe Text -> CopyObjectResponse)
-> Lens
     CopyObjectResponse CopyObjectResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObjectResponse' {Maybe Text
sSECustomerAlgorithm :: Maybe Text
$sel:sSECustomerAlgorithm:CopyObjectResponse' :: CopyObjectResponse -> Maybe Text
sSECustomerAlgorithm} -> Maybe Text
sSECustomerAlgorithm) (\s :: CopyObjectResponse
s@CopyObjectResponse' {} Maybe Text
a -> CopyObjectResponse
s {$sel:sSECustomerAlgorithm:CopyObjectResponse' :: Maybe Text
sSECustomerAlgorithm = Maybe Text
a} :: CopyObjectResponse)

-- | Indicates whether the copied object uses an S3 Bucket Key for
-- server-side encryption with Amazon Web Services KMS (SSE-KMS).
copyObjectResponse_bucketKeyEnabled :: Lens.Lens' CopyObjectResponse (Prelude.Maybe Prelude.Bool)
copyObjectResponse_bucketKeyEnabled :: (Maybe Bool -> f (Maybe Bool))
-> CopyObjectResponse -> f CopyObjectResponse
copyObjectResponse_bucketKeyEnabled = (CopyObjectResponse -> Maybe Bool)
-> (CopyObjectResponse -> Maybe Bool -> CopyObjectResponse)
-> Lens
     CopyObjectResponse CopyObjectResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObjectResponse' {Maybe Bool
bucketKeyEnabled :: Maybe Bool
$sel:bucketKeyEnabled:CopyObjectResponse' :: CopyObjectResponse -> Maybe Bool
bucketKeyEnabled} -> Maybe Bool
bucketKeyEnabled) (\s :: CopyObjectResponse
s@CopyObjectResponse' {} Maybe Bool
a -> CopyObjectResponse
s {$sel:bucketKeyEnabled:CopyObjectResponse' :: Maybe Bool
bucketKeyEnabled = Maybe Bool
a} :: CopyObjectResponse)

-- | Version of the copied object in the destination bucket.
copyObjectResponse_copySourceVersionId :: Lens.Lens' CopyObjectResponse (Prelude.Maybe Prelude.Text)
copyObjectResponse_copySourceVersionId :: (Maybe Text -> f (Maybe Text))
-> CopyObjectResponse -> f CopyObjectResponse
copyObjectResponse_copySourceVersionId = (CopyObjectResponse -> Maybe Text)
-> (CopyObjectResponse -> Maybe Text -> CopyObjectResponse)
-> Lens
     CopyObjectResponse CopyObjectResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObjectResponse' {Maybe Text
copySourceVersionId :: Maybe Text
$sel:copySourceVersionId:CopyObjectResponse' :: CopyObjectResponse -> Maybe Text
copySourceVersionId} -> Maybe Text
copySourceVersionId) (\s :: CopyObjectResponse
s@CopyObjectResponse' {} Maybe Text
a -> CopyObjectResponse
s {$sel:copySourceVersionId:CopyObjectResponse' :: Maybe Text
copySourceVersionId = Maybe Text
a} :: CopyObjectResponse)

-- | If server-side encryption with a customer-provided encryption key was
-- requested, the response will include this header to provide round-trip
-- message integrity verification of the customer-provided encryption key.
copyObjectResponse_sSECustomerKeyMD5 :: Lens.Lens' CopyObjectResponse (Prelude.Maybe Prelude.Text)
copyObjectResponse_sSECustomerKeyMD5 :: (Maybe Text -> f (Maybe Text))
-> CopyObjectResponse -> f CopyObjectResponse
copyObjectResponse_sSECustomerKeyMD5 = (CopyObjectResponse -> Maybe Text)
-> (CopyObjectResponse -> Maybe Text -> CopyObjectResponse)
-> Lens
     CopyObjectResponse CopyObjectResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObjectResponse' {Maybe Text
sSECustomerKeyMD5 :: Maybe Text
$sel:sSECustomerKeyMD5:CopyObjectResponse' :: CopyObjectResponse -> Maybe Text
sSECustomerKeyMD5} -> Maybe Text
sSECustomerKeyMD5) (\s :: CopyObjectResponse
s@CopyObjectResponse' {} Maybe Text
a -> CopyObjectResponse
s {$sel:sSECustomerKeyMD5:CopyObjectResponse' :: Maybe Text
sSECustomerKeyMD5 = Maybe Text
a} :: CopyObjectResponse)

-- | If present, specifies the ID of the Amazon Web Services Key Management
-- Service (Amazon Web Services KMS) symmetric customer managed key that
-- was used for the object.
copyObjectResponse_sSEKMSKeyId :: Lens.Lens' CopyObjectResponse (Prelude.Maybe Prelude.Text)
copyObjectResponse_sSEKMSKeyId :: (Maybe Text -> f (Maybe Text))
-> CopyObjectResponse -> f CopyObjectResponse
copyObjectResponse_sSEKMSKeyId = (CopyObjectResponse -> Maybe (Sensitive Text))
-> (CopyObjectResponse
    -> Maybe (Sensitive Text) -> CopyObjectResponse)
-> Lens
     CopyObjectResponse
     CopyObjectResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObjectResponse' {Maybe (Sensitive Text)
sSEKMSKeyId :: Maybe (Sensitive Text)
$sel:sSEKMSKeyId:CopyObjectResponse' :: CopyObjectResponse -> Maybe (Sensitive Text)
sSEKMSKeyId} -> Maybe (Sensitive Text)
sSEKMSKeyId) (\s :: CopyObjectResponse
s@CopyObjectResponse' {} Maybe (Sensitive Text)
a -> CopyObjectResponse
s {$sel:sSEKMSKeyId:CopyObjectResponse' :: Maybe (Sensitive Text)
sSEKMSKeyId = Maybe (Sensitive Text)
a} :: CopyObjectResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CopyObjectResponse -> f CopyObjectResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CopyObjectResponse
-> f CopyObjectResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | If present, specifies the Amazon Web Services KMS Encryption Context to
-- use for object encryption. The value of this header is a base64-encoded
-- UTF-8 string holding JSON with the encryption context key-value pairs.
copyObjectResponse_sSEKMSEncryptionContext :: Lens.Lens' CopyObjectResponse (Prelude.Maybe Prelude.Text)
copyObjectResponse_sSEKMSEncryptionContext :: (Maybe Text -> f (Maybe Text))
-> CopyObjectResponse -> f CopyObjectResponse
copyObjectResponse_sSEKMSEncryptionContext = (CopyObjectResponse -> Maybe (Sensitive Text))
-> (CopyObjectResponse
    -> Maybe (Sensitive Text) -> CopyObjectResponse)
-> Lens
     CopyObjectResponse
     CopyObjectResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObjectResponse' {Maybe (Sensitive Text)
sSEKMSEncryptionContext :: Maybe (Sensitive Text)
$sel:sSEKMSEncryptionContext:CopyObjectResponse' :: CopyObjectResponse -> Maybe (Sensitive Text)
sSEKMSEncryptionContext} -> Maybe (Sensitive Text)
sSEKMSEncryptionContext) (\s :: CopyObjectResponse
s@CopyObjectResponse' {} Maybe (Sensitive Text)
a -> CopyObjectResponse
s {$sel:sSEKMSEncryptionContext:CopyObjectResponse' :: Maybe (Sensitive Text)
sSEKMSEncryptionContext = Maybe (Sensitive Text)
a} :: CopyObjectResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CopyObjectResponse -> f CopyObjectResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CopyObjectResponse
-> f CopyObjectResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The server-side encryption algorithm used when storing this object in
-- Amazon S3 (for example, AES256, aws:kms).
copyObjectResponse_serverSideEncryption :: Lens.Lens' CopyObjectResponse (Prelude.Maybe ServerSideEncryption)
copyObjectResponse_serverSideEncryption :: (Maybe ServerSideEncryption -> f (Maybe ServerSideEncryption))
-> CopyObjectResponse -> f CopyObjectResponse
copyObjectResponse_serverSideEncryption = (CopyObjectResponse -> Maybe ServerSideEncryption)
-> (CopyObjectResponse
    -> Maybe ServerSideEncryption -> CopyObjectResponse)
-> Lens
     CopyObjectResponse
     CopyObjectResponse
     (Maybe ServerSideEncryption)
     (Maybe ServerSideEncryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObjectResponse' {Maybe ServerSideEncryption
serverSideEncryption :: Maybe ServerSideEncryption
$sel:serverSideEncryption:CopyObjectResponse' :: CopyObjectResponse -> Maybe ServerSideEncryption
serverSideEncryption} -> Maybe ServerSideEncryption
serverSideEncryption) (\s :: CopyObjectResponse
s@CopyObjectResponse' {} Maybe ServerSideEncryption
a -> CopyObjectResponse
s {$sel:serverSideEncryption:CopyObjectResponse' :: Maybe ServerSideEncryption
serverSideEncryption = Maybe ServerSideEncryption
a} :: CopyObjectResponse)

-- | Container for all response elements.
copyObjectResponse_copyObjectResult :: Lens.Lens' CopyObjectResponse (Prelude.Maybe CopyObjectResult)
copyObjectResponse_copyObjectResult :: (Maybe CopyObjectResult -> f (Maybe CopyObjectResult))
-> CopyObjectResponse -> f CopyObjectResponse
copyObjectResponse_copyObjectResult = (CopyObjectResponse -> Maybe CopyObjectResult)
-> (CopyObjectResponse
    -> Maybe CopyObjectResult -> CopyObjectResponse)
-> Lens
     CopyObjectResponse
     CopyObjectResponse
     (Maybe CopyObjectResult)
     (Maybe CopyObjectResult)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObjectResponse' {Maybe CopyObjectResult
copyObjectResult :: Maybe CopyObjectResult
$sel:copyObjectResult:CopyObjectResponse' :: CopyObjectResponse -> Maybe CopyObjectResult
copyObjectResult} -> Maybe CopyObjectResult
copyObjectResult) (\s :: CopyObjectResponse
s@CopyObjectResponse' {} Maybe CopyObjectResult
a -> CopyObjectResponse
s {$sel:copyObjectResult:CopyObjectResponse' :: Maybe CopyObjectResult
copyObjectResult = Maybe CopyObjectResult
a} :: CopyObjectResponse)

-- | The response's http status code.
copyObjectResponse_httpStatus :: Lens.Lens' CopyObjectResponse Prelude.Int
copyObjectResponse_httpStatus :: (Int -> f Int) -> CopyObjectResponse -> f CopyObjectResponse
copyObjectResponse_httpStatus = (CopyObjectResponse -> Int)
-> (CopyObjectResponse -> Int -> CopyObjectResponse)
-> Lens CopyObjectResponse CopyObjectResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyObjectResponse' {Int
httpStatus :: Int
$sel:httpStatus:CopyObjectResponse' :: CopyObjectResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CopyObjectResponse
s@CopyObjectResponse' {} Int
a -> CopyObjectResponse
s {$sel:httpStatus:CopyObjectResponse' :: Int
httpStatus = Int
a} :: CopyObjectResponse)

instance Prelude.NFData CopyObjectResponse