{-# 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.CompleteMultipartUpload
-- 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)
--
-- Completes a multipart upload by assembling previously uploaded parts.
--
-- You first initiate the multipart upload and then upload all parts using
-- the
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html UploadPart>
-- operation. After successfully uploading all relevant parts of an upload,
-- you call this action to complete the upload. Upon receiving this
-- request, Amazon S3 concatenates all the parts in ascending order by part
-- number to create a new object. In the Complete Multipart Upload request,
-- you must provide the parts list. You must ensure that the parts list is
-- complete. This action concatenates the parts that you provide in the
-- list. For each part in the list, you must provide the part number and
-- the @ETag@ value, returned after that part was uploaded.
--
-- Processing of a Complete Multipart Upload request could take several
-- minutes to complete. After Amazon S3 begins processing the request, it
-- sends an HTTP response header that specifies a 200 OK response. While
-- processing is in progress, Amazon S3 periodically sends white space
-- characters to keep the connection from timing out. Because a request
-- could fail after the initial 200 OK response has been sent, it is
-- important that you check the response body to determine whether the
-- request succeeded.
--
-- Note that if @CompleteMultipartUpload@ fails, applications should be
-- prepared to retry the failed requests. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html Amazon S3 Error Best Practices>.
--
-- For more information about multipart uploads, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html Uploading Objects Using Multipart Upload>.
--
-- 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>.
--
-- @CompleteMultipartUpload@ has the following special errors:
--
-- -   Error code: @EntityTooSmall@
--
--     -   Description: Your proposed upload is smaller than the minimum
--         allowed object size. Each part must be at least 5 MB in size,
--         except the last part.
--
--     -   400 Bad Request
--
-- -   Error code: @InvalidPart@
--
--     -   Description: One or more of the specified parts could not be
--         found. The part might not have been uploaded, or the specified
--         entity tag might not have matched the part\'s entity tag.
--
--     -   400 Bad Request
--
-- -   Error code: @InvalidPartOrder@
--
--     -   Description: The list of parts was not in ascending order. The
--         parts list must be specified in order by part number.
--
--     -   400 Bad Request
--
-- -   Error code: @NoSuchUpload@
--
--     -   Description: The specified multipart upload does not exist. The
--         upload ID might be invalid, or the multipart upload might have
--         been aborted or completed.
--
--     -   404 Not Found
--
-- The following operations are related to @CompleteMultipartUpload@:
--
-- -   <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_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.CompleteMultipartUpload
  ( -- * Creating a Request
    CompleteMultipartUpload (..),
    newCompleteMultipartUpload,

    -- * Request Lenses
    completeMultipartUpload_requestPayer,
    completeMultipartUpload_multipartUpload,
    completeMultipartUpload_expectedBucketOwner,
    completeMultipartUpload_bucket,
    completeMultipartUpload_key,
    completeMultipartUpload_uploadId,

    -- * Destructuring the Response
    CompleteMultipartUploadResponse (..),
    newCompleteMultipartUploadResponse,

    -- * Response Lenses
    completeMultipartUploadResponse_requestCharged,
    completeMultipartUploadResponse_eTag,
    completeMultipartUploadResponse_versionId,
    completeMultipartUploadResponse_location,
    completeMultipartUploadResponse_expiration,
    completeMultipartUploadResponse_bucket,
    completeMultipartUploadResponse_bucketKeyEnabled,
    completeMultipartUploadResponse_key,
    completeMultipartUploadResponse_sSEKMSKeyId,
    completeMultipartUploadResponse_serverSideEncryption,
    completeMultipartUploadResponse_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:/ 'newCompleteMultipartUpload' smart constructor.
data CompleteMultipartUpload = CompleteMultipartUpload'
  { CompleteMultipartUpload -> Maybe RequestPayer
requestPayer :: Prelude.Maybe RequestPayer,
    -- | The container for the multipart upload request information.
    CompleteMultipartUpload -> Maybe CompletedMultipartUpload
multipartUpload :: Prelude.Maybe CompletedMultipartUpload,
    -- | The account ID of the expected bucket owner. If the bucket is owned by a
    -- different account, the request will fail with an HTTP
    -- @403 (Access Denied)@ error.
    CompleteMultipartUpload -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | 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 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/.
    CompleteMultipartUpload -> BucketName
bucket :: BucketName,
    -- | Object key for which the multipart upload was initiated.
    CompleteMultipartUpload -> ObjectKey
key :: ObjectKey,
    -- | ID for the initiated multipart upload.
    CompleteMultipartUpload -> Text
uploadId :: Prelude.Text
  }
  deriving (CompleteMultipartUpload -> CompleteMultipartUpload -> Bool
(CompleteMultipartUpload -> CompleteMultipartUpload -> Bool)
-> (CompleteMultipartUpload -> CompleteMultipartUpload -> Bool)
-> Eq CompleteMultipartUpload
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompleteMultipartUpload -> CompleteMultipartUpload -> Bool
$c/= :: CompleteMultipartUpload -> CompleteMultipartUpload -> Bool
== :: CompleteMultipartUpload -> CompleteMultipartUpload -> Bool
$c== :: CompleteMultipartUpload -> CompleteMultipartUpload -> Bool
Prelude.Eq, ReadPrec [CompleteMultipartUpload]
ReadPrec CompleteMultipartUpload
Int -> ReadS CompleteMultipartUpload
ReadS [CompleteMultipartUpload]
(Int -> ReadS CompleteMultipartUpload)
-> ReadS [CompleteMultipartUpload]
-> ReadPrec CompleteMultipartUpload
-> ReadPrec [CompleteMultipartUpload]
-> Read CompleteMultipartUpload
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CompleteMultipartUpload]
$creadListPrec :: ReadPrec [CompleteMultipartUpload]
readPrec :: ReadPrec CompleteMultipartUpload
$creadPrec :: ReadPrec CompleteMultipartUpload
readList :: ReadS [CompleteMultipartUpload]
$creadList :: ReadS [CompleteMultipartUpload]
readsPrec :: Int -> ReadS CompleteMultipartUpload
$creadsPrec :: Int -> ReadS CompleteMultipartUpload
Prelude.Read, Int -> CompleteMultipartUpload -> ShowS
[CompleteMultipartUpload] -> ShowS
CompleteMultipartUpload -> String
(Int -> CompleteMultipartUpload -> ShowS)
-> (CompleteMultipartUpload -> String)
-> ([CompleteMultipartUpload] -> ShowS)
-> Show CompleteMultipartUpload
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompleteMultipartUpload] -> ShowS
$cshowList :: [CompleteMultipartUpload] -> ShowS
show :: CompleteMultipartUpload -> String
$cshow :: CompleteMultipartUpload -> String
showsPrec :: Int -> CompleteMultipartUpload -> ShowS
$cshowsPrec :: Int -> CompleteMultipartUpload -> ShowS
Prelude.Show, (forall x.
 CompleteMultipartUpload -> Rep CompleteMultipartUpload x)
-> (forall x.
    Rep CompleteMultipartUpload x -> CompleteMultipartUpload)
-> Generic CompleteMultipartUpload
forall x. Rep CompleteMultipartUpload x -> CompleteMultipartUpload
forall x. CompleteMultipartUpload -> Rep CompleteMultipartUpload x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CompleteMultipartUpload x -> CompleteMultipartUpload
$cfrom :: forall x. CompleteMultipartUpload -> Rep CompleteMultipartUpload x
Prelude.Generic)

-- |
-- Create a value of 'CompleteMultipartUpload' 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:
--
-- 'requestPayer', 'completeMultipartUpload_requestPayer' - Undocumented member.
--
-- 'multipartUpload', 'completeMultipartUpload_multipartUpload' - The container for the multipart upload request information.
--
-- 'expectedBucketOwner', 'completeMultipartUpload_expectedBucketOwner' - The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
--
-- 'bucket', 'completeMultipartUpload_bucket' - 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 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/.
--
-- 'key', 'completeMultipartUpload_key' - Object key for which the multipart upload was initiated.
--
-- 'uploadId', 'completeMultipartUpload_uploadId' - ID for the initiated multipart upload.
newCompleteMultipartUpload ::
  -- | 'bucket'
  BucketName ->
  -- | 'key'
  ObjectKey ->
  -- | 'uploadId'
  Prelude.Text ->
  CompleteMultipartUpload
newCompleteMultipartUpload :: BucketName -> ObjectKey -> Text -> CompleteMultipartUpload
newCompleteMultipartUpload BucketName
pBucket_ ObjectKey
pKey_ Text
pUploadId_ =
  CompleteMultipartUpload' :: Maybe RequestPayer
-> Maybe CompletedMultipartUpload
-> Maybe Text
-> BucketName
-> ObjectKey
-> Text
-> CompleteMultipartUpload
CompleteMultipartUpload'
    { $sel:requestPayer:CompleteMultipartUpload' :: Maybe RequestPayer
requestPayer =
        Maybe RequestPayer
forall a. Maybe a
Prelude.Nothing,
      $sel:multipartUpload:CompleteMultipartUpload' :: Maybe CompletedMultipartUpload
multipartUpload = Maybe CompletedMultipartUpload
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:CompleteMultipartUpload' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:CompleteMultipartUpload' :: BucketName
bucket = BucketName
pBucket_,
      $sel:key:CompleteMultipartUpload' :: ObjectKey
key = ObjectKey
pKey_,
      $sel:uploadId:CompleteMultipartUpload' :: Text
uploadId = Text
pUploadId_
    }

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

-- | The container for the multipart upload request information.
completeMultipartUpload_multipartUpload :: Lens.Lens' CompleteMultipartUpload (Prelude.Maybe CompletedMultipartUpload)
completeMultipartUpload_multipartUpload :: (Maybe CompletedMultipartUpload
 -> f (Maybe CompletedMultipartUpload))
-> CompleteMultipartUpload -> f CompleteMultipartUpload
completeMultipartUpload_multipartUpload = (CompleteMultipartUpload -> Maybe CompletedMultipartUpload)
-> (CompleteMultipartUpload
    -> Maybe CompletedMultipartUpload -> CompleteMultipartUpload)
-> Lens
     CompleteMultipartUpload
     CompleteMultipartUpload
     (Maybe CompletedMultipartUpload)
     (Maybe CompletedMultipartUpload)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteMultipartUpload' {Maybe CompletedMultipartUpload
multipartUpload :: Maybe CompletedMultipartUpload
$sel:multipartUpload:CompleteMultipartUpload' :: CompleteMultipartUpload -> Maybe CompletedMultipartUpload
multipartUpload} -> Maybe CompletedMultipartUpload
multipartUpload) (\s :: CompleteMultipartUpload
s@CompleteMultipartUpload' {} Maybe CompletedMultipartUpload
a -> CompleteMultipartUpload
s {$sel:multipartUpload:CompleteMultipartUpload' :: Maybe CompletedMultipartUpload
multipartUpload = Maybe CompletedMultipartUpload
a} :: CompleteMultipartUpload)

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

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

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

-- | ID for the initiated multipart upload.
completeMultipartUpload_uploadId :: Lens.Lens' CompleteMultipartUpload Prelude.Text
completeMultipartUpload_uploadId :: (Text -> f Text)
-> CompleteMultipartUpload -> f CompleteMultipartUpload
completeMultipartUpload_uploadId = (CompleteMultipartUpload -> Text)
-> (CompleteMultipartUpload -> Text -> CompleteMultipartUpload)
-> Lens CompleteMultipartUpload CompleteMultipartUpload Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteMultipartUpload' {Text
uploadId :: Text
$sel:uploadId:CompleteMultipartUpload' :: CompleteMultipartUpload -> Text
uploadId} -> Text
uploadId) (\s :: CompleteMultipartUpload
s@CompleteMultipartUpload' {} Text
a -> CompleteMultipartUpload
s {$sel:uploadId:CompleteMultipartUpload' :: Text
uploadId = Text
a} :: CompleteMultipartUpload)

instance Core.AWSRequest CompleteMultipartUpload where
  type
    AWSResponse CompleteMultipartUpload =
      CompleteMultipartUploadResponse
  request :: CompleteMultipartUpload -> Request CompleteMultipartUpload
request =
    Request CompleteMultipartUpload -> Request CompleteMultipartUpload
forall a. Request a -> Request a
Request.s3vhost
      (Request CompleteMultipartUpload
 -> Request CompleteMultipartUpload)
-> (CompleteMultipartUpload -> Request CompleteMultipartUpload)
-> CompleteMultipartUpload
-> Request CompleteMultipartUpload
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service
-> CompleteMultipartUpload -> Request CompleteMultipartUpload
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.postXML Service
defaultService
  response :: Logger
-> Service
-> Proxy CompleteMultipartUpload
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CompleteMultipartUpload)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse CompleteMultipartUpload))
-> Logger
-> Service
-> Proxy CompleteMultipartUpload
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CompleteMultipartUpload)))
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 ETag
-> Maybe ObjectVersionId
-> Maybe Text
-> Maybe Text
-> Maybe BucketName
-> Maybe Bool
-> Maybe ObjectKey
-> Maybe (Sensitive Text)
-> Maybe ServerSideEncryption
-> Int
-> CompleteMultipartUploadResponse
CompleteMultipartUploadResponse'
            (Maybe RequestCharged
 -> Maybe ETag
 -> Maybe ObjectVersionId
 -> Maybe Text
 -> Maybe Text
 -> Maybe BucketName
 -> Maybe Bool
 -> Maybe ObjectKey
 -> Maybe (Sensitive Text)
 -> Maybe ServerSideEncryption
 -> Int
 -> CompleteMultipartUploadResponse)
-> Either String (Maybe RequestCharged)
-> Either
     String
     (Maybe ETag
      -> Maybe ObjectVersionId
      -> Maybe Text
      -> Maybe Text
      -> Maybe BucketName
      -> Maybe Bool
      -> Maybe ObjectKey
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> CompleteMultipartUploadResponse)
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 ETag
   -> Maybe ObjectVersionId
   -> Maybe Text
   -> Maybe Text
   -> Maybe BucketName
   -> Maybe Bool
   -> Maybe ObjectKey
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> CompleteMultipartUploadResponse)
-> Either String (Maybe ETag)
-> Either
     String
     (Maybe ObjectVersionId
      -> Maybe Text
      -> Maybe Text
      -> Maybe BucketName
      -> Maybe Bool
      -> Maybe ObjectKey
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> CompleteMultipartUploadResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ETag)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ETag")
            Either
  String
  (Maybe ObjectVersionId
   -> Maybe Text
   -> Maybe Text
   -> Maybe BucketName
   -> Maybe Bool
   -> Maybe ObjectKey
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> CompleteMultipartUploadResponse)
-> Either String (Maybe ObjectVersionId)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe BucketName
      -> Maybe Bool
      -> Maybe ObjectKey
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> CompleteMultipartUploadResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe ObjectVersionId)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-version-id")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe BucketName
   -> Maybe Bool
   -> Maybe ObjectKey
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> CompleteMultipartUploadResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe BucketName
      -> Maybe Bool
      -> Maybe ObjectKey
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> CompleteMultipartUploadResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Location")
            Either
  String
  (Maybe Text
   -> Maybe BucketName
   -> Maybe Bool
   -> Maybe ObjectKey
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> CompleteMultipartUploadResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe BucketName
      -> Maybe Bool
      -> Maybe ObjectKey
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> CompleteMultipartUploadResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-expiration")
            Either
  String
  (Maybe BucketName
   -> Maybe Bool
   -> Maybe ObjectKey
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> CompleteMultipartUploadResponse)
-> Either String (Maybe BucketName)
-> Either
     String
     (Maybe Bool
      -> Maybe ObjectKey
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> CompleteMultipartUploadResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe BucketName)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Bucket")
            Either
  String
  (Maybe Bool
   -> Maybe ObjectKey
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> CompleteMultipartUploadResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe ObjectKey
      -> Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> CompleteMultipartUploadResponse)
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 ObjectKey
   -> Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> CompleteMultipartUploadResponse)
-> Either String (Maybe ObjectKey)
-> Either
     String
     (Maybe (Sensitive Text)
      -> Maybe ServerSideEncryption
      -> Int
      -> CompleteMultipartUploadResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ObjectKey)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Key")
            Either
  String
  (Maybe (Sensitive Text)
   -> Maybe ServerSideEncryption
   -> Int
   -> CompleteMultipartUploadResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String
     (Maybe ServerSideEncryption
      -> Int -> CompleteMultipartUploadResponse)
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 -> CompleteMultipartUploadResponse)
-> Either String (Maybe ServerSideEncryption)
-> Either String (Int -> CompleteMultipartUploadResponse)
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 -> CompleteMultipartUploadResponse)
-> Either String Int
-> Either String CompleteMultipartUploadResponse
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 CompleteMultipartUpload

instance Prelude.NFData CompleteMultipartUpload

instance Core.ToElement CompleteMultipartUpload where
  toElement :: CompleteMultipartUpload -> Element
toElement CompleteMultipartUpload' {Maybe Text
Maybe CompletedMultipartUpload
Maybe RequestPayer
Text
ObjectKey
BucketName
uploadId :: Text
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
multipartUpload :: Maybe CompletedMultipartUpload
requestPayer :: Maybe RequestPayer
$sel:uploadId:CompleteMultipartUpload' :: CompleteMultipartUpload -> Text
$sel:key:CompleteMultipartUpload' :: CompleteMultipartUpload -> ObjectKey
$sel:bucket:CompleteMultipartUpload' :: CompleteMultipartUpload -> BucketName
$sel:expectedBucketOwner:CompleteMultipartUpload' :: CompleteMultipartUpload -> Maybe Text
$sel:multipartUpload:CompleteMultipartUpload' :: CompleteMultipartUpload -> Maybe CompletedMultipartUpload
$sel:requestPayer:CompleteMultipartUpload' :: CompleteMultipartUpload -> Maybe RequestPayer
..} =
    Name -> Maybe CompletedMultipartUpload -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
      Name
"{http://s3.amazonaws.com/doc/2006-03-01/}CompleteMultipartUpload"
      Maybe CompletedMultipartUpload
multipartUpload

instance Core.ToHeaders CompleteMultipartUpload where
  toHeaders :: CompleteMultipartUpload -> ResponseHeaders
toHeaders CompleteMultipartUpload' {Maybe Text
Maybe CompletedMultipartUpload
Maybe RequestPayer
Text
ObjectKey
BucketName
uploadId :: Text
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
multipartUpload :: Maybe CompletedMultipartUpload
requestPayer :: Maybe RequestPayer
$sel:uploadId:CompleteMultipartUpload' :: CompleteMultipartUpload -> Text
$sel:key:CompleteMultipartUpload' :: CompleteMultipartUpload -> ObjectKey
$sel:bucket:CompleteMultipartUpload' :: CompleteMultipartUpload -> BucketName
$sel:expectedBucketOwner:CompleteMultipartUpload' :: CompleteMultipartUpload -> Maybe Text
$sel:multipartUpload:CompleteMultipartUpload' :: CompleteMultipartUpload -> Maybe CompletedMultipartUpload
$sel:requestPayer:CompleteMultipartUpload' :: CompleteMultipartUpload -> Maybe RequestPayer
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-request-payer" HeaderName -> Maybe RequestPayer -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe RequestPayer
requestPayer,
        HeaderName
"x-amz-expected-bucket-owner"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
expectedBucketOwner
      ]

instance Core.ToPath CompleteMultipartUpload where
  toPath :: CompleteMultipartUpload -> ByteString
toPath CompleteMultipartUpload' {Maybe Text
Maybe CompletedMultipartUpload
Maybe RequestPayer
Text
ObjectKey
BucketName
uploadId :: Text
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
multipartUpload :: Maybe CompletedMultipartUpload
requestPayer :: Maybe RequestPayer
$sel:uploadId:CompleteMultipartUpload' :: CompleteMultipartUpload -> Text
$sel:key:CompleteMultipartUpload' :: CompleteMultipartUpload -> ObjectKey
$sel:bucket:CompleteMultipartUpload' :: CompleteMultipartUpload -> BucketName
$sel:expectedBucketOwner:CompleteMultipartUpload' :: CompleteMultipartUpload -> Maybe Text
$sel:multipartUpload:CompleteMultipartUpload' :: CompleteMultipartUpload -> Maybe CompletedMultipartUpload
$sel:requestPayer:CompleteMultipartUpload' :: CompleteMultipartUpload -> Maybe RequestPayer
..} =
    [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 CompleteMultipartUpload where
  toQuery :: CompleteMultipartUpload -> QueryString
toQuery CompleteMultipartUpload' {Maybe Text
Maybe CompletedMultipartUpload
Maybe RequestPayer
Text
ObjectKey
BucketName
uploadId :: Text
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
multipartUpload :: Maybe CompletedMultipartUpload
requestPayer :: Maybe RequestPayer
$sel:uploadId:CompleteMultipartUpload' :: CompleteMultipartUpload -> Text
$sel:key:CompleteMultipartUpload' :: CompleteMultipartUpload -> ObjectKey
$sel:bucket:CompleteMultipartUpload' :: CompleteMultipartUpload -> BucketName
$sel:expectedBucketOwner:CompleteMultipartUpload' :: CompleteMultipartUpload -> Maybe Text
$sel:multipartUpload:CompleteMultipartUpload' :: CompleteMultipartUpload -> Maybe CompletedMultipartUpload
$sel:requestPayer:CompleteMultipartUpload' :: CompleteMultipartUpload -> Maybe RequestPayer
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"uploadId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
uploadId]

-- | /See:/ 'newCompleteMultipartUploadResponse' smart constructor.
data CompleteMultipartUploadResponse = CompleteMultipartUploadResponse'
  { CompleteMultipartUploadResponse -> Maybe RequestCharged
requestCharged :: Prelude.Maybe RequestCharged,
    -- | Entity tag that identifies the newly created object\'s data. Objects
    -- with different object data will have different entity tags. The entity
    -- tag is an opaque string. The entity tag may or may not be an MD5 digest
    -- of the object data. If the entity tag is not an MD5 digest of the object
    -- data, it will contain one or more nonhexadecimal characters and\/or will
    -- consist of less than 32 or more than 32 hexadecimal digits.
    CompleteMultipartUploadResponse -> Maybe ETag
eTag :: Prelude.Maybe ETag,
    -- | Version ID of the newly created object, in case the bucket has
    -- versioning turned on.
    CompleteMultipartUploadResponse -> Maybe ObjectVersionId
versionId :: Prelude.Maybe ObjectVersionId,
    -- | The URI that identifies the newly created object.
    CompleteMultipartUploadResponse -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | If the object expiration is configured, this will contain the expiration
    -- date (expiry-date) and rule ID (rule-id). The value of rule-id is URL
    -- encoded.
    CompleteMultipartUploadResponse -> Maybe Text
expiration :: Prelude.Maybe Prelude.Text,
    -- | The name of the bucket that contains the newly created object. Does not
    -- return the access point ARN or access point alias if used.
    --
    -- 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/.
    CompleteMultipartUploadResponse -> Maybe BucketName
bucket :: Prelude.Maybe BucketName,
    -- | Indicates whether the multipart upload uses an S3 Bucket Key for
    -- server-side encryption with Amazon Web Services KMS (SSE-KMS).
    CompleteMultipartUploadResponse -> Maybe Bool
bucketKeyEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The object key of the newly created object.
    CompleteMultipartUploadResponse -> Maybe ObjectKey
key :: Prelude.Maybe ObjectKey,
    -- | 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.
    CompleteMultipartUploadResponse -> Maybe (Sensitive Text)
sSEKMSKeyId :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | If you specified server-side encryption either with an Amazon S3-managed
    -- encryption key or an Amazon Web Services KMS key in your initiate
    -- multipart upload request, the response includes this header. It confirms
    -- the encryption algorithm that Amazon S3 used to encrypt the object.
    CompleteMultipartUploadResponse -> Maybe ServerSideEncryption
serverSideEncryption :: Prelude.Maybe ServerSideEncryption,
    -- | The response's http status code.
    CompleteMultipartUploadResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CompleteMultipartUploadResponse
-> CompleteMultipartUploadResponse -> Bool
(CompleteMultipartUploadResponse
 -> CompleteMultipartUploadResponse -> Bool)
-> (CompleteMultipartUploadResponse
    -> CompleteMultipartUploadResponse -> Bool)
-> Eq CompleteMultipartUploadResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompleteMultipartUploadResponse
-> CompleteMultipartUploadResponse -> Bool
$c/= :: CompleteMultipartUploadResponse
-> CompleteMultipartUploadResponse -> Bool
== :: CompleteMultipartUploadResponse
-> CompleteMultipartUploadResponse -> Bool
$c== :: CompleteMultipartUploadResponse
-> CompleteMultipartUploadResponse -> Bool
Prelude.Eq, Int -> CompleteMultipartUploadResponse -> ShowS
[CompleteMultipartUploadResponse] -> ShowS
CompleteMultipartUploadResponse -> String
(Int -> CompleteMultipartUploadResponse -> ShowS)
-> (CompleteMultipartUploadResponse -> String)
-> ([CompleteMultipartUploadResponse] -> ShowS)
-> Show CompleteMultipartUploadResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompleteMultipartUploadResponse] -> ShowS
$cshowList :: [CompleteMultipartUploadResponse] -> ShowS
show :: CompleteMultipartUploadResponse -> String
$cshow :: CompleteMultipartUploadResponse -> String
showsPrec :: Int -> CompleteMultipartUploadResponse -> ShowS
$cshowsPrec :: Int -> CompleteMultipartUploadResponse -> ShowS
Prelude.Show, (forall x.
 CompleteMultipartUploadResponse
 -> Rep CompleteMultipartUploadResponse x)
-> (forall x.
    Rep CompleteMultipartUploadResponse x
    -> CompleteMultipartUploadResponse)
-> Generic CompleteMultipartUploadResponse
forall x.
Rep CompleteMultipartUploadResponse x
-> CompleteMultipartUploadResponse
forall x.
CompleteMultipartUploadResponse
-> Rep CompleteMultipartUploadResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CompleteMultipartUploadResponse x
-> CompleteMultipartUploadResponse
$cfrom :: forall x.
CompleteMultipartUploadResponse
-> Rep CompleteMultipartUploadResponse x
Prelude.Generic)

-- |
-- Create a value of 'CompleteMultipartUploadResponse' 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', 'completeMultipartUploadResponse_requestCharged' - Undocumented member.
--
-- 'eTag', 'completeMultipartUploadResponse_eTag' - Entity tag that identifies the newly created object\'s data. Objects
-- with different object data will have different entity tags. The entity
-- tag is an opaque string. The entity tag may or may not be an MD5 digest
-- of the object data. If the entity tag is not an MD5 digest of the object
-- data, it will contain one or more nonhexadecimal characters and\/or will
-- consist of less than 32 or more than 32 hexadecimal digits.
--
-- 'versionId', 'completeMultipartUploadResponse_versionId' - Version ID of the newly created object, in case the bucket has
-- versioning turned on.
--
-- 'location', 'completeMultipartUploadResponse_location' - The URI that identifies the newly created object.
--
-- 'expiration', 'completeMultipartUploadResponse_expiration' - If the object expiration is configured, this will contain the expiration
-- date (expiry-date) and rule ID (rule-id). The value of rule-id is URL
-- encoded.
--
-- 'bucket', 'completeMultipartUploadResponse_bucket' - The name of the bucket that contains the newly created object. Does not
-- return the access point ARN or access point alias if used.
--
-- 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/.
--
-- 'bucketKeyEnabled', 'completeMultipartUploadResponse_bucketKeyEnabled' - Indicates whether the multipart upload uses an S3 Bucket Key for
-- server-side encryption with Amazon Web Services KMS (SSE-KMS).
--
-- 'key', 'completeMultipartUploadResponse_key' - The object key of the newly created object.
--
-- 'sSEKMSKeyId', 'completeMultipartUploadResponse_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', 'completeMultipartUploadResponse_serverSideEncryption' - If you specified server-side encryption either with an Amazon S3-managed
-- encryption key or an Amazon Web Services KMS key in your initiate
-- multipart upload request, the response includes this header. It confirms
-- the encryption algorithm that Amazon S3 used to encrypt the object.
--
-- 'httpStatus', 'completeMultipartUploadResponse_httpStatus' - The response's http status code.
newCompleteMultipartUploadResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CompleteMultipartUploadResponse
newCompleteMultipartUploadResponse :: Int -> CompleteMultipartUploadResponse
newCompleteMultipartUploadResponse Int
pHttpStatus_ =
  CompleteMultipartUploadResponse' :: Maybe RequestCharged
-> Maybe ETag
-> Maybe ObjectVersionId
-> Maybe Text
-> Maybe Text
-> Maybe BucketName
-> Maybe Bool
-> Maybe ObjectKey
-> Maybe (Sensitive Text)
-> Maybe ServerSideEncryption
-> Int
-> CompleteMultipartUploadResponse
CompleteMultipartUploadResponse'
    { $sel:requestCharged:CompleteMultipartUploadResponse' :: Maybe RequestCharged
requestCharged =
        Maybe RequestCharged
forall a. Maybe a
Prelude.Nothing,
      $sel:eTag:CompleteMultipartUploadResponse' :: Maybe ETag
eTag = Maybe ETag
forall a. Maybe a
Prelude.Nothing,
      $sel:versionId:CompleteMultipartUploadResponse' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
forall a. Maybe a
Prelude.Nothing,
      $sel:location:CompleteMultipartUploadResponse' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:expiration:CompleteMultipartUploadResponse' :: Maybe Text
expiration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:CompleteMultipartUploadResponse' :: Maybe BucketName
bucket = Maybe BucketName
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketKeyEnabled:CompleteMultipartUploadResponse' :: Maybe Bool
bucketKeyEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:key:CompleteMultipartUploadResponse' :: Maybe ObjectKey
key = Maybe ObjectKey
forall a. Maybe a
Prelude.Nothing,
      $sel:sSEKMSKeyId:CompleteMultipartUploadResponse' :: Maybe (Sensitive Text)
sSEKMSKeyId = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:serverSideEncryption:CompleteMultipartUploadResponse' :: Maybe ServerSideEncryption
serverSideEncryption = Maybe ServerSideEncryption
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CompleteMultipartUploadResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | Entity tag that identifies the newly created object\'s data. Objects
-- with different object data will have different entity tags. The entity
-- tag is an opaque string. The entity tag may or may not be an MD5 digest
-- of the object data. If the entity tag is not an MD5 digest of the object
-- data, it will contain one or more nonhexadecimal characters and\/or will
-- consist of less than 32 or more than 32 hexadecimal digits.
completeMultipartUploadResponse_eTag :: Lens.Lens' CompleteMultipartUploadResponse (Prelude.Maybe ETag)
completeMultipartUploadResponse_eTag :: (Maybe ETag -> f (Maybe ETag))
-> CompleteMultipartUploadResponse
-> f CompleteMultipartUploadResponse
completeMultipartUploadResponse_eTag = (CompleteMultipartUploadResponse -> Maybe ETag)
-> (CompleteMultipartUploadResponse
    -> Maybe ETag -> CompleteMultipartUploadResponse)
-> Lens
     CompleteMultipartUploadResponse
     CompleteMultipartUploadResponse
     (Maybe ETag)
     (Maybe ETag)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteMultipartUploadResponse' {Maybe ETag
eTag :: Maybe ETag
$sel:eTag:CompleteMultipartUploadResponse' :: CompleteMultipartUploadResponse -> Maybe ETag
eTag} -> Maybe ETag
eTag) (\s :: CompleteMultipartUploadResponse
s@CompleteMultipartUploadResponse' {} Maybe ETag
a -> CompleteMultipartUploadResponse
s {$sel:eTag:CompleteMultipartUploadResponse' :: Maybe ETag
eTag = Maybe ETag
a} :: CompleteMultipartUploadResponse)

-- | Version ID of the newly created object, in case the bucket has
-- versioning turned on.
completeMultipartUploadResponse_versionId :: Lens.Lens' CompleteMultipartUploadResponse (Prelude.Maybe ObjectVersionId)
completeMultipartUploadResponse_versionId :: (Maybe ObjectVersionId -> f (Maybe ObjectVersionId))
-> CompleteMultipartUploadResponse
-> f CompleteMultipartUploadResponse
completeMultipartUploadResponse_versionId = (CompleteMultipartUploadResponse -> Maybe ObjectVersionId)
-> (CompleteMultipartUploadResponse
    -> Maybe ObjectVersionId -> CompleteMultipartUploadResponse)
-> Lens
     CompleteMultipartUploadResponse
     CompleteMultipartUploadResponse
     (Maybe ObjectVersionId)
     (Maybe ObjectVersionId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteMultipartUploadResponse' {Maybe ObjectVersionId
versionId :: Maybe ObjectVersionId
$sel:versionId:CompleteMultipartUploadResponse' :: CompleteMultipartUploadResponse -> Maybe ObjectVersionId
versionId} -> Maybe ObjectVersionId
versionId) (\s :: CompleteMultipartUploadResponse
s@CompleteMultipartUploadResponse' {} Maybe ObjectVersionId
a -> CompleteMultipartUploadResponse
s {$sel:versionId:CompleteMultipartUploadResponse' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
a} :: CompleteMultipartUploadResponse)

-- | The URI that identifies the newly created object.
completeMultipartUploadResponse_location :: Lens.Lens' CompleteMultipartUploadResponse (Prelude.Maybe Prelude.Text)
completeMultipartUploadResponse_location :: (Maybe Text -> f (Maybe Text))
-> CompleteMultipartUploadResponse
-> f CompleteMultipartUploadResponse
completeMultipartUploadResponse_location = (CompleteMultipartUploadResponse -> Maybe Text)
-> (CompleteMultipartUploadResponse
    -> Maybe Text -> CompleteMultipartUploadResponse)
-> Lens
     CompleteMultipartUploadResponse
     CompleteMultipartUploadResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteMultipartUploadResponse' {Maybe Text
location :: Maybe Text
$sel:location:CompleteMultipartUploadResponse' :: CompleteMultipartUploadResponse -> Maybe Text
location} -> Maybe Text
location) (\s :: CompleteMultipartUploadResponse
s@CompleteMultipartUploadResponse' {} Maybe Text
a -> CompleteMultipartUploadResponse
s {$sel:location:CompleteMultipartUploadResponse' :: Maybe Text
location = Maybe Text
a} :: CompleteMultipartUploadResponse)

-- | If the object expiration is configured, this will contain the expiration
-- date (expiry-date) and rule ID (rule-id). The value of rule-id is URL
-- encoded.
completeMultipartUploadResponse_expiration :: Lens.Lens' CompleteMultipartUploadResponse (Prelude.Maybe Prelude.Text)
completeMultipartUploadResponse_expiration :: (Maybe Text -> f (Maybe Text))
-> CompleteMultipartUploadResponse
-> f CompleteMultipartUploadResponse
completeMultipartUploadResponse_expiration = (CompleteMultipartUploadResponse -> Maybe Text)
-> (CompleteMultipartUploadResponse
    -> Maybe Text -> CompleteMultipartUploadResponse)
-> Lens
     CompleteMultipartUploadResponse
     CompleteMultipartUploadResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteMultipartUploadResponse' {Maybe Text
expiration :: Maybe Text
$sel:expiration:CompleteMultipartUploadResponse' :: CompleteMultipartUploadResponse -> Maybe Text
expiration} -> Maybe Text
expiration) (\s :: CompleteMultipartUploadResponse
s@CompleteMultipartUploadResponse' {} Maybe Text
a -> CompleteMultipartUploadResponse
s {$sel:expiration:CompleteMultipartUploadResponse' :: Maybe Text
expiration = Maybe Text
a} :: CompleteMultipartUploadResponse)

-- | The name of the bucket that contains the newly created object. Does not
-- return the access point ARN or access point alias if used.
--
-- 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/.
completeMultipartUploadResponse_bucket :: Lens.Lens' CompleteMultipartUploadResponse (Prelude.Maybe BucketName)
completeMultipartUploadResponse_bucket :: (Maybe BucketName -> f (Maybe BucketName))
-> CompleteMultipartUploadResponse
-> f CompleteMultipartUploadResponse
completeMultipartUploadResponse_bucket = (CompleteMultipartUploadResponse -> Maybe BucketName)
-> (CompleteMultipartUploadResponse
    -> Maybe BucketName -> CompleteMultipartUploadResponse)
-> Lens
     CompleteMultipartUploadResponse
     CompleteMultipartUploadResponse
     (Maybe BucketName)
     (Maybe BucketName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteMultipartUploadResponse' {Maybe BucketName
bucket :: Maybe BucketName
$sel:bucket:CompleteMultipartUploadResponse' :: CompleteMultipartUploadResponse -> Maybe BucketName
bucket} -> Maybe BucketName
bucket) (\s :: CompleteMultipartUploadResponse
s@CompleteMultipartUploadResponse' {} Maybe BucketName
a -> CompleteMultipartUploadResponse
s {$sel:bucket:CompleteMultipartUploadResponse' :: Maybe BucketName
bucket = Maybe BucketName
a} :: CompleteMultipartUploadResponse)

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

-- | The object key of the newly created object.
completeMultipartUploadResponse_key :: Lens.Lens' CompleteMultipartUploadResponse (Prelude.Maybe ObjectKey)
completeMultipartUploadResponse_key :: (Maybe ObjectKey -> f (Maybe ObjectKey))
-> CompleteMultipartUploadResponse
-> f CompleteMultipartUploadResponse
completeMultipartUploadResponse_key = (CompleteMultipartUploadResponse -> Maybe ObjectKey)
-> (CompleteMultipartUploadResponse
    -> Maybe ObjectKey -> CompleteMultipartUploadResponse)
-> Lens
     CompleteMultipartUploadResponse
     CompleteMultipartUploadResponse
     (Maybe ObjectKey)
     (Maybe ObjectKey)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteMultipartUploadResponse' {Maybe ObjectKey
key :: Maybe ObjectKey
$sel:key:CompleteMultipartUploadResponse' :: CompleteMultipartUploadResponse -> Maybe ObjectKey
key} -> Maybe ObjectKey
key) (\s :: CompleteMultipartUploadResponse
s@CompleteMultipartUploadResponse' {} Maybe ObjectKey
a -> CompleteMultipartUploadResponse
s {$sel:key:CompleteMultipartUploadResponse' :: Maybe ObjectKey
key = Maybe ObjectKey
a} :: CompleteMultipartUploadResponse)

-- | 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.
completeMultipartUploadResponse_sSEKMSKeyId :: Lens.Lens' CompleteMultipartUploadResponse (Prelude.Maybe Prelude.Text)
completeMultipartUploadResponse_sSEKMSKeyId :: (Maybe Text -> f (Maybe Text))
-> CompleteMultipartUploadResponse
-> f CompleteMultipartUploadResponse
completeMultipartUploadResponse_sSEKMSKeyId = (CompleteMultipartUploadResponse -> Maybe (Sensitive Text))
-> (CompleteMultipartUploadResponse
    -> Maybe (Sensitive Text) -> CompleteMultipartUploadResponse)
-> Lens
     CompleteMultipartUploadResponse
     CompleteMultipartUploadResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteMultipartUploadResponse' {Maybe (Sensitive Text)
sSEKMSKeyId :: Maybe (Sensitive Text)
$sel:sSEKMSKeyId:CompleteMultipartUploadResponse' :: CompleteMultipartUploadResponse -> Maybe (Sensitive Text)
sSEKMSKeyId} -> Maybe (Sensitive Text)
sSEKMSKeyId) (\s :: CompleteMultipartUploadResponse
s@CompleteMultipartUploadResponse' {} Maybe (Sensitive Text)
a -> CompleteMultipartUploadResponse
s {$sel:sSEKMSKeyId:CompleteMultipartUploadResponse' :: Maybe (Sensitive Text)
sSEKMSKeyId = Maybe (Sensitive Text)
a} :: CompleteMultipartUploadResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CompleteMultipartUploadResponse
 -> f CompleteMultipartUploadResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CompleteMultipartUploadResponse
-> f CompleteMultipartUploadResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | If you specified server-side encryption either with an Amazon S3-managed
-- encryption key or an Amazon Web Services KMS key in your initiate
-- multipart upload request, the response includes this header. It confirms
-- the encryption algorithm that Amazon S3 used to encrypt the object.
completeMultipartUploadResponse_serverSideEncryption :: Lens.Lens' CompleteMultipartUploadResponse (Prelude.Maybe ServerSideEncryption)
completeMultipartUploadResponse_serverSideEncryption :: (Maybe ServerSideEncryption -> f (Maybe ServerSideEncryption))
-> CompleteMultipartUploadResponse
-> f CompleteMultipartUploadResponse
completeMultipartUploadResponse_serverSideEncryption = (CompleteMultipartUploadResponse -> Maybe ServerSideEncryption)
-> (CompleteMultipartUploadResponse
    -> Maybe ServerSideEncryption -> CompleteMultipartUploadResponse)
-> Lens
     CompleteMultipartUploadResponse
     CompleteMultipartUploadResponse
     (Maybe ServerSideEncryption)
     (Maybe ServerSideEncryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompleteMultipartUploadResponse' {Maybe ServerSideEncryption
serverSideEncryption :: Maybe ServerSideEncryption
$sel:serverSideEncryption:CompleteMultipartUploadResponse' :: CompleteMultipartUploadResponse -> Maybe ServerSideEncryption
serverSideEncryption} -> Maybe ServerSideEncryption
serverSideEncryption) (\s :: CompleteMultipartUploadResponse
s@CompleteMultipartUploadResponse' {} Maybe ServerSideEncryption
a -> CompleteMultipartUploadResponse
s {$sel:serverSideEncryption:CompleteMultipartUploadResponse' :: Maybe ServerSideEncryption
serverSideEncryption = Maybe ServerSideEncryption
a} :: CompleteMultipartUploadResponse)

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

instance
  Prelude.NFData
    CompleteMultipartUploadResponse