{-# 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.UploadPartCopy
-- 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)
--
-- Uploads a part by copying data from an existing object as data source.
-- You specify the data source by adding the request header
-- @x-amz-copy-source@ in your request and a byte range by adding the
-- request header @x-amz-copy-source-range@ in your request.
--
-- The minimum allowable part size for a multipart upload is 5 MB. For more
-- information about multipart upload limits, go to
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/qfacts.html Quick Facts>
-- in the /Amazon S3 User Guide/.
--
-- Instead of using an existing object as part data, you might use the
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html UploadPart>
-- action and provide data in your request.
--
-- You must initiate a multipart upload before you can upload any part. In
-- response to your initiate request. Amazon S3 returns a unique
-- identifier, the upload ID, that you must include in your upload part
-- request.
--
-- For more information about using the @UploadPartCopy@ operation, see the
-- following:
--
-- -   For conceptual information about multipart uploads, see
--     <https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html Uploading Objects Using Multipart Upload>
--     in the /Amazon S3 User Guide/.
--
-- -   For information about permissions required to use the multipart
--     upload API, see
--     <https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html Multipart Upload and Permissions>
--     in the /Amazon S3 User Guide/.
--
-- -   For information about copying objects using a single atomic action
--     vs. the multipart upload, see
--     <https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectOperations.html Operations on Objects>
--     in the /Amazon S3 User Guide/.
--
-- -   For information about using server-side encryption with
--     customer-provided encryption keys with the UploadPartCopy operation,
--     see
--     <https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html CopyObject>
--     and
--     <https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html UploadPart>.
--
-- Note the following additional considerations about the request headers
-- @x-amz-copy-source-if-match@, @x-amz-copy-source-if-none-match@,
-- @x-amz-copy-source-if-unmodified-since@, and
-- @x-amz-copy-source-if-modified-since@:
--
-- -   __Consideration 1__ - If both of the @x-amz-copy-source-if-match@
--     and @x-amz-copy-source-if-unmodified-since@ headers are present in
--     the request as follows:
--
--     @x-amz-copy-source-if-match@ condition evaluates to @true@, and;
--
--     @x-amz-copy-source-if-unmodified-since@ condition evaluates to
--     @false@;
--
--     Amazon S3 returns @200 OK@ and copies the data.
--
-- -   __Consideration 2__ - If both of the
--     @x-amz-copy-source-if-none-match@ and
--     @x-amz-copy-source-if-modified-since@ headers are present in the
--     request as follows:
--
--     @x-amz-copy-source-if-none-match@ condition evaluates to @false@,
--     and;
--
--     @x-amz-copy-source-if-modified-since@ condition evaluates to @true@;
--
--     Amazon S3 returns @412 Precondition Failed@ response code.
--
-- __Versioning__
--
-- If your bucket has versioning enabled, you could have multiple versions
-- of the same object. By default, @x-amz-copy-source@ identifies the
-- current version of the object to copy. If the current version is a
-- delete marker and you don\'t specify a versionId in the
-- @x-amz-copy-source@, Amazon S3 returns a 404 error, because the object
-- does not exist. If you specify versionId in the @x-amz-copy-source@ and
-- the versionId is a delete marker, Amazon S3 returns an HTTP 400 error,
-- because you are not allowed to specify a delete marker as a version for
-- the @x-amz-copy-source@.
--
-- You can optionally specify a specific version of the source object to
-- copy by adding the @versionId@ subresource as shown in the following
-- example:
--
-- @x-amz-copy-source: \/bucket\/object?versionId=version id@
--
-- __Special Errors__
--
-- -   -   /Code: NoSuchUpload/
--
--     -   /Cause: The specified multipart upload does not exist. The
--         upload ID might be invalid, or the multipart upload might have
--         been aborted or completed./
--
--     -   /HTTP Status Code: 404 Not Found/
--
-- -   -   /Code: InvalidRequest/
--
--     -   /Cause: The specified copy source is not supported as a
--         byte-range copy source./
--
--     -   /HTTP Status Code: 400 Bad Request/
--
-- __Related Resources__
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html CreateMultipartUpload>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html UploadPart>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html CompleteMultipartUpload>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html AbortMultipartUpload>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html ListParts>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html ListMultipartUploads>
module Amazonka.S3.UploadPartCopy
  ( -- * Creating a Request
    UploadPartCopy (..),
    newUploadPartCopy,

    -- * Request Lenses
    uploadPartCopy_copySourceIfModifiedSince,
    uploadPartCopy_copySourceIfUnmodifiedSince,
    uploadPartCopy_copySourceRange,
    uploadPartCopy_copySourceSSECustomerKeyMD5,
    uploadPartCopy_copySourceIfNoneMatch,
    uploadPartCopy_sSECustomerAlgorithm,
    uploadPartCopy_sSECustomerKey,
    uploadPartCopy_requestPayer,
    uploadPartCopy_copySourceIfMatch,
    uploadPartCopy_expectedSourceBucketOwner,
    uploadPartCopy_sSECustomerKeyMD5,
    uploadPartCopy_copySourceSSECustomerKey,
    uploadPartCopy_copySourceSSECustomerAlgorithm,
    uploadPartCopy_expectedBucketOwner,
    uploadPartCopy_bucket,
    uploadPartCopy_copySource,
    uploadPartCopy_key,
    uploadPartCopy_partNumber,
    uploadPartCopy_uploadId,

    -- * Destructuring the Response
    UploadPartCopyResponse (..),
    newUploadPartCopyResponse,

    -- * Response Lenses
    uploadPartCopyResponse_requestCharged,
    uploadPartCopyResponse_copyPartResult,
    uploadPartCopyResponse_sSECustomerAlgorithm,
    uploadPartCopyResponse_bucketKeyEnabled,
    uploadPartCopyResponse_copySourceVersionId,
    uploadPartCopyResponse_sSECustomerKeyMD5,
    uploadPartCopyResponse_sSEKMSKeyId,
    uploadPartCopyResponse_serverSideEncryption,
    uploadPartCopyResponse_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:/ 'newUploadPartCopy' smart constructor.
data UploadPartCopy = UploadPartCopy'
  { -- | Copies the object if it has been modified since the specified time.
    UploadPartCopy -> Maybe ISO8601
copySourceIfModifiedSince :: Prelude.Maybe Core.ISO8601,
    -- | Copies the object if it hasn\'t been modified since the specified time.
    UploadPartCopy -> Maybe ISO8601
copySourceIfUnmodifiedSince :: Prelude.Maybe Core.ISO8601,
    -- | The range of bytes to copy from the source object. The range value must
    -- use the form bytes=first-last, where the first and last are the
    -- zero-based byte offsets to copy. For example, bytes=0-9 indicates that
    -- you want to copy the first 10 bytes of the source. You can copy a range
    -- only if the source object is greater than 5 MB.
    UploadPartCopy -> Maybe Text
copySourceRange :: Prelude.Maybe Prelude.Text,
    -- | 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.
    UploadPartCopy -> Maybe Text
copySourceSSECustomerKeyMD5 :: Prelude.Maybe Prelude.Text,
    -- | Copies the object if its entity tag (ETag) is different than the
    -- specified ETag.
    UploadPartCopy -> Maybe Text
copySourceIfNoneMatch :: Prelude.Maybe Prelude.Text,
    -- | Specifies the algorithm to use to when encrypting the object (for
    -- example, AES256).
    UploadPartCopy -> 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. This must be
    -- the same encryption key specified in the initiate multipart upload
    -- request.
    UploadPartCopy -> Maybe (Sensitive Text)
sSECustomerKey :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    UploadPartCopy -> Maybe RequestPayer
requestPayer :: Prelude.Maybe RequestPayer,
    -- | Copies the object if its entity tag (ETag) matches the specified tag.
    UploadPartCopy -> Maybe Text
copySourceIfMatch :: 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.
    UploadPartCopy -> Maybe Text
expectedSourceBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | 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.
    UploadPartCopy -> Maybe Text
sSECustomerKeyMD5 :: 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.
    UploadPartCopy -> Maybe (Sensitive Text)
copySourceSSECustomerKey :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Specifies the algorithm to use when decrypting the source object (for
    -- example, AES256).
    UploadPartCopy -> Maybe Text
copySourceSSECustomerAlgorithm :: 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.
    UploadPartCopy -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The bucket name.
    --
    -- 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/.
    UploadPartCopy -> 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 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.
    UploadPartCopy -> Text
copySource :: Prelude.Text,
    -- | Object key for which the multipart upload was initiated.
    UploadPartCopy -> ObjectKey
key :: ObjectKey,
    -- | Part number of part being copied. This is a positive integer between 1
    -- and 10,000.
    UploadPartCopy -> Int
partNumber :: Prelude.Int,
    -- | Upload ID identifying the multipart upload whose part is being copied.
    UploadPartCopy -> Text
uploadId :: Prelude.Text
  }
  deriving (UploadPartCopy -> UploadPartCopy -> Bool
(UploadPartCopy -> UploadPartCopy -> Bool)
-> (UploadPartCopy -> UploadPartCopy -> Bool) -> Eq UploadPartCopy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UploadPartCopy -> UploadPartCopy -> Bool
$c/= :: UploadPartCopy -> UploadPartCopy -> Bool
== :: UploadPartCopy -> UploadPartCopy -> Bool
$c== :: UploadPartCopy -> UploadPartCopy -> Bool
Prelude.Eq, Int -> UploadPartCopy -> ShowS
[UploadPartCopy] -> ShowS
UploadPartCopy -> String
(Int -> UploadPartCopy -> ShowS)
-> (UploadPartCopy -> String)
-> ([UploadPartCopy] -> ShowS)
-> Show UploadPartCopy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UploadPartCopy] -> ShowS
$cshowList :: [UploadPartCopy] -> ShowS
show :: UploadPartCopy -> String
$cshow :: UploadPartCopy -> String
showsPrec :: Int -> UploadPartCopy -> ShowS
$cshowsPrec :: Int -> UploadPartCopy -> ShowS
Prelude.Show, (forall x. UploadPartCopy -> Rep UploadPartCopy x)
-> (forall x. Rep UploadPartCopy x -> UploadPartCopy)
-> Generic UploadPartCopy
forall x. Rep UploadPartCopy x -> UploadPartCopy
forall x. UploadPartCopy -> Rep UploadPartCopy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UploadPartCopy x -> UploadPartCopy
$cfrom :: forall x. UploadPartCopy -> Rep UploadPartCopy x
Prelude.Generic)

-- |
-- Create a value of 'UploadPartCopy' 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', 'uploadPartCopy_copySourceIfModifiedSince' - Copies the object if it has been modified since the specified time.
--
-- 'copySourceIfUnmodifiedSince', 'uploadPartCopy_copySourceIfUnmodifiedSince' - Copies the object if it hasn\'t been modified since the specified time.
--
-- 'copySourceRange', 'uploadPartCopy_copySourceRange' - The range of bytes to copy from the source object. The range value must
-- use the form bytes=first-last, where the first and last are the
-- zero-based byte offsets to copy. For example, bytes=0-9 indicates that
-- you want to copy the first 10 bytes of the source. You can copy a range
-- only if the source object is greater than 5 MB.
--
-- 'copySourceSSECustomerKeyMD5', 'uploadPartCopy_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.
--
-- 'copySourceIfNoneMatch', 'uploadPartCopy_copySourceIfNoneMatch' - Copies the object if its entity tag (ETag) is different than the
-- specified ETag.
--
-- 'sSECustomerAlgorithm', 'uploadPartCopy_sSECustomerAlgorithm' - Specifies the algorithm to use to when encrypting the object (for
-- example, AES256).
--
-- 'sSECustomerKey', 'uploadPartCopy_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. This must be
-- the same encryption key specified in the initiate multipart upload
-- request.
--
-- 'requestPayer', 'uploadPartCopy_requestPayer' - Undocumented member.
--
-- 'copySourceIfMatch', 'uploadPartCopy_copySourceIfMatch' - Copies the object if its entity tag (ETag) matches the specified tag.
--
-- 'expectedSourceBucketOwner', 'uploadPartCopy_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.
--
-- 'sSECustomerKeyMD5', 'uploadPartCopy_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.
--
-- 'copySourceSSECustomerKey', 'uploadPartCopy_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.
--
-- 'copySourceSSECustomerAlgorithm', 'uploadPartCopy_copySourceSSECustomerAlgorithm' - Specifies the algorithm to use when decrypting the source object (for
-- example, AES256).
--
-- 'expectedBucketOwner', 'uploadPartCopy_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.
--
-- 'bucket', 'uploadPartCopy_bucket' - The bucket name.
--
-- 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', 'uploadPartCopy_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 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', 'uploadPartCopy_key' - Object key for which the multipart upload was initiated.
--
-- 'partNumber', 'uploadPartCopy_partNumber' - Part number of part being copied. This is a positive integer between 1
-- and 10,000.
--
-- 'uploadId', 'uploadPartCopy_uploadId' - Upload ID identifying the multipart upload whose part is being copied.
newUploadPartCopy ::
  -- | 'bucket'
  BucketName ->
  -- | 'copySource'
  Prelude.Text ->
  -- | 'key'
  ObjectKey ->
  -- | 'partNumber'
  Prelude.Int ->
  -- | 'uploadId'
  Prelude.Text ->
  UploadPartCopy
newUploadPartCopy :: BucketName -> Text -> ObjectKey -> Int -> Text -> UploadPartCopy
newUploadPartCopy
  BucketName
pBucket_
  Text
pCopySource_
  ObjectKey
pKey_
  Int
pPartNumber_
  Text
pUploadId_ =
    UploadPartCopy' :: Maybe ISO8601
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe RequestPayer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> BucketName
-> Text
-> ObjectKey
-> Int
-> Text
-> UploadPartCopy
UploadPartCopy'
      { $sel:copySourceIfModifiedSince:UploadPartCopy' :: Maybe ISO8601
copySourceIfModifiedSince =
          Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
        $sel:copySourceIfUnmodifiedSince:UploadPartCopy' :: Maybe ISO8601
copySourceIfUnmodifiedSince = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
        $sel:copySourceRange:UploadPartCopy' :: Maybe Text
copySourceRange = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:copySourceSSECustomerKeyMD5:UploadPartCopy' :: Maybe Text
copySourceSSECustomerKeyMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:copySourceIfNoneMatch:UploadPartCopy' :: Maybe Text
copySourceIfNoneMatch = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:sSECustomerAlgorithm:UploadPartCopy' :: Maybe Text
sSECustomerAlgorithm = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:sSECustomerKey:UploadPartCopy' :: Maybe (Sensitive Text)
sSECustomerKey = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:requestPayer:UploadPartCopy' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
forall a. Maybe a
Prelude.Nothing,
        $sel:copySourceIfMatch:UploadPartCopy' :: Maybe Text
copySourceIfMatch = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:expectedSourceBucketOwner:UploadPartCopy' :: Maybe Text
expectedSourceBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:sSECustomerKeyMD5:UploadPartCopy' :: Maybe Text
sSECustomerKeyMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:copySourceSSECustomerKey:UploadPartCopy' :: Maybe (Sensitive Text)
copySourceSSECustomerKey = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:copySourceSSECustomerAlgorithm:UploadPartCopy' :: Maybe Text
copySourceSSECustomerAlgorithm = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:expectedBucketOwner:UploadPartCopy' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:bucket:UploadPartCopy' :: BucketName
bucket = BucketName
pBucket_,
        $sel:copySource:UploadPartCopy' :: Text
copySource = Text
pCopySource_,
        $sel:key:UploadPartCopy' :: ObjectKey
key = ObjectKey
pKey_,
        $sel:partNumber:UploadPartCopy' :: Int
partNumber = Int
pPartNumber_,
        $sel:uploadId:UploadPartCopy' :: Text
uploadId = Text
pUploadId_
      }

-- | Copies the object if it has been modified since the specified time.
uploadPartCopy_copySourceIfModifiedSince :: Lens.Lens' UploadPartCopy (Prelude.Maybe Prelude.UTCTime)
uploadPartCopy_copySourceIfModifiedSince :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_copySourceIfModifiedSince = (UploadPartCopy -> Maybe ISO8601)
-> (UploadPartCopy -> Maybe ISO8601 -> UploadPartCopy)
-> Lens
     UploadPartCopy UploadPartCopy (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {Maybe ISO8601
copySourceIfModifiedSince :: Maybe ISO8601
$sel:copySourceIfModifiedSince:UploadPartCopy' :: UploadPartCopy -> Maybe ISO8601
copySourceIfModifiedSince} -> Maybe ISO8601
copySourceIfModifiedSince) (\s :: UploadPartCopy
s@UploadPartCopy' {} Maybe ISO8601
a -> UploadPartCopy
s {$sel:copySourceIfModifiedSince:UploadPartCopy' :: Maybe ISO8601
copySourceIfModifiedSince = Maybe ISO8601
a} :: UploadPartCopy) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> UploadPartCopy -> f UploadPartCopy)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UploadPartCopy
-> f UploadPartCopy
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.
uploadPartCopy_copySourceIfUnmodifiedSince :: Lens.Lens' UploadPartCopy (Prelude.Maybe Prelude.UTCTime)
uploadPartCopy_copySourceIfUnmodifiedSince :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_copySourceIfUnmodifiedSince = (UploadPartCopy -> Maybe ISO8601)
-> (UploadPartCopy -> Maybe ISO8601 -> UploadPartCopy)
-> Lens
     UploadPartCopy UploadPartCopy (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {Maybe ISO8601
copySourceIfUnmodifiedSince :: Maybe ISO8601
$sel:copySourceIfUnmodifiedSince:UploadPartCopy' :: UploadPartCopy -> Maybe ISO8601
copySourceIfUnmodifiedSince} -> Maybe ISO8601
copySourceIfUnmodifiedSince) (\s :: UploadPartCopy
s@UploadPartCopy' {} Maybe ISO8601
a -> UploadPartCopy
s {$sel:copySourceIfUnmodifiedSince:UploadPartCopy' :: Maybe ISO8601
copySourceIfUnmodifiedSince = Maybe ISO8601
a} :: UploadPartCopy) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> UploadPartCopy -> f UploadPartCopy)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UploadPartCopy
-> f UploadPartCopy
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

-- | The range of bytes to copy from the source object. The range value must
-- use the form bytes=first-last, where the first and last are the
-- zero-based byte offsets to copy. For example, bytes=0-9 indicates that
-- you want to copy the first 10 bytes of the source. You can copy a range
-- only if the source object is greater than 5 MB.
uploadPartCopy_copySourceRange :: Lens.Lens' UploadPartCopy (Prelude.Maybe Prelude.Text)
uploadPartCopy_copySourceRange :: (Maybe Text -> f (Maybe Text))
-> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_copySourceRange = (UploadPartCopy -> Maybe Text)
-> (UploadPartCopy -> Maybe Text -> UploadPartCopy)
-> Lens UploadPartCopy UploadPartCopy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {Maybe Text
copySourceRange :: Maybe Text
$sel:copySourceRange:UploadPartCopy' :: UploadPartCopy -> Maybe Text
copySourceRange} -> Maybe Text
copySourceRange) (\s :: UploadPartCopy
s@UploadPartCopy' {} Maybe Text
a -> UploadPartCopy
s {$sel:copySourceRange:UploadPartCopy' :: Maybe Text
copySourceRange = Maybe Text
a} :: UploadPartCopy)

-- | 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.
uploadPartCopy_copySourceSSECustomerKeyMD5 :: Lens.Lens' UploadPartCopy (Prelude.Maybe Prelude.Text)
uploadPartCopy_copySourceSSECustomerKeyMD5 :: (Maybe Text -> f (Maybe Text))
-> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_copySourceSSECustomerKeyMD5 = (UploadPartCopy -> Maybe Text)
-> (UploadPartCopy -> Maybe Text -> UploadPartCopy)
-> Lens UploadPartCopy UploadPartCopy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {Maybe Text
copySourceSSECustomerKeyMD5 :: Maybe Text
$sel:copySourceSSECustomerKeyMD5:UploadPartCopy' :: UploadPartCopy -> Maybe Text
copySourceSSECustomerKeyMD5} -> Maybe Text
copySourceSSECustomerKeyMD5) (\s :: UploadPartCopy
s@UploadPartCopy' {} Maybe Text
a -> UploadPartCopy
s {$sel:copySourceSSECustomerKeyMD5:UploadPartCopy' :: Maybe Text
copySourceSSECustomerKeyMD5 = Maybe Text
a} :: UploadPartCopy)

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

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

-- | 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. This must be
-- the same encryption key specified in the initiate multipart upload
-- request.
uploadPartCopy_sSECustomerKey :: Lens.Lens' UploadPartCopy (Prelude.Maybe Prelude.Text)
uploadPartCopy_sSECustomerKey :: (Maybe Text -> f (Maybe Text))
-> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_sSECustomerKey = (UploadPartCopy -> Maybe (Sensitive Text))
-> (UploadPartCopy -> Maybe (Sensitive Text) -> UploadPartCopy)
-> Lens
     UploadPartCopy
     UploadPartCopy
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {Maybe (Sensitive Text)
sSECustomerKey :: Maybe (Sensitive Text)
$sel:sSECustomerKey:UploadPartCopy' :: UploadPartCopy -> Maybe (Sensitive Text)
sSECustomerKey} -> Maybe (Sensitive Text)
sSECustomerKey) (\s :: UploadPartCopy
s@UploadPartCopy' {} Maybe (Sensitive Text)
a -> UploadPartCopy
s {$sel:sSECustomerKey:UploadPartCopy' :: Maybe (Sensitive Text)
sSECustomerKey = Maybe (Sensitive Text)
a} :: UploadPartCopy) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UploadPartCopy -> f UploadPartCopy)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UploadPartCopy
-> f UploadPartCopy
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.
uploadPartCopy_requestPayer :: Lens.Lens' UploadPartCopy (Prelude.Maybe RequestPayer)
uploadPartCopy_requestPayer :: (Maybe RequestPayer -> f (Maybe RequestPayer))
-> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_requestPayer = (UploadPartCopy -> Maybe RequestPayer)
-> (UploadPartCopy -> Maybe RequestPayer -> UploadPartCopy)
-> Lens
     UploadPartCopy
     UploadPartCopy
     (Maybe RequestPayer)
     (Maybe RequestPayer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {Maybe RequestPayer
requestPayer :: Maybe RequestPayer
$sel:requestPayer:UploadPartCopy' :: UploadPartCopy -> Maybe RequestPayer
requestPayer} -> Maybe RequestPayer
requestPayer) (\s :: UploadPartCopy
s@UploadPartCopy' {} Maybe RequestPayer
a -> UploadPartCopy
s {$sel:requestPayer:UploadPartCopy' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
a} :: UploadPartCopy)

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

-- | 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.
uploadPartCopy_expectedSourceBucketOwner :: Lens.Lens' UploadPartCopy (Prelude.Maybe Prelude.Text)
uploadPartCopy_expectedSourceBucketOwner :: (Maybe Text -> f (Maybe Text))
-> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_expectedSourceBucketOwner = (UploadPartCopy -> Maybe Text)
-> (UploadPartCopy -> Maybe Text -> UploadPartCopy)
-> Lens UploadPartCopy UploadPartCopy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {Maybe Text
expectedSourceBucketOwner :: Maybe Text
$sel:expectedSourceBucketOwner:UploadPartCopy' :: UploadPartCopy -> Maybe Text
expectedSourceBucketOwner} -> Maybe Text
expectedSourceBucketOwner) (\s :: UploadPartCopy
s@UploadPartCopy' {} Maybe Text
a -> UploadPartCopy
s {$sel:expectedSourceBucketOwner:UploadPartCopy' :: Maybe Text
expectedSourceBucketOwner = Maybe Text
a} :: UploadPartCopy)

-- | 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.
uploadPartCopy_sSECustomerKeyMD5 :: Lens.Lens' UploadPartCopy (Prelude.Maybe Prelude.Text)
uploadPartCopy_sSECustomerKeyMD5 :: (Maybe Text -> f (Maybe Text))
-> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_sSECustomerKeyMD5 = (UploadPartCopy -> Maybe Text)
-> (UploadPartCopy -> Maybe Text -> UploadPartCopy)
-> Lens UploadPartCopy UploadPartCopy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {Maybe Text
sSECustomerKeyMD5 :: Maybe Text
$sel:sSECustomerKeyMD5:UploadPartCopy' :: UploadPartCopy -> Maybe Text
sSECustomerKeyMD5} -> Maybe Text
sSECustomerKeyMD5) (\s :: UploadPartCopy
s@UploadPartCopy' {} Maybe Text
a -> UploadPartCopy
s {$sel:sSECustomerKeyMD5:UploadPartCopy' :: Maybe Text
sSECustomerKeyMD5 = Maybe Text
a} :: UploadPartCopy)

-- | 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.
uploadPartCopy_copySourceSSECustomerKey :: Lens.Lens' UploadPartCopy (Prelude.Maybe Prelude.Text)
uploadPartCopy_copySourceSSECustomerKey :: (Maybe Text -> f (Maybe Text))
-> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_copySourceSSECustomerKey = (UploadPartCopy -> Maybe (Sensitive Text))
-> (UploadPartCopy -> Maybe (Sensitive Text) -> UploadPartCopy)
-> Lens
     UploadPartCopy
     UploadPartCopy
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {Maybe (Sensitive Text)
copySourceSSECustomerKey :: Maybe (Sensitive Text)
$sel:copySourceSSECustomerKey:UploadPartCopy' :: UploadPartCopy -> Maybe (Sensitive Text)
copySourceSSECustomerKey} -> Maybe (Sensitive Text)
copySourceSSECustomerKey) (\s :: UploadPartCopy
s@UploadPartCopy' {} Maybe (Sensitive Text)
a -> UploadPartCopy
s {$sel:copySourceSSECustomerKey:UploadPartCopy' :: Maybe (Sensitive Text)
copySourceSSECustomerKey = Maybe (Sensitive Text)
a} :: UploadPartCopy) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UploadPartCopy -> f UploadPartCopy)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UploadPartCopy
-> f UploadPartCopy
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 the algorithm to use when decrypting the source object (for
-- example, AES256).
uploadPartCopy_copySourceSSECustomerAlgorithm :: Lens.Lens' UploadPartCopy (Prelude.Maybe Prelude.Text)
uploadPartCopy_copySourceSSECustomerAlgorithm :: (Maybe Text -> f (Maybe Text))
-> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_copySourceSSECustomerAlgorithm = (UploadPartCopy -> Maybe Text)
-> (UploadPartCopy -> Maybe Text -> UploadPartCopy)
-> Lens UploadPartCopy UploadPartCopy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {Maybe Text
copySourceSSECustomerAlgorithm :: Maybe Text
$sel:copySourceSSECustomerAlgorithm:UploadPartCopy' :: UploadPartCopy -> Maybe Text
copySourceSSECustomerAlgorithm} -> Maybe Text
copySourceSSECustomerAlgorithm) (\s :: UploadPartCopy
s@UploadPartCopy' {} Maybe Text
a -> UploadPartCopy
s {$sel:copySourceSSECustomerAlgorithm:UploadPartCopy' :: Maybe Text
copySourceSSECustomerAlgorithm = Maybe Text
a} :: UploadPartCopy)

-- | 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.
uploadPartCopy_expectedBucketOwner :: Lens.Lens' UploadPartCopy (Prelude.Maybe Prelude.Text)
uploadPartCopy_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_expectedBucketOwner = (UploadPartCopy -> Maybe Text)
-> (UploadPartCopy -> Maybe Text -> UploadPartCopy)
-> Lens UploadPartCopy UploadPartCopy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:UploadPartCopy' :: UploadPartCopy -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: UploadPartCopy
s@UploadPartCopy' {} Maybe Text
a -> UploadPartCopy
s {$sel:expectedBucketOwner:UploadPartCopy' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: UploadPartCopy)

-- | The bucket name.
--
-- 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/.
uploadPartCopy_bucket :: Lens.Lens' UploadPartCopy BucketName
uploadPartCopy_bucket :: (BucketName -> f BucketName) -> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_bucket = (UploadPartCopy -> BucketName)
-> (UploadPartCopy -> BucketName -> UploadPartCopy)
-> Lens UploadPartCopy UploadPartCopy BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {BucketName
bucket :: BucketName
$sel:bucket:UploadPartCopy' :: UploadPartCopy -> BucketName
bucket} -> BucketName
bucket) (\s :: UploadPartCopy
s@UploadPartCopy' {} BucketName
a -> UploadPartCopy
s {$sel:bucket:UploadPartCopy' :: BucketName
bucket = BucketName
a} :: UploadPartCopy)

-- | 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 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.
uploadPartCopy_copySource :: Lens.Lens' UploadPartCopy Prelude.Text
uploadPartCopy_copySource :: (Text -> f Text) -> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_copySource = (UploadPartCopy -> Text)
-> (UploadPartCopy -> Text -> UploadPartCopy)
-> Lens UploadPartCopy UploadPartCopy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {Text
copySource :: Text
$sel:copySource:UploadPartCopy' :: UploadPartCopy -> Text
copySource} -> Text
copySource) (\s :: UploadPartCopy
s@UploadPartCopy' {} Text
a -> UploadPartCopy
s {$sel:copySource:UploadPartCopy' :: Text
copySource = Text
a} :: UploadPartCopy)

-- | Object key for which the multipart upload was initiated.
uploadPartCopy_key :: Lens.Lens' UploadPartCopy ObjectKey
uploadPartCopy_key :: (ObjectKey -> f ObjectKey) -> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_key = (UploadPartCopy -> ObjectKey)
-> (UploadPartCopy -> ObjectKey -> UploadPartCopy)
-> Lens UploadPartCopy UploadPartCopy ObjectKey ObjectKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {ObjectKey
key :: ObjectKey
$sel:key:UploadPartCopy' :: UploadPartCopy -> ObjectKey
key} -> ObjectKey
key) (\s :: UploadPartCopy
s@UploadPartCopy' {} ObjectKey
a -> UploadPartCopy
s {$sel:key:UploadPartCopy' :: ObjectKey
key = ObjectKey
a} :: UploadPartCopy)

-- | Part number of part being copied. This is a positive integer between 1
-- and 10,000.
uploadPartCopy_partNumber :: Lens.Lens' UploadPartCopy Prelude.Int
uploadPartCopy_partNumber :: (Int -> f Int) -> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_partNumber = (UploadPartCopy -> Int)
-> (UploadPartCopy -> Int -> UploadPartCopy)
-> Lens UploadPartCopy UploadPartCopy Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {Int
partNumber :: Int
$sel:partNumber:UploadPartCopy' :: UploadPartCopy -> Int
partNumber} -> Int
partNumber) (\s :: UploadPartCopy
s@UploadPartCopy' {} Int
a -> UploadPartCopy
s {$sel:partNumber:UploadPartCopy' :: Int
partNumber = Int
a} :: UploadPartCopy)

-- | Upload ID identifying the multipart upload whose part is being copied.
uploadPartCopy_uploadId :: Lens.Lens' UploadPartCopy Prelude.Text
uploadPartCopy_uploadId :: (Text -> f Text) -> UploadPartCopy -> f UploadPartCopy
uploadPartCopy_uploadId = (UploadPartCopy -> Text)
-> (UploadPartCopy -> Text -> UploadPartCopy)
-> Lens UploadPartCopy UploadPartCopy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopy' {Text
uploadId :: Text
$sel:uploadId:UploadPartCopy' :: UploadPartCopy -> Text
uploadId} -> Text
uploadId) (\s :: UploadPartCopy
s@UploadPartCopy' {} Text
a -> UploadPartCopy
s {$sel:uploadId:UploadPartCopy' :: Text
uploadId = Text
a} :: UploadPartCopy)

instance Core.AWSRequest UploadPartCopy where
  type
    AWSResponse UploadPartCopy =
      UploadPartCopyResponse
  request :: UploadPartCopy -> Request UploadPartCopy
request =
    Request UploadPartCopy -> Request UploadPartCopy
forall a. Request a -> Request a
Request.s3vhost
      (Request UploadPartCopy -> Request UploadPartCopy)
-> (UploadPartCopy -> Request UploadPartCopy)
-> UploadPartCopy
-> Request UploadPartCopy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> UploadPartCopy -> Request UploadPartCopy
forall a. ToRequest a => Service -> a -> Request a
Request.put Service
defaultService
  response :: Logger
-> Service
-> Proxy UploadPartCopy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UploadPartCopy)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse UploadPartCopy))
-> Logger
-> Service
-> Proxy UploadPartCopy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UploadPartCopy)))
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 CopyPartResult
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe ServerSideEncryption
-> Int
-> UploadPartCopyResponse
UploadPartCopyResponse'
            (Maybe RequestCharged
 -> Maybe CopyPartResult
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe (Sensitive Text)
 -> Maybe ServerSideEncryption
 -> Int
 -> UploadPartCopyResponse)
-> Either String (Maybe RequestCharged)
-> Either
     String
     (Maybe CopyPartResult
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> UploadPartCopyResponse)
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 CopyPartResult
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> UploadPartCopyResponse)
-> Either String (Maybe CopyPartResult)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> UploadPartCopyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node] -> Either String (Maybe CopyPartResult)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
            Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> UploadPartCopyResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> UploadPartCopyResponse)
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 ServerSideEncryption
   -> Int
   -> UploadPartCopyResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> UploadPartCopyResponse)
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 ServerSideEncryption
   -> Int
   -> UploadPartCopyResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> UploadPartCopyResponse)
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 ServerSideEncryption
   -> Int
   -> UploadPartCopyResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption -> Int -> UploadPartCopyResponse)
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 ServerSideEncryption -> Int -> UploadPartCopyResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String
     (Maybe ServerSideEncryption -> Int -> UploadPartCopyResponse)
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 ServerSideEncryption -> Int -> UploadPartCopyResponse)
-> Either String (Maybe ServerSideEncryption)
-> Either String (Int -> UploadPartCopyResponse)
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 (Int -> UploadPartCopyResponse)
-> Either String Int -> Either String UploadPartCopyResponse
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 UploadPartCopy

instance Prelude.NFData UploadPartCopy

instance Core.ToHeaders UploadPartCopy where
  toHeaders :: UploadPartCopy -> ResponseHeaders
toHeaders UploadPartCopy' {Int
Maybe Text
Maybe (Sensitive Text)
Maybe ISO8601
Maybe RequestPayer
Text
ObjectKey
BucketName
uploadId :: Text
partNumber :: Int
key :: ObjectKey
copySource :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
copySourceSSECustomerAlgorithm :: Maybe Text
copySourceSSECustomerKey :: Maybe (Sensitive Text)
sSECustomerKeyMD5 :: Maybe Text
expectedSourceBucketOwner :: Maybe Text
copySourceIfMatch :: Maybe Text
requestPayer :: Maybe RequestPayer
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
copySourceIfNoneMatch :: Maybe Text
copySourceSSECustomerKeyMD5 :: Maybe Text
copySourceRange :: Maybe Text
copySourceIfUnmodifiedSince :: Maybe ISO8601
copySourceIfModifiedSince :: Maybe ISO8601
$sel:uploadId:UploadPartCopy' :: UploadPartCopy -> Text
$sel:partNumber:UploadPartCopy' :: UploadPartCopy -> Int
$sel:key:UploadPartCopy' :: UploadPartCopy -> ObjectKey
$sel:copySource:UploadPartCopy' :: UploadPartCopy -> Text
$sel:bucket:UploadPartCopy' :: UploadPartCopy -> BucketName
$sel:expectedBucketOwner:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceSSECustomerAlgorithm:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceSSECustomerKey:UploadPartCopy' :: UploadPartCopy -> Maybe (Sensitive Text)
$sel:sSECustomerKeyMD5:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:expectedSourceBucketOwner:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceIfMatch:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:requestPayer:UploadPartCopy' :: UploadPartCopy -> Maybe RequestPayer
$sel:sSECustomerKey:UploadPartCopy' :: UploadPartCopy -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceIfNoneMatch:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceSSECustomerKeyMD5:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceRange:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceIfUnmodifiedSince:UploadPartCopy' :: UploadPartCopy -> Maybe ISO8601
$sel:copySourceIfModifiedSince:UploadPartCopy' :: UploadPartCopy -> 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-range" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
copySourceRange,
        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-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-copy-source-if-match"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
copySourceIfMatch,
        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-server-side-encryption-customer-key-MD5"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
sSECustomerKeyMD5,
        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-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-expected-bucket-owner"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
expectedBucketOwner,
        HeaderName
"x-amz-copy-source" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
copySource
      ]

instance Core.ToPath UploadPartCopy where
  toPath :: UploadPartCopy -> ByteString
toPath UploadPartCopy' {Int
Maybe Text
Maybe (Sensitive Text)
Maybe ISO8601
Maybe RequestPayer
Text
ObjectKey
BucketName
uploadId :: Text
partNumber :: Int
key :: ObjectKey
copySource :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
copySourceSSECustomerAlgorithm :: Maybe Text
copySourceSSECustomerKey :: Maybe (Sensitive Text)
sSECustomerKeyMD5 :: Maybe Text
expectedSourceBucketOwner :: Maybe Text
copySourceIfMatch :: Maybe Text
requestPayer :: Maybe RequestPayer
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
copySourceIfNoneMatch :: Maybe Text
copySourceSSECustomerKeyMD5 :: Maybe Text
copySourceRange :: Maybe Text
copySourceIfUnmodifiedSince :: Maybe ISO8601
copySourceIfModifiedSince :: Maybe ISO8601
$sel:uploadId:UploadPartCopy' :: UploadPartCopy -> Text
$sel:partNumber:UploadPartCopy' :: UploadPartCopy -> Int
$sel:key:UploadPartCopy' :: UploadPartCopy -> ObjectKey
$sel:copySource:UploadPartCopy' :: UploadPartCopy -> Text
$sel:bucket:UploadPartCopy' :: UploadPartCopy -> BucketName
$sel:expectedBucketOwner:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceSSECustomerAlgorithm:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceSSECustomerKey:UploadPartCopy' :: UploadPartCopy -> Maybe (Sensitive Text)
$sel:sSECustomerKeyMD5:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:expectedSourceBucketOwner:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceIfMatch:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:requestPayer:UploadPartCopy' :: UploadPartCopy -> Maybe RequestPayer
$sel:sSECustomerKey:UploadPartCopy' :: UploadPartCopy -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceIfNoneMatch:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceSSECustomerKeyMD5:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceRange:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceIfUnmodifiedSince:UploadPartCopy' :: UploadPartCopy -> Maybe ISO8601
$sel:copySourceIfModifiedSince:UploadPartCopy' :: UploadPartCopy -> 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 UploadPartCopy where
  toQuery :: UploadPartCopy -> QueryString
toQuery UploadPartCopy' {Int
Maybe Text
Maybe (Sensitive Text)
Maybe ISO8601
Maybe RequestPayer
Text
ObjectKey
BucketName
uploadId :: Text
partNumber :: Int
key :: ObjectKey
copySource :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
copySourceSSECustomerAlgorithm :: Maybe Text
copySourceSSECustomerKey :: Maybe (Sensitive Text)
sSECustomerKeyMD5 :: Maybe Text
expectedSourceBucketOwner :: Maybe Text
copySourceIfMatch :: Maybe Text
requestPayer :: Maybe RequestPayer
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
copySourceIfNoneMatch :: Maybe Text
copySourceSSECustomerKeyMD5 :: Maybe Text
copySourceRange :: Maybe Text
copySourceIfUnmodifiedSince :: Maybe ISO8601
copySourceIfModifiedSince :: Maybe ISO8601
$sel:uploadId:UploadPartCopy' :: UploadPartCopy -> Text
$sel:partNumber:UploadPartCopy' :: UploadPartCopy -> Int
$sel:key:UploadPartCopy' :: UploadPartCopy -> ObjectKey
$sel:copySource:UploadPartCopy' :: UploadPartCopy -> Text
$sel:bucket:UploadPartCopy' :: UploadPartCopy -> BucketName
$sel:expectedBucketOwner:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceSSECustomerAlgorithm:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceSSECustomerKey:UploadPartCopy' :: UploadPartCopy -> Maybe (Sensitive Text)
$sel:sSECustomerKeyMD5:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:expectedSourceBucketOwner:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceIfMatch:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:requestPayer:UploadPartCopy' :: UploadPartCopy -> Maybe RequestPayer
$sel:sSECustomerKey:UploadPartCopy' :: UploadPartCopy -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceIfNoneMatch:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceSSECustomerKeyMD5:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceRange:UploadPartCopy' :: UploadPartCopy -> Maybe Text
$sel:copySourceIfUnmodifiedSince:UploadPartCopy' :: UploadPartCopy -> Maybe ISO8601
$sel:copySourceIfModifiedSince:UploadPartCopy' :: UploadPartCopy -> Maybe ISO8601
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"partNumber" ByteString -> Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Int
partNumber,
        ByteString
"uploadId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
uploadId
      ]

-- | /See:/ 'newUploadPartCopyResponse' smart constructor.
data UploadPartCopyResponse = UploadPartCopyResponse'
  { UploadPartCopyResponse -> Maybe RequestCharged
requestCharged :: Prelude.Maybe RequestCharged,
    -- | Container for all response elements.
    UploadPartCopyResponse -> Maybe CopyPartResult
copyPartResult :: Prelude.Maybe CopyPartResult,
    -- | If server-side encryption with a customer-provided encryption key was
    -- requested, the response will include this header confirming the
    -- encryption algorithm used.
    UploadPartCopyResponse -> Maybe Text
sSECustomerAlgorithm :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the multipart upload uses an S3 Bucket Key for
    -- server-side encryption with Amazon Web Services KMS (SSE-KMS).
    UploadPartCopyResponse -> Maybe Bool
bucketKeyEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The version of the source object that was copied, if you have enabled
    -- versioning on the source bucket.
    UploadPartCopyResponse -> 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.
    UploadPartCopyResponse -> 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.
    UploadPartCopyResponse -> Maybe (Sensitive Text)
sSEKMSKeyId :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The server-side encryption algorithm used when storing this object in
    -- Amazon S3 (for example, AES256, aws:kms).
    UploadPartCopyResponse -> Maybe ServerSideEncryption
serverSideEncryption :: Prelude.Maybe ServerSideEncryption,
    -- | The response's http status code.
    UploadPartCopyResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UploadPartCopyResponse -> UploadPartCopyResponse -> Bool
(UploadPartCopyResponse -> UploadPartCopyResponse -> Bool)
-> (UploadPartCopyResponse -> UploadPartCopyResponse -> Bool)
-> Eq UploadPartCopyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UploadPartCopyResponse -> UploadPartCopyResponse -> Bool
$c/= :: UploadPartCopyResponse -> UploadPartCopyResponse -> Bool
== :: UploadPartCopyResponse -> UploadPartCopyResponse -> Bool
$c== :: UploadPartCopyResponse -> UploadPartCopyResponse -> Bool
Prelude.Eq, Int -> UploadPartCopyResponse -> ShowS
[UploadPartCopyResponse] -> ShowS
UploadPartCopyResponse -> String
(Int -> UploadPartCopyResponse -> ShowS)
-> (UploadPartCopyResponse -> String)
-> ([UploadPartCopyResponse] -> ShowS)
-> Show UploadPartCopyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UploadPartCopyResponse] -> ShowS
$cshowList :: [UploadPartCopyResponse] -> ShowS
show :: UploadPartCopyResponse -> String
$cshow :: UploadPartCopyResponse -> String
showsPrec :: Int -> UploadPartCopyResponse -> ShowS
$cshowsPrec :: Int -> UploadPartCopyResponse -> ShowS
Prelude.Show, (forall x. UploadPartCopyResponse -> Rep UploadPartCopyResponse x)
-> (forall x.
    Rep UploadPartCopyResponse x -> UploadPartCopyResponse)
-> Generic UploadPartCopyResponse
forall x. Rep UploadPartCopyResponse x -> UploadPartCopyResponse
forall x. UploadPartCopyResponse -> Rep UploadPartCopyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UploadPartCopyResponse x -> UploadPartCopyResponse
$cfrom :: forall x. UploadPartCopyResponse -> Rep UploadPartCopyResponse x
Prelude.Generic)

-- |
-- Create a value of 'UploadPartCopyResponse' 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', 'uploadPartCopyResponse_requestCharged' - Undocumented member.
--
-- 'copyPartResult', 'uploadPartCopyResponse_copyPartResult' - Container for all response elements.
--
-- 'sSECustomerAlgorithm', 'uploadPartCopyResponse_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', 'uploadPartCopyResponse_bucketKeyEnabled' - Indicates whether the multipart upload uses an S3 Bucket Key for
-- server-side encryption with Amazon Web Services KMS (SSE-KMS).
--
-- 'copySourceVersionId', 'uploadPartCopyResponse_copySourceVersionId' - The version of the source object that was copied, if you have enabled
-- versioning on the source bucket.
--
-- 'sSECustomerKeyMD5', 'uploadPartCopyResponse_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', 'uploadPartCopyResponse_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.
--
-- 'serverSideEncryption', 'uploadPartCopyResponse_serverSideEncryption' - The server-side encryption algorithm used when storing this object in
-- Amazon S3 (for example, AES256, aws:kms).
--
-- 'httpStatus', 'uploadPartCopyResponse_httpStatus' - The response's http status code.
newUploadPartCopyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UploadPartCopyResponse
newUploadPartCopyResponse :: Int -> UploadPartCopyResponse
newUploadPartCopyResponse Int
pHttpStatus_ =
  UploadPartCopyResponse' :: Maybe RequestCharged
-> Maybe CopyPartResult
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe ServerSideEncryption
-> Int
-> UploadPartCopyResponse
UploadPartCopyResponse'
    { $sel:requestCharged:UploadPartCopyResponse' :: Maybe RequestCharged
requestCharged =
        Maybe RequestCharged
forall a. Maybe a
Prelude.Nothing,
      $sel:copyPartResult:UploadPartCopyResponse' :: Maybe CopyPartResult
copyPartResult = Maybe CopyPartResult
forall a. Maybe a
Prelude.Nothing,
      $sel:sSECustomerAlgorithm:UploadPartCopyResponse' :: Maybe Text
sSECustomerAlgorithm = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketKeyEnabled:UploadPartCopyResponse' :: Maybe Bool
bucketKeyEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:copySourceVersionId:UploadPartCopyResponse' :: Maybe Text
copySourceVersionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sSECustomerKeyMD5:UploadPartCopyResponse' :: Maybe Text
sSECustomerKeyMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sSEKMSKeyId:UploadPartCopyResponse' :: Maybe (Sensitive Text)
sSEKMSKeyId = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:serverSideEncryption:UploadPartCopyResponse' :: Maybe ServerSideEncryption
serverSideEncryption = Maybe ServerSideEncryption
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UploadPartCopyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | Container for all response elements.
uploadPartCopyResponse_copyPartResult :: Lens.Lens' UploadPartCopyResponse (Prelude.Maybe CopyPartResult)
uploadPartCopyResponse_copyPartResult :: (Maybe CopyPartResult -> f (Maybe CopyPartResult))
-> UploadPartCopyResponse -> f UploadPartCopyResponse
uploadPartCopyResponse_copyPartResult = (UploadPartCopyResponse -> Maybe CopyPartResult)
-> (UploadPartCopyResponse
    -> Maybe CopyPartResult -> UploadPartCopyResponse)
-> Lens
     UploadPartCopyResponse
     UploadPartCopyResponse
     (Maybe CopyPartResult)
     (Maybe CopyPartResult)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopyResponse' {Maybe CopyPartResult
copyPartResult :: Maybe CopyPartResult
$sel:copyPartResult:UploadPartCopyResponse' :: UploadPartCopyResponse -> Maybe CopyPartResult
copyPartResult} -> Maybe CopyPartResult
copyPartResult) (\s :: UploadPartCopyResponse
s@UploadPartCopyResponse' {} Maybe CopyPartResult
a -> UploadPartCopyResponse
s {$sel:copyPartResult:UploadPartCopyResponse' :: Maybe CopyPartResult
copyPartResult = Maybe CopyPartResult
a} :: UploadPartCopyResponse)

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

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

-- | The version of the source object that was copied, if you have enabled
-- versioning on the source bucket.
uploadPartCopyResponse_copySourceVersionId :: Lens.Lens' UploadPartCopyResponse (Prelude.Maybe Prelude.Text)
uploadPartCopyResponse_copySourceVersionId :: (Maybe Text -> f (Maybe Text))
-> UploadPartCopyResponse -> f UploadPartCopyResponse
uploadPartCopyResponse_copySourceVersionId = (UploadPartCopyResponse -> Maybe Text)
-> (UploadPartCopyResponse -> Maybe Text -> UploadPartCopyResponse)
-> Lens
     UploadPartCopyResponse
     UploadPartCopyResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopyResponse' {Maybe Text
copySourceVersionId :: Maybe Text
$sel:copySourceVersionId:UploadPartCopyResponse' :: UploadPartCopyResponse -> Maybe Text
copySourceVersionId} -> Maybe Text
copySourceVersionId) (\s :: UploadPartCopyResponse
s@UploadPartCopyResponse' {} Maybe Text
a -> UploadPartCopyResponse
s {$sel:copySourceVersionId:UploadPartCopyResponse' :: Maybe Text
copySourceVersionId = Maybe Text
a} :: UploadPartCopyResponse)

-- | 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.
uploadPartCopyResponse_sSECustomerKeyMD5 :: Lens.Lens' UploadPartCopyResponse (Prelude.Maybe Prelude.Text)
uploadPartCopyResponse_sSECustomerKeyMD5 :: (Maybe Text -> f (Maybe Text))
-> UploadPartCopyResponse -> f UploadPartCopyResponse
uploadPartCopyResponse_sSECustomerKeyMD5 = (UploadPartCopyResponse -> Maybe Text)
-> (UploadPartCopyResponse -> Maybe Text -> UploadPartCopyResponse)
-> Lens
     UploadPartCopyResponse
     UploadPartCopyResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopyResponse' {Maybe Text
sSECustomerKeyMD5 :: Maybe Text
$sel:sSECustomerKeyMD5:UploadPartCopyResponse' :: UploadPartCopyResponse -> Maybe Text
sSECustomerKeyMD5} -> Maybe Text
sSECustomerKeyMD5) (\s :: UploadPartCopyResponse
s@UploadPartCopyResponse' {} Maybe Text
a -> UploadPartCopyResponse
s {$sel:sSECustomerKeyMD5:UploadPartCopyResponse' :: Maybe Text
sSECustomerKeyMD5 = Maybe Text
a} :: UploadPartCopyResponse)

-- | 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.
uploadPartCopyResponse_sSEKMSKeyId :: Lens.Lens' UploadPartCopyResponse (Prelude.Maybe Prelude.Text)
uploadPartCopyResponse_sSEKMSKeyId :: (Maybe Text -> f (Maybe Text))
-> UploadPartCopyResponse -> f UploadPartCopyResponse
uploadPartCopyResponse_sSEKMSKeyId = (UploadPartCopyResponse -> Maybe (Sensitive Text))
-> (UploadPartCopyResponse
    -> Maybe (Sensitive Text) -> UploadPartCopyResponse)
-> Lens
     UploadPartCopyResponse
     UploadPartCopyResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopyResponse' {Maybe (Sensitive Text)
sSEKMSKeyId :: Maybe (Sensitive Text)
$sel:sSEKMSKeyId:UploadPartCopyResponse' :: UploadPartCopyResponse -> Maybe (Sensitive Text)
sSEKMSKeyId} -> Maybe (Sensitive Text)
sSEKMSKeyId) (\s :: UploadPartCopyResponse
s@UploadPartCopyResponse' {} Maybe (Sensitive Text)
a -> UploadPartCopyResponse
s {$sel:sSEKMSKeyId:UploadPartCopyResponse' :: Maybe (Sensitive Text)
sSEKMSKeyId = Maybe (Sensitive Text)
a} :: UploadPartCopyResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UploadPartCopyResponse -> f UploadPartCopyResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UploadPartCopyResponse
-> f UploadPartCopyResponse
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).
uploadPartCopyResponse_serverSideEncryption :: Lens.Lens' UploadPartCopyResponse (Prelude.Maybe ServerSideEncryption)
uploadPartCopyResponse_serverSideEncryption :: (Maybe ServerSideEncryption -> f (Maybe ServerSideEncryption))
-> UploadPartCopyResponse -> f UploadPartCopyResponse
uploadPartCopyResponse_serverSideEncryption = (UploadPartCopyResponse -> Maybe ServerSideEncryption)
-> (UploadPartCopyResponse
    -> Maybe ServerSideEncryption -> UploadPartCopyResponse)
-> Lens
     UploadPartCopyResponse
     UploadPartCopyResponse
     (Maybe ServerSideEncryption)
     (Maybe ServerSideEncryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartCopyResponse' {Maybe ServerSideEncryption
serverSideEncryption :: Maybe ServerSideEncryption
$sel:serverSideEncryption:UploadPartCopyResponse' :: UploadPartCopyResponse -> Maybe ServerSideEncryption
serverSideEncryption} -> Maybe ServerSideEncryption
serverSideEncryption) (\s :: UploadPartCopyResponse
s@UploadPartCopyResponse' {} Maybe ServerSideEncryption
a -> UploadPartCopyResponse
s {$sel:serverSideEncryption:UploadPartCopyResponse' :: Maybe ServerSideEncryption
serverSideEncryption = Maybe ServerSideEncryption
a} :: UploadPartCopyResponse)

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

instance Prelude.NFData UploadPartCopyResponse