{-# 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.UploadPart
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Uploads a part in a multipart upload.
--
-- In this operation, you provide part data in your request. However, you
-- have an option to specify your existing Amazon S3 object as a data
-- source for the part you are uploading. To upload a part from an existing
-- object, you use the
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html UploadPartCopy>
-- operation.
--
-- You must initiate a multipart upload (see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html CreateMultipartUpload>)
-- before you can upload any part. In response to your initiate request,
-- Amazon S3 returns an upload ID, a unique identifier, that you must
-- include in your upload part request.
--
-- Part numbers can be any number from 1 to 10,000, inclusive. A part
-- number uniquely identifies a part and also defines its position within
-- the object being created. If you upload a new part using the same part
-- number that was used with a previous part, the previously uploaded part
-- is overwritten.
--
-- For information about maximum and minimum part sizes and other multipart
-- upload specifications, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html Multipart upload limits>
-- in the /Amazon S3 User Guide/.
--
-- To ensure that data is not corrupted when traversing the network,
-- specify the @Content-MD5@ header in the upload part request. Amazon S3
-- checks the part data against the provided MD5 value. If they do not
-- match, Amazon S3 returns an error.
--
-- If the upload request is signed with Signature Version 4, then Amazon
-- Web Services S3 uses the @x-amz-content-sha256@ header as a checksum
-- instead of @Content-MD5@. For more information see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html Authenticating Requests: Using the Authorization Header (Amazon Web Services Signature Version 4)>.
--
-- __Note:__ After you initiate multipart upload and upload one or more
-- parts, you must either complete or abort multipart upload in order to
-- stop getting charged for storage of the uploaded parts. Only after you
-- either complete or abort multipart upload, Amazon S3 frees up the parts
-- storage and stops charging you for the parts storage.
--
-- For more information on multipart uploads, go to
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html Multipart Upload Overview>
-- in the /Amazon S3 User Guide/ .
--
-- For information on the permissions required to use the multipart upload
-- API, go to
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html Multipart Upload and Permissions>
-- in the /Amazon S3 User Guide/.
--
-- You can optionally request server-side encryption where Amazon S3
-- encrypts your data as it writes it to disks in its data centers and
-- decrypts it for you when you access it. You have the option of providing
-- your own encryption key, or you can use the Amazon Web Services managed
-- encryption keys. If you choose to provide your own encryption key, the
-- request headers you provide in the request must match the headers you
-- used in the request to initiate the upload by using
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html CreateMultipartUpload>.
-- For more information, go to
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html Using Server-Side Encryption>
-- in the /Amazon S3 User Guide/.
--
-- Server-side encryption is supported by the S3 Multipart Upload actions.
-- Unless you are using a customer-provided encryption key, you don\'t need
-- to specify the encryption parameters in each UploadPart request.
-- Instead, you only need to specify the server-side encryption parameters
-- in the initial Initiate Multipart request. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html CreateMultipartUpload>.
--
-- If you requested server-side encryption using a customer-provided
-- encryption key in your initiate multipart upload request, you must
-- provide identical encryption information in each part upload using the
-- following headers.
--
-- -   x-amz-server-side-encryption-customer-algorithm
--
-- -   x-amz-server-side-encryption-customer-key
--
-- -   x-amz-server-side-encryption-customer-key-MD5
--
-- __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/
--
--     -   /SOAP Fault Code Prefix: Client/
--
-- __Related Resources__
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html CreateMultipartUpload>
--
-- -   <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.UploadPart
  ( -- * Creating a Request
    UploadPart (..),
    newUploadPart,

    -- * Request Lenses
    uploadPart_checksumAlgorithm,
    uploadPart_checksumCRC32,
    uploadPart_checksumCRC32C,
    uploadPart_checksumSHA1,
    uploadPart_checksumSHA256,
    uploadPart_contentLength,
    uploadPart_contentMD5,
    uploadPart_expectedBucketOwner,
    uploadPart_requestPayer,
    uploadPart_sSECustomerAlgorithm,
    uploadPart_sSECustomerKey,
    uploadPart_sSECustomerKeyMD5,
    uploadPart_bucket,
    uploadPart_key,
    uploadPart_partNumber,
    uploadPart_uploadId,
    uploadPart_body,

    -- * Destructuring the Response
    UploadPartResponse (..),
    newUploadPartResponse,

    -- * Response Lenses
    uploadPartResponse_bucketKeyEnabled,
    uploadPartResponse_checksumCRC32,
    uploadPartResponse_checksumCRC32C,
    uploadPartResponse_checksumSHA1,
    uploadPartResponse_checksumSHA256,
    uploadPartResponse_eTag,
    uploadPartResponse_requestCharged,
    uploadPartResponse_sSECustomerAlgorithm,
    uploadPartResponse_sSECustomerKeyMD5,
    uploadPartResponse_sSEKMSKeyId,
    uploadPartResponse_serverSideEncryption,
    uploadPartResponse_httpStatus,
  )
where

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

-- | /See:/ 'newUploadPart' smart constructor.
data UploadPart = UploadPart'
  { -- | Indicates the algorithm used to create the checksum for the object when
    -- using the SDK. This header will not provide any additional functionality
    -- if not using the SDK. When sending this header, there must be a
    -- corresponding @x-amz-checksum@ or @x-amz-trailer@ header sent.
    -- Otherwise, Amazon S3 fails the request with the HTTP status code
    -- @400 Bad Request@. For more information, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
    -- in the /Amazon S3 User Guide/.
    --
    -- If you provide an individual checksum, Amazon S3 ignores any provided
    -- @ChecksumAlgorithm@ parameter.
    --
    -- This checksum algorithm must be the same for all parts and it match the
    -- checksum value supplied in the @CreateMultipartUpload@ request.
    UploadPart -> Maybe ChecksumAlgorithm
checksumAlgorithm :: Prelude.Maybe ChecksumAlgorithm,
    -- | This header can be used as a data integrity check to verify that the
    -- data received is the same data that was originally sent. This header
    -- specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
    -- more information, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
    -- in the /Amazon S3 User Guide/.
    UploadPart -> Maybe Text
checksumCRC32 :: Prelude.Maybe Prelude.Text,
    -- | This header can be used as a data integrity check to verify that the
    -- data received is the same data that was originally sent. This header
    -- specifies the base64-encoded, 32-bit CRC32C checksum of the object. For
    -- more information, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
    -- in the /Amazon S3 User Guide/.
    UploadPart -> Maybe Text
checksumCRC32C :: Prelude.Maybe Prelude.Text,
    -- | This header can be used as a data integrity check to verify that the
    -- data received is the same data that was originally sent. This header
    -- specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
    -- more information, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
    -- in the /Amazon S3 User Guide/.
    UploadPart -> Maybe Text
checksumSHA1 :: Prelude.Maybe Prelude.Text,
    -- | This header can be used as a data integrity check to verify that the
    -- data received is the same data that was originally sent. This header
    -- specifies the base64-encoded, 256-bit SHA-256 digest of the object. For
    -- more information, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
    -- in the /Amazon S3 User Guide/.
    UploadPart -> Maybe Text
checksumSHA256 :: Prelude.Maybe Prelude.Text,
    -- | Size of the body in bytes. This parameter is useful when the size of the
    -- body cannot be determined automatically.
    UploadPart -> Maybe Integer
contentLength :: Prelude.Maybe Prelude.Integer,
    -- | The base64-encoded 128-bit MD5 digest of the part data. This parameter
    -- is auto-populated when using the command from the CLI. This parameter is
    -- required if object lock parameters are specified.
    UploadPart -> Maybe Text
contentMD5 :: Prelude.Maybe Prelude.Text,
    -- | The account ID of the expected bucket owner. If the bucket is owned by a
    -- different account, the request fails with the HTTP status code
    -- @403 Forbidden@ (access denied).
    UploadPart -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    UploadPart -> Maybe RequestPayer
requestPayer :: Prelude.Maybe RequestPayer,
    -- | Specifies the algorithm to use to when encrypting the object (for
    -- example, AES256).
    UploadPart -> 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.
    UploadPart -> Maybe (Sensitive Text)
sSECustomerKey :: Prelude.Maybe (Data.Sensitive 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.
    UploadPart -> Maybe Text
sSECustomerKeyMD5 :: Prelude.Maybe Prelude.Text,
    -- | The name of the bucket to which the multipart upload was initiated.
    --
    -- 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 with 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 Amazon S3 on Outposts>
    -- in the /Amazon S3 User Guide/.
    UploadPart -> BucketName
bucket :: BucketName,
    -- | Object key for which the multipart upload was initiated.
    UploadPart -> ObjectKey
key :: ObjectKey,
    -- | Part number of part being uploaded. This is a positive integer between 1
    -- and 10,000.
    UploadPart -> Int
partNumber :: Prelude.Int,
    -- | Upload ID identifying the multipart upload whose part is being uploaded.
    UploadPart -> Text
uploadId :: Prelude.Text,
    -- | Object data.
    UploadPart -> RequestBody
body :: Data.RequestBody
  }
  deriving (Int -> UploadPart -> ShowS
[UploadPart] -> ShowS
UploadPart -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UploadPart] -> ShowS
$cshowList :: [UploadPart] -> ShowS
show :: UploadPart -> String
$cshow :: UploadPart -> String
showsPrec :: Int -> UploadPart -> ShowS
$cshowsPrec :: Int -> UploadPart -> ShowS
Prelude.Show, forall x. Rep UploadPart x -> UploadPart
forall x. UploadPart -> Rep UploadPart x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UploadPart x -> UploadPart
$cfrom :: forall x. UploadPart -> Rep UploadPart x
Prelude.Generic)

-- |
-- Create a value of 'UploadPart' 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:
--
-- 'checksumAlgorithm', 'uploadPart_checksumAlgorithm' - Indicates the algorithm used to create the checksum for the object when
-- using the SDK. This header will not provide any additional functionality
-- if not using the SDK. When sending this header, there must be a
-- corresponding @x-amz-checksum@ or @x-amz-trailer@ header sent.
-- Otherwise, Amazon S3 fails the request with the HTTP status code
-- @400 Bad Request@. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
-- in the /Amazon S3 User Guide/.
--
-- If you provide an individual checksum, Amazon S3 ignores any provided
-- @ChecksumAlgorithm@ parameter.
--
-- This checksum algorithm must be the same for all parts and it match the
-- checksum value supplied in the @CreateMultipartUpload@ request.
--
-- 'checksumCRC32', 'uploadPart_checksumCRC32' - This header can be used as a data integrity check to verify that the
-- data received is the same data that was originally sent. This header
-- specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
-- in the /Amazon S3 User Guide/.
--
-- 'checksumCRC32C', 'uploadPart_checksumCRC32C' - This header can be used as a data integrity check to verify that the
-- data received is the same data that was originally sent. This header
-- specifies the base64-encoded, 32-bit CRC32C checksum of the object. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
-- in the /Amazon S3 User Guide/.
--
-- 'checksumSHA1', 'uploadPart_checksumSHA1' - This header can be used as a data integrity check to verify that the
-- data received is the same data that was originally sent. This header
-- specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
-- in the /Amazon S3 User Guide/.
--
-- 'checksumSHA256', 'uploadPart_checksumSHA256' - This header can be used as a data integrity check to verify that the
-- data received is the same data that was originally sent. This header
-- specifies the base64-encoded, 256-bit SHA-256 digest of the object. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
-- in the /Amazon S3 User Guide/.
--
-- 'contentLength', 'uploadPart_contentLength' - Size of the body in bytes. This parameter is useful when the size of the
-- body cannot be determined automatically.
--
-- 'contentMD5', 'uploadPart_contentMD5' - The base64-encoded 128-bit MD5 digest of the part data. This parameter
-- is auto-populated when using the command from the CLI. This parameter is
-- required if object lock parameters are specified.
--
-- 'expectedBucketOwner', 'uploadPart_expectedBucketOwner' - The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request fails with the HTTP status code
-- @403 Forbidden@ (access denied).
--
-- 'requestPayer', 'uploadPart_requestPayer' - Undocumented member.
--
-- 'sSECustomerAlgorithm', 'uploadPart_sSECustomerAlgorithm' - Specifies the algorithm to use to when encrypting the object (for
-- example, AES256).
--
-- 'sSECustomerKey', 'uploadPart_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.
--
-- 'sSECustomerKeyMD5', 'uploadPart_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.
--
-- 'bucket', 'uploadPart_bucket' - The name of the bucket to which the multipart upload was initiated.
--
-- 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 with 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 Amazon S3 on Outposts>
-- in the /Amazon S3 User Guide/.
--
-- 'key', 'uploadPart_key' - Object key for which the multipart upload was initiated.
--
-- 'partNumber', 'uploadPart_partNumber' - Part number of part being uploaded. This is a positive integer between 1
-- and 10,000.
--
-- 'uploadId', 'uploadPart_uploadId' - Upload ID identifying the multipart upload whose part is being uploaded.
--
-- 'body', 'uploadPart_body' - Object data.
newUploadPart ::
  -- | 'bucket'
  BucketName ->
  -- | 'key'
  ObjectKey ->
  -- | 'partNumber'
  Prelude.Int ->
  -- | 'uploadId'
  Prelude.Text ->
  -- | 'body'
  Data.RequestBody ->
  UploadPart
newUploadPart :: BucketName -> ObjectKey -> Int -> Text -> RequestBody -> UploadPart
newUploadPart
  BucketName
pBucket_
  ObjectKey
pKey_
  Int
pPartNumber_
  Text
pUploadId_
  RequestBody
pBody_ =
    UploadPart'
      { $sel:checksumAlgorithm:UploadPart' :: Maybe ChecksumAlgorithm
checksumAlgorithm = forall a. Maybe a
Prelude.Nothing,
        $sel:checksumCRC32:UploadPart' :: Maybe Text
checksumCRC32 = forall a. Maybe a
Prelude.Nothing,
        $sel:checksumCRC32C:UploadPart' :: Maybe Text
checksumCRC32C = forall a. Maybe a
Prelude.Nothing,
        $sel:checksumSHA1:UploadPart' :: Maybe Text
checksumSHA1 = forall a. Maybe a
Prelude.Nothing,
        $sel:checksumSHA256:UploadPart' :: Maybe Text
checksumSHA256 = forall a. Maybe a
Prelude.Nothing,
        $sel:contentLength:UploadPart' :: Maybe Integer
contentLength = forall a. Maybe a
Prelude.Nothing,
        $sel:contentMD5:UploadPart' :: Maybe Text
contentMD5 = forall a. Maybe a
Prelude.Nothing,
        $sel:expectedBucketOwner:UploadPart' :: Maybe Text
expectedBucketOwner = forall a. Maybe a
Prelude.Nothing,
        $sel:requestPayer:UploadPart' :: Maybe RequestPayer
requestPayer = forall a. Maybe a
Prelude.Nothing,
        $sel:sSECustomerAlgorithm:UploadPart' :: Maybe Text
sSECustomerAlgorithm = forall a. Maybe a
Prelude.Nothing,
        $sel:sSECustomerKey:UploadPart' :: Maybe (Sensitive Text)
sSECustomerKey = forall a. Maybe a
Prelude.Nothing,
        $sel:sSECustomerKeyMD5:UploadPart' :: Maybe Text
sSECustomerKeyMD5 = forall a. Maybe a
Prelude.Nothing,
        $sel:bucket:UploadPart' :: BucketName
bucket = BucketName
pBucket_,
        $sel:key:UploadPart' :: ObjectKey
key = ObjectKey
pKey_,
        $sel:partNumber:UploadPart' :: Int
partNumber = Int
pPartNumber_,
        $sel:uploadId:UploadPart' :: Text
uploadId = Text
pUploadId_,
        $sel:body:UploadPart' :: RequestBody
body = RequestBody
pBody_
      }

-- | Indicates the algorithm used to create the checksum for the object when
-- using the SDK. This header will not provide any additional functionality
-- if not using the SDK. When sending this header, there must be a
-- corresponding @x-amz-checksum@ or @x-amz-trailer@ header sent.
-- Otherwise, Amazon S3 fails the request with the HTTP status code
-- @400 Bad Request@. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
-- in the /Amazon S3 User Guide/.
--
-- If you provide an individual checksum, Amazon S3 ignores any provided
-- @ChecksumAlgorithm@ parameter.
--
-- This checksum algorithm must be the same for all parts and it match the
-- checksum value supplied in the @CreateMultipartUpload@ request.
uploadPart_checksumAlgorithm :: Lens.Lens' UploadPart (Prelude.Maybe ChecksumAlgorithm)
uploadPart_checksumAlgorithm :: Lens' UploadPart (Maybe ChecksumAlgorithm)
uploadPart_checksumAlgorithm = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPart' {Maybe ChecksumAlgorithm
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:checksumAlgorithm:UploadPart' :: UploadPart -> Maybe ChecksumAlgorithm
checksumAlgorithm} -> Maybe ChecksumAlgorithm
checksumAlgorithm) (\s :: UploadPart
s@UploadPart' {} Maybe ChecksumAlgorithm
a -> UploadPart
s {$sel:checksumAlgorithm:UploadPart' :: Maybe ChecksumAlgorithm
checksumAlgorithm = Maybe ChecksumAlgorithm
a} :: UploadPart)

-- | This header can be used as a data integrity check to verify that the
-- data received is the same data that was originally sent. This header
-- specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
-- in the /Amazon S3 User Guide/.
uploadPart_checksumCRC32 :: Lens.Lens' UploadPart (Prelude.Maybe Prelude.Text)
uploadPart_checksumCRC32 :: Lens' UploadPart (Maybe Text)
uploadPart_checksumCRC32 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPart' {Maybe Text
checksumCRC32 :: Maybe Text
$sel:checksumCRC32:UploadPart' :: UploadPart -> Maybe Text
checksumCRC32} -> Maybe Text
checksumCRC32) (\s :: UploadPart
s@UploadPart' {} Maybe Text
a -> UploadPart
s {$sel:checksumCRC32:UploadPart' :: Maybe Text
checksumCRC32 = Maybe Text
a} :: UploadPart)

-- | This header can be used as a data integrity check to verify that the
-- data received is the same data that was originally sent. This header
-- specifies the base64-encoded, 32-bit CRC32C checksum of the object. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
-- in the /Amazon S3 User Guide/.
uploadPart_checksumCRC32C :: Lens.Lens' UploadPart (Prelude.Maybe Prelude.Text)
uploadPart_checksumCRC32C :: Lens' UploadPart (Maybe Text)
uploadPart_checksumCRC32C = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPart' {Maybe Text
checksumCRC32C :: Maybe Text
$sel:checksumCRC32C:UploadPart' :: UploadPart -> Maybe Text
checksumCRC32C} -> Maybe Text
checksumCRC32C) (\s :: UploadPart
s@UploadPart' {} Maybe Text
a -> UploadPart
s {$sel:checksumCRC32C:UploadPart' :: Maybe Text
checksumCRC32C = Maybe Text
a} :: UploadPart)

-- | This header can be used as a data integrity check to verify that the
-- data received is the same data that was originally sent. This header
-- specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
-- in the /Amazon S3 User Guide/.
uploadPart_checksumSHA1 :: Lens.Lens' UploadPart (Prelude.Maybe Prelude.Text)
uploadPart_checksumSHA1 :: Lens' UploadPart (Maybe Text)
uploadPart_checksumSHA1 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPart' {Maybe Text
checksumSHA1 :: Maybe Text
$sel:checksumSHA1:UploadPart' :: UploadPart -> Maybe Text
checksumSHA1} -> Maybe Text
checksumSHA1) (\s :: UploadPart
s@UploadPart' {} Maybe Text
a -> UploadPart
s {$sel:checksumSHA1:UploadPart' :: Maybe Text
checksumSHA1 = Maybe Text
a} :: UploadPart)

-- | This header can be used as a data integrity check to verify that the
-- data received is the same data that was originally sent. This header
-- specifies the base64-encoded, 256-bit SHA-256 digest of the object. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html Checking object integrity>
-- in the /Amazon S3 User Guide/.
uploadPart_checksumSHA256 :: Lens.Lens' UploadPart (Prelude.Maybe Prelude.Text)
uploadPart_checksumSHA256 :: Lens' UploadPart (Maybe Text)
uploadPart_checksumSHA256 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPart' {Maybe Text
checksumSHA256 :: Maybe Text
$sel:checksumSHA256:UploadPart' :: UploadPart -> Maybe Text
checksumSHA256} -> Maybe Text
checksumSHA256) (\s :: UploadPart
s@UploadPart' {} Maybe Text
a -> UploadPart
s {$sel:checksumSHA256:UploadPart' :: Maybe Text
checksumSHA256 = Maybe Text
a} :: UploadPart)

-- | Size of the body in bytes. This parameter is useful when the size of the
-- body cannot be determined automatically.
uploadPart_contentLength :: Lens.Lens' UploadPart (Prelude.Maybe Prelude.Integer)
uploadPart_contentLength :: Lens' UploadPart (Maybe Integer)
uploadPart_contentLength = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPart' {Maybe Integer
contentLength :: Maybe Integer
$sel:contentLength:UploadPart' :: UploadPart -> Maybe Integer
contentLength} -> Maybe Integer
contentLength) (\s :: UploadPart
s@UploadPart' {} Maybe Integer
a -> UploadPart
s {$sel:contentLength:UploadPart' :: Maybe Integer
contentLength = Maybe Integer
a} :: UploadPart)

-- | The base64-encoded 128-bit MD5 digest of the part data. This parameter
-- is auto-populated when using the command from the CLI. This parameter is
-- required if object lock parameters are specified.
uploadPart_contentMD5 :: Lens.Lens' UploadPart (Prelude.Maybe Prelude.Text)
uploadPart_contentMD5 :: Lens' UploadPart (Maybe Text)
uploadPart_contentMD5 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPart' {Maybe Text
contentMD5 :: Maybe Text
$sel:contentMD5:UploadPart' :: UploadPart -> Maybe Text
contentMD5} -> Maybe Text
contentMD5) (\s :: UploadPart
s@UploadPart' {} Maybe Text
a -> UploadPart
s {$sel:contentMD5:UploadPart' :: Maybe Text
contentMD5 = Maybe Text
a} :: UploadPart)

-- | The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request fails with the HTTP status code
-- @403 Forbidden@ (access denied).
uploadPart_expectedBucketOwner :: Lens.Lens' UploadPart (Prelude.Maybe Prelude.Text)
uploadPart_expectedBucketOwner :: Lens' UploadPart (Maybe Text)
uploadPart_expectedBucketOwner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPart' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:UploadPart' :: UploadPart -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: UploadPart
s@UploadPart' {} Maybe Text
a -> UploadPart
s {$sel:expectedBucketOwner:UploadPart' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: UploadPart)

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

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

-- | 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.
uploadPart_sSECustomerKey :: Lens.Lens' UploadPart (Prelude.Maybe Prelude.Text)
uploadPart_sSECustomerKey :: Lens' UploadPart (Maybe Text)
uploadPart_sSECustomerKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPart' {Maybe (Sensitive Text)
sSECustomerKey :: Maybe (Sensitive Text)
$sel:sSECustomerKey:UploadPart' :: UploadPart -> Maybe (Sensitive Text)
sSECustomerKey} -> Maybe (Sensitive Text)
sSECustomerKey) (\s :: UploadPart
s@UploadPart' {} Maybe (Sensitive Text)
a -> UploadPart
s {$sel:sSECustomerKey:UploadPart' :: Maybe (Sensitive Text)
sSECustomerKey = Maybe (Sensitive Text)
a} :: UploadPart) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

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

-- | The name of the bucket to which the multipart upload was initiated.
--
-- 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 with 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 Amazon S3 on Outposts>
-- in the /Amazon S3 User Guide/.
uploadPart_bucket :: Lens.Lens' UploadPart BucketName
uploadPart_bucket :: Lens' UploadPart BucketName
uploadPart_bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPart' {BucketName
bucket :: BucketName
$sel:bucket:UploadPart' :: UploadPart -> BucketName
bucket} -> BucketName
bucket) (\s :: UploadPart
s@UploadPart' {} BucketName
a -> UploadPart
s {$sel:bucket:UploadPart' :: BucketName
bucket = BucketName
a} :: UploadPart)

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

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

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

-- | Object data.
uploadPart_body :: Lens.Lens' UploadPart Data.RequestBody
uploadPart_body :: Lens' UploadPart RequestBody
uploadPart_body = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPart' {RequestBody
body :: RequestBody
$sel:body:UploadPart' :: UploadPart -> RequestBody
body} -> RequestBody
body) (\s :: UploadPart
s@UploadPart' {} RequestBody
a -> UploadPart
s {$sel:body:UploadPart' :: RequestBody
body = RequestBody
a} :: UploadPart)

instance Core.AWSRequest UploadPart where
  type AWSResponse UploadPart = UploadPartResponse
  request :: (Service -> Service) -> UploadPart -> Request UploadPart
request Service -> Service
overrides =
    forall a. Request a -> Request a
Request.s3vhost
      forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. (ToRequest a, ToBody a) => Service -> a -> Request a
Request.putBody (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UploadPart
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UploadPart)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ETag
-> Maybe RequestCharged
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe ServerSideEncryption
-> Int
-> UploadPartResponse
UploadPartResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( ResponseHeaders
h
                            forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"x-amz-server-side-encryption-bucket-key-enabled"
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"x-amz-checksum-crc32")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"x-amz-checksum-crc32c")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"x-amz-checksum-sha1")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"x-amz-checksum-sha256")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"ETag")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"x-amz-request-charged")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( ResponseHeaders
h
                            forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"x-amz-server-side-encryption-customer-algorithm"
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( ResponseHeaders
h
                            forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"x-amz-server-side-encryption-customer-key-MD5"
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( ResponseHeaders
h
                            forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"x-amz-server-side-encryption-aws-kms-key-id"
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"x-amz-server-side-encryption")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Data.ToBody UploadPart where
  toBody :: UploadPart -> RequestBody
toBody UploadPart' {Int
Maybe Integer
Maybe Text
Maybe (Sensitive Text)
Maybe ChecksumAlgorithm
Maybe RequestPayer
Text
RequestBody
ObjectKey
BucketName
body :: RequestBody
uploadId :: Text
partNumber :: Int
key :: ObjectKey
bucket :: BucketName
sSECustomerKeyMD5 :: Maybe Text
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
requestPayer :: Maybe RequestPayer
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
contentLength :: Maybe Integer
checksumSHA256 :: Maybe Text
checksumSHA1 :: Maybe Text
checksumCRC32C :: Maybe Text
checksumCRC32 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:body:UploadPart' :: UploadPart -> RequestBody
$sel:uploadId:UploadPart' :: UploadPart -> Text
$sel:partNumber:UploadPart' :: UploadPart -> Int
$sel:key:UploadPart' :: UploadPart -> ObjectKey
$sel:bucket:UploadPart' :: UploadPart -> BucketName
$sel:sSECustomerKeyMD5:UploadPart' :: UploadPart -> Maybe Text
$sel:sSECustomerKey:UploadPart' :: UploadPart -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:UploadPart' :: UploadPart -> Maybe Text
$sel:requestPayer:UploadPart' :: UploadPart -> Maybe RequestPayer
$sel:expectedBucketOwner:UploadPart' :: UploadPart -> Maybe Text
$sel:contentMD5:UploadPart' :: UploadPart -> Maybe Text
$sel:contentLength:UploadPart' :: UploadPart -> Maybe Integer
$sel:checksumSHA256:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumSHA1:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumCRC32C:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumCRC32:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumAlgorithm:UploadPart' :: UploadPart -> Maybe ChecksumAlgorithm
..} = forall a. ToBody a => a -> RequestBody
Data.toBody RequestBody
body

instance Data.ToHeaders UploadPart where
  toHeaders :: UploadPart -> ResponseHeaders
toHeaders UploadPart' {Int
Maybe Integer
Maybe Text
Maybe (Sensitive Text)
Maybe ChecksumAlgorithm
Maybe RequestPayer
Text
RequestBody
ObjectKey
BucketName
body :: RequestBody
uploadId :: Text
partNumber :: Int
key :: ObjectKey
bucket :: BucketName
sSECustomerKeyMD5 :: Maybe Text
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
requestPayer :: Maybe RequestPayer
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
contentLength :: Maybe Integer
checksumSHA256 :: Maybe Text
checksumSHA1 :: Maybe Text
checksumCRC32C :: Maybe Text
checksumCRC32 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:body:UploadPart' :: UploadPart -> RequestBody
$sel:uploadId:UploadPart' :: UploadPart -> Text
$sel:partNumber:UploadPart' :: UploadPart -> Int
$sel:key:UploadPart' :: UploadPart -> ObjectKey
$sel:bucket:UploadPart' :: UploadPart -> BucketName
$sel:sSECustomerKeyMD5:UploadPart' :: UploadPart -> Maybe Text
$sel:sSECustomerKey:UploadPart' :: UploadPart -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:UploadPart' :: UploadPart -> Maybe Text
$sel:requestPayer:UploadPart' :: UploadPart -> Maybe RequestPayer
$sel:expectedBucketOwner:UploadPart' :: UploadPart -> Maybe Text
$sel:contentMD5:UploadPart' :: UploadPart -> Maybe Text
$sel:contentLength:UploadPart' :: UploadPart -> Maybe Integer
$sel:checksumSHA256:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumSHA1:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumCRC32C:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumCRC32:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumAlgorithm:UploadPart' :: UploadPart -> Maybe ChecksumAlgorithm
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-sdk-checksum-algorithm"
          forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe ChecksumAlgorithm
checksumAlgorithm,
        HeaderName
"x-amz-checksum-crc32" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
checksumCRC32,
        HeaderName
"x-amz-checksum-crc32c" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
checksumCRC32C,
        HeaderName
"x-amz-checksum-sha1" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
checksumSHA1,
        HeaderName
"x-amz-checksum-sha256" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
checksumSHA256,
        HeaderName
"Content-Length" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Integer
contentLength,
        HeaderName
"Content-MD5" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
contentMD5,
        HeaderName
"x-amz-expected-bucket-owner"
          forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
expectedBucketOwner,
        HeaderName
"x-amz-request-payer" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe RequestPayer
requestPayer,
        HeaderName
"x-amz-server-side-encryption-customer-algorithm"
          forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
sSECustomerAlgorithm,
        HeaderName
"x-amz-server-side-encryption-customer-key"
          forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe (Sensitive Text)
sSECustomerKey,
        HeaderName
"x-amz-server-side-encryption-customer-key-MD5"
          forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
sSECustomerKeyMD5
      ]

instance Data.ToPath UploadPart where
  toPath :: UploadPart -> ByteString
toPath UploadPart' {Int
Maybe Integer
Maybe Text
Maybe (Sensitive Text)
Maybe ChecksumAlgorithm
Maybe RequestPayer
Text
RequestBody
ObjectKey
BucketName
body :: RequestBody
uploadId :: Text
partNumber :: Int
key :: ObjectKey
bucket :: BucketName
sSECustomerKeyMD5 :: Maybe Text
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
requestPayer :: Maybe RequestPayer
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
contentLength :: Maybe Integer
checksumSHA256 :: Maybe Text
checksumSHA1 :: Maybe Text
checksumCRC32C :: Maybe Text
checksumCRC32 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:body:UploadPart' :: UploadPart -> RequestBody
$sel:uploadId:UploadPart' :: UploadPart -> Text
$sel:partNumber:UploadPart' :: UploadPart -> Int
$sel:key:UploadPart' :: UploadPart -> ObjectKey
$sel:bucket:UploadPart' :: UploadPart -> BucketName
$sel:sSECustomerKeyMD5:UploadPart' :: UploadPart -> Maybe Text
$sel:sSECustomerKey:UploadPart' :: UploadPart -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:UploadPart' :: UploadPart -> Maybe Text
$sel:requestPayer:UploadPart' :: UploadPart -> Maybe RequestPayer
$sel:expectedBucketOwner:UploadPart' :: UploadPart -> Maybe Text
$sel:contentMD5:UploadPart' :: UploadPart -> Maybe Text
$sel:contentLength:UploadPart' :: UploadPart -> Maybe Integer
$sel:checksumSHA256:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumSHA1:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumCRC32C:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumCRC32:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumAlgorithm:UploadPart' :: UploadPart -> Maybe ChecksumAlgorithm
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/", forall a. ToByteString a => a -> ByteString
Data.toBS BucketName
bucket, ByteString
"/", forall a. ToByteString a => a -> ByteString
Data.toBS ObjectKey
key]

instance Data.ToQuery UploadPart where
  toQuery :: UploadPart -> QueryString
toQuery UploadPart' {Int
Maybe Integer
Maybe Text
Maybe (Sensitive Text)
Maybe ChecksumAlgorithm
Maybe RequestPayer
Text
RequestBody
ObjectKey
BucketName
body :: RequestBody
uploadId :: Text
partNumber :: Int
key :: ObjectKey
bucket :: BucketName
sSECustomerKeyMD5 :: Maybe Text
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
requestPayer :: Maybe RequestPayer
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
contentLength :: Maybe Integer
checksumSHA256 :: Maybe Text
checksumSHA1 :: Maybe Text
checksumCRC32C :: Maybe Text
checksumCRC32 :: Maybe Text
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:body:UploadPart' :: UploadPart -> RequestBody
$sel:uploadId:UploadPart' :: UploadPart -> Text
$sel:partNumber:UploadPart' :: UploadPart -> Int
$sel:key:UploadPart' :: UploadPart -> ObjectKey
$sel:bucket:UploadPart' :: UploadPart -> BucketName
$sel:sSECustomerKeyMD5:UploadPart' :: UploadPart -> Maybe Text
$sel:sSECustomerKey:UploadPart' :: UploadPart -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:UploadPart' :: UploadPart -> Maybe Text
$sel:requestPayer:UploadPart' :: UploadPart -> Maybe RequestPayer
$sel:expectedBucketOwner:UploadPart' :: UploadPart -> Maybe Text
$sel:contentMD5:UploadPart' :: UploadPart -> Maybe Text
$sel:contentLength:UploadPart' :: UploadPart -> Maybe Integer
$sel:checksumSHA256:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumSHA1:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumCRC32C:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumCRC32:UploadPart' :: UploadPart -> Maybe Text
$sel:checksumAlgorithm:UploadPart' :: UploadPart -> Maybe ChecksumAlgorithm
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"partNumber" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Int
partNumber,
        ByteString
"uploadId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
uploadId
      ]

-- | /See:/ 'newUploadPartResponse' smart constructor.
data UploadPartResponse = UploadPartResponse'
  { -- | Indicates whether the multipart upload uses an S3 Bucket Key for
    -- server-side encryption with Amazon Web Services KMS (SSE-KMS).
    UploadPartResponse -> Maybe Bool
bucketKeyEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The base64-encoded, 32-bit CRC32 checksum of the object. This will only
    -- be present if it was uploaded with the object. With multipart uploads,
    -- this may not be a checksum value of the object. For more information
    -- about how checksums are calculated with multipart uploads, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums Checking object integrity>
    -- in the /Amazon S3 User Guide/.
    UploadPartResponse -> Maybe Text
checksumCRC32 :: Prelude.Maybe Prelude.Text,
    -- | The base64-encoded, 32-bit CRC32C checksum of the object. This will only
    -- be present if it was uploaded with the object. With multipart uploads,
    -- this may not be a checksum value of the object. For more information
    -- about how checksums are calculated with multipart uploads, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums Checking object integrity>
    -- in the /Amazon S3 User Guide/.
    UploadPartResponse -> Maybe Text
checksumCRC32C :: Prelude.Maybe Prelude.Text,
    -- | The base64-encoded, 160-bit SHA-1 digest of the object. This will only
    -- be present if it was uploaded with the object. With multipart uploads,
    -- this may not be a checksum value of the object. For more information
    -- about how checksums are calculated with multipart uploads, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums Checking object integrity>
    -- in the /Amazon S3 User Guide/.
    UploadPartResponse -> Maybe Text
checksumSHA1 :: Prelude.Maybe Prelude.Text,
    -- | The base64-encoded, 256-bit SHA-256 digest of the object. This will only
    -- be present if it was uploaded with the object. With multipart uploads,
    -- this may not be a checksum value of the object. For more information
    -- about how checksums are calculated with multipart uploads, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums Checking object integrity>
    -- in the /Amazon S3 User Guide/.
    UploadPartResponse -> Maybe Text
checksumSHA256 :: Prelude.Maybe Prelude.Text,
    -- | Entity tag for the uploaded object.
    UploadPartResponse -> Maybe ETag
eTag :: Prelude.Maybe ETag,
    UploadPartResponse -> Maybe RequestCharged
requestCharged :: Prelude.Maybe RequestCharged,
    -- | If server-side encryption with a customer-provided encryption key was
    -- requested, the response will include this header confirming the
    -- encryption algorithm used.
    UploadPartResponse -> Maybe Text
sSECustomerAlgorithm :: 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.
    UploadPartResponse -> 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 was
    -- used for the object.
    UploadPartResponse -> Maybe (Sensitive Text)
sSEKMSKeyId :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The server-side encryption algorithm used when storing this object in
    -- Amazon S3 (for example, AES256, aws:kms).
    UploadPartResponse -> Maybe ServerSideEncryption
serverSideEncryption :: Prelude.Maybe ServerSideEncryption,
    -- | The response's http status code.
    UploadPartResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UploadPartResponse -> UploadPartResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UploadPartResponse -> UploadPartResponse -> Bool
$c/= :: UploadPartResponse -> UploadPartResponse -> Bool
== :: UploadPartResponse -> UploadPartResponse -> Bool
$c== :: UploadPartResponse -> UploadPartResponse -> Bool
Prelude.Eq, Int -> UploadPartResponse -> ShowS
[UploadPartResponse] -> ShowS
UploadPartResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UploadPartResponse] -> ShowS
$cshowList :: [UploadPartResponse] -> ShowS
show :: UploadPartResponse -> String
$cshow :: UploadPartResponse -> String
showsPrec :: Int -> UploadPartResponse -> ShowS
$cshowsPrec :: Int -> UploadPartResponse -> ShowS
Prelude.Show, forall x. Rep UploadPartResponse x -> UploadPartResponse
forall x. UploadPartResponse -> Rep UploadPartResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UploadPartResponse x -> UploadPartResponse
$cfrom :: forall x. UploadPartResponse -> Rep UploadPartResponse x
Prelude.Generic)

-- |
-- Create a value of 'UploadPartResponse' 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:
--
-- 'bucketKeyEnabled', 'uploadPartResponse_bucketKeyEnabled' - Indicates whether the multipart upload uses an S3 Bucket Key for
-- server-side encryption with Amazon Web Services KMS (SSE-KMS).
--
-- 'checksumCRC32', 'uploadPartResponse_checksumCRC32' - The base64-encoded, 32-bit CRC32 checksum of the object. This will only
-- be present if it was uploaded with the object. With multipart uploads,
-- this may not be a checksum value of the object. For more information
-- about how checksums are calculated with multipart uploads, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums Checking object integrity>
-- in the /Amazon S3 User Guide/.
--
-- 'checksumCRC32C', 'uploadPartResponse_checksumCRC32C' - The base64-encoded, 32-bit CRC32C checksum of the object. This will only
-- be present if it was uploaded with the object. With multipart uploads,
-- this may not be a checksum value of the object. For more information
-- about how checksums are calculated with multipart uploads, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums Checking object integrity>
-- in the /Amazon S3 User Guide/.
--
-- 'checksumSHA1', 'uploadPartResponse_checksumSHA1' - The base64-encoded, 160-bit SHA-1 digest of the object. This will only
-- be present if it was uploaded with the object. With multipart uploads,
-- this may not be a checksum value of the object. For more information
-- about how checksums are calculated with multipart uploads, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums Checking object integrity>
-- in the /Amazon S3 User Guide/.
--
-- 'checksumSHA256', 'uploadPartResponse_checksumSHA256' - The base64-encoded, 256-bit SHA-256 digest of the object. This will only
-- be present if it was uploaded with the object. With multipart uploads,
-- this may not be a checksum value of the object. For more information
-- about how checksums are calculated with multipart uploads, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums Checking object integrity>
-- in the /Amazon S3 User Guide/.
--
-- 'eTag', 'uploadPartResponse_eTag' - Entity tag for the uploaded object.
--
-- 'requestCharged', 'uploadPartResponse_requestCharged' - Undocumented member.
--
-- 'sSECustomerAlgorithm', 'uploadPartResponse_sSECustomerAlgorithm' - If server-side encryption with a customer-provided encryption key was
-- requested, the response will include this header confirming the
-- encryption algorithm used.
--
-- 'sSECustomerKeyMD5', 'uploadPartResponse_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', 'uploadPartResponse_sSEKMSKeyId' - If present, specifies the ID of the Amazon Web Services Key Management
-- Service (Amazon Web Services KMS) symmetric customer managed key was
-- used for the object.
--
-- 'serverSideEncryption', 'uploadPartResponse_serverSideEncryption' - The server-side encryption algorithm used when storing this object in
-- Amazon S3 (for example, AES256, aws:kms).
--
-- 'httpStatus', 'uploadPartResponse_httpStatus' - The response's http status code.
newUploadPartResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UploadPartResponse
newUploadPartResponse :: Int -> UploadPartResponse
newUploadPartResponse Int
pHttpStatus_ =
  UploadPartResponse'
    { $sel:bucketKeyEnabled:UploadPartResponse' :: Maybe Bool
bucketKeyEnabled =
        forall a. Maybe a
Prelude.Nothing,
      $sel:checksumCRC32:UploadPartResponse' :: Maybe Text
checksumCRC32 = forall a. Maybe a
Prelude.Nothing,
      $sel:checksumCRC32C:UploadPartResponse' :: Maybe Text
checksumCRC32C = forall a. Maybe a
Prelude.Nothing,
      $sel:checksumSHA1:UploadPartResponse' :: Maybe Text
checksumSHA1 = forall a. Maybe a
Prelude.Nothing,
      $sel:checksumSHA256:UploadPartResponse' :: Maybe Text
checksumSHA256 = forall a. Maybe a
Prelude.Nothing,
      $sel:eTag:UploadPartResponse' :: Maybe ETag
eTag = forall a. Maybe a
Prelude.Nothing,
      $sel:requestCharged:UploadPartResponse' :: Maybe RequestCharged
requestCharged = forall a. Maybe a
Prelude.Nothing,
      $sel:sSECustomerAlgorithm:UploadPartResponse' :: Maybe Text
sSECustomerAlgorithm = forall a. Maybe a
Prelude.Nothing,
      $sel:sSECustomerKeyMD5:UploadPartResponse' :: Maybe Text
sSECustomerKeyMD5 = forall a. Maybe a
Prelude.Nothing,
      $sel:sSEKMSKeyId:UploadPartResponse' :: Maybe (Sensitive Text)
sSEKMSKeyId = forall a. Maybe a
Prelude.Nothing,
      $sel:serverSideEncryption:UploadPartResponse' :: Maybe ServerSideEncryption
serverSideEncryption = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UploadPartResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The base64-encoded, 32-bit CRC32 checksum of the object. This will only
-- be present if it was uploaded with the object. With multipart uploads,
-- this may not be a checksum value of the object. For more information
-- about how checksums are calculated with multipart uploads, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums Checking object integrity>
-- in the /Amazon S3 User Guide/.
uploadPartResponse_checksumCRC32 :: Lens.Lens' UploadPartResponse (Prelude.Maybe Prelude.Text)
uploadPartResponse_checksumCRC32 :: Lens' UploadPartResponse (Maybe Text)
uploadPartResponse_checksumCRC32 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartResponse' {Maybe Text
checksumCRC32 :: Maybe Text
$sel:checksumCRC32:UploadPartResponse' :: UploadPartResponse -> Maybe Text
checksumCRC32} -> Maybe Text
checksumCRC32) (\s :: UploadPartResponse
s@UploadPartResponse' {} Maybe Text
a -> UploadPartResponse
s {$sel:checksumCRC32:UploadPartResponse' :: Maybe Text
checksumCRC32 = Maybe Text
a} :: UploadPartResponse)

-- | The base64-encoded, 32-bit CRC32C checksum of the object. This will only
-- be present if it was uploaded with the object. With multipart uploads,
-- this may not be a checksum value of the object. For more information
-- about how checksums are calculated with multipart uploads, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums Checking object integrity>
-- in the /Amazon S3 User Guide/.
uploadPartResponse_checksumCRC32C :: Lens.Lens' UploadPartResponse (Prelude.Maybe Prelude.Text)
uploadPartResponse_checksumCRC32C :: Lens' UploadPartResponse (Maybe Text)
uploadPartResponse_checksumCRC32C = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartResponse' {Maybe Text
checksumCRC32C :: Maybe Text
$sel:checksumCRC32C:UploadPartResponse' :: UploadPartResponse -> Maybe Text
checksumCRC32C} -> Maybe Text
checksumCRC32C) (\s :: UploadPartResponse
s@UploadPartResponse' {} Maybe Text
a -> UploadPartResponse
s {$sel:checksumCRC32C:UploadPartResponse' :: Maybe Text
checksumCRC32C = Maybe Text
a} :: UploadPartResponse)

-- | The base64-encoded, 160-bit SHA-1 digest of the object. This will only
-- be present if it was uploaded with the object. With multipart uploads,
-- this may not be a checksum value of the object. For more information
-- about how checksums are calculated with multipart uploads, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums Checking object integrity>
-- in the /Amazon S3 User Guide/.
uploadPartResponse_checksumSHA1 :: Lens.Lens' UploadPartResponse (Prelude.Maybe Prelude.Text)
uploadPartResponse_checksumSHA1 :: Lens' UploadPartResponse (Maybe Text)
uploadPartResponse_checksumSHA1 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartResponse' {Maybe Text
checksumSHA1 :: Maybe Text
$sel:checksumSHA1:UploadPartResponse' :: UploadPartResponse -> Maybe Text
checksumSHA1} -> Maybe Text
checksumSHA1) (\s :: UploadPartResponse
s@UploadPartResponse' {} Maybe Text
a -> UploadPartResponse
s {$sel:checksumSHA1:UploadPartResponse' :: Maybe Text
checksumSHA1 = Maybe Text
a} :: UploadPartResponse)

-- | The base64-encoded, 256-bit SHA-256 digest of the object. This will only
-- be present if it was uploaded with the object. With multipart uploads,
-- this may not be a checksum value of the object. For more information
-- about how checksums are calculated with multipart uploads, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums Checking object integrity>
-- in the /Amazon S3 User Guide/.
uploadPartResponse_checksumSHA256 :: Lens.Lens' UploadPartResponse (Prelude.Maybe Prelude.Text)
uploadPartResponse_checksumSHA256 :: Lens' UploadPartResponse (Maybe Text)
uploadPartResponse_checksumSHA256 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartResponse' {Maybe Text
checksumSHA256 :: Maybe Text
$sel:checksumSHA256:UploadPartResponse' :: UploadPartResponse -> Maybe Text
checksumSHA256} -> Maybe Text
checksumSHA256) (\s :: UploadPartResponse
s@UploadPartResponse' {} Maybe Text
a -> UploadPartResponse
s {$sel:checksumSHA256:UploadPartResponse' :: Maybe Text
checksumSHA256 = Maybe Text
a} :: UploadPartResponse)

-- | Entity tag for the uploaded object.
uploadPartResponse_eTag :: Lens.Lens' UploadPartResponse (Prelude.Maybe ETag)
uploadPartResponse_eTag :: Lens' UploadPartResponse (Maybe ETag)
uploadPartResponse_eTag = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartResponse' {Maybe ETag
eTag :: Maybe ETag
$sel:eTag:UploadPartResponse' :: UploadPartResponse -> Maybe ETag
eTag} -> Maybe ETag
eTag) (\s :: UploadPartResponse
s@UploadPartResponse' {} Maybe ETag
a -> UploadPartResponse
s {$sel:eTag:UploadPartResponse' :: Maybe ETag
eTag = Maybe ETag
a} :: UploadPartResponse)

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

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

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

-- | If present, specifies the ID of the Amazon Web Services Key Management
-- Service (Amazon Web Services KMS) symmetric customer managed key was
-- used for the object.
uploadPartResponse_sSEKMSKeyId :: Lens.Lens' UploadPartResponse (Prelude.Maybe Prelude.Text)
uploadPartResponse_sSEKMSKeyId :: Lens' UploadPartResponse (Maybe Text)
uploadPartResponse_sSEKMSKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadPartResponse' {Maybe (Sensitive Text)
sSEKMSKeyId :: Maybe (Sensitive Text)
$sel:sSEKMSKeyId:UploadPartResponse' :: UploadPartResponse -> Maybe (Sensitive Text)
sSEKMSKeyId} -> Maybe (Sensitive Text)
sSEKMSKeyId) (\s :: UploadPartResponse
s@UploadPartResponse' {} Maybe (Sensitive Text)
a -> UploadPartResponse
s {$sel:sSEKMSKeyId:UploadPartResponse' :: Maybe (Sensitive Text)
sSEKMSKeyId = Maybe (Sensitive Text)
a} :: UploadPartResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

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

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

instance Prelude.NFData UploadPartResponse where
  rnf :: UploadPartResponse -> ()
rnf UploadPartResponse' {Int
Maybe Bool
Maybe Text
Maybe (Sensitive Text)
Maybe ETag
Maybe RequestCharged
Maybe ServerSideEncryption
httpStatus :: Int
serverSideEncryption :: Maybe ServerSideEncryption
sSEKMSKeyId :: Maybe (Sensitive Text)
sSECustomerKeyMD5 :: Maybe Text
sSECustomerAlgorithm :: Maybe Text
requestCharged :: Maybe RequestCharged
eTag :: Maybe ETag
checksumSHA256 :: Maybe Text
checksumSHA1 :: Maybe Text
checksumCRC32C :: Maybe Text
checksumCRC32 :: Maybe Text
bucketKeyEnabled :: Maybe Bool
$sel:httpStatus:UploadPartResponse' :: UploadPartResponse -> Int
$sel:serverSideEncryption:UploadPartResponse' :: UploadPartResponse -> Maybe ServerSideEncryption
$sel:sSEKMSKeyId:UploadPartResponse' :: UploadPartResponse -> Maybe (Sensitive Text)
$sel:sSECustomerKeyMD5:UploadPartResponse' :: UploadPartResponse -> Maybe Text
$sel:sSECustomerAlgorithm:UploadPartResponse' :: UploadPartResponse -> Maybe Text
$sel:requestCharged:UploadPartResponse' :: UploadPartResponse -> Maybe RequestCharged
$sel:eTag:UploadPartResponse' :: UploadPartResponse -> Maybe ETag
$sel:checksumSHA256:UploadPartResponse' :: UploadPartResponse -> Maybe Text
$sel:checksumSHA1:UploadPartResponse' :: UploadPartResponse -> Maybe Text
$sel:checksumCRC32C:UploadPartResponse' :: UploadPartResponse -> Maybe Text
$sel:checksumCRC32:UploadPartResponse' :: UploadPartResponse -> Maybe Text
$sel:bucketKeyEnabled:UploadPartResponse' :: UploadPartResponse -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
bucketKeyEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
checksumCRC32
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
checksumCRC32C
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
checksumSHA1
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
checksumSHA256
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ETag
eTag
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RequestCharged
requestCharged
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sSECustomerAlgorithm
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sSECustomerKeyMD5
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
sSEKMSKeyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ServerSideEncryption
serverSideEncryption
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus