{-# 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.AbortMultipartUpload
-- 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)
--
-- This action aborts a multipart upload. After a multipart upload is
-- aborted, no additional parts can be uploaded using that upload ID. The
-- storage consumed by any previously uploaded parts will be freed.
-- However, if any part uploads are currently in progress, those part
-- uploads might or might not succeed. As a result, it might be necessary
-- to abort a given multipart upload multiple times in order to completely
-- free all storage consumed by all parts.
--
-- To verify that all parts have been removed, so you don\'t get charged
-- for the part storage, you should call the
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html ListParts>
-- action and ensure that the parts list is empty.
--
-- For information about permissions required to use the multipart upload,
-- see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html Multipart Upload and Permissions>.
--
-- The following operations are related to @AbortMultipartUpload@:
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html CreateMultipartUpload>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html UploadPart>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html CompleteMultipartUpload>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html ListParts>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html ListMultipartUploads>
module Amazonka.S3.AbortMultipartUpload
  ( -- * Creating a Request
    AbortMultipartUpload (..),
    newAbortMultipartUpload,

    -- * Request Lenses
    abortMultipartUpload_requestPayer,
    abortMultipartUpload_expectedBucketOwner,
    abortMultipartUpload_bucket,
    abortMultipartUpload_key,
    abortMultipartUpload_uploadId,

    -- * Destructuring the Response
    AbortMultipartUploadResponse (..),
    newAbortMultipartUploadResponse,

    -- * Response Lenses
    abortMultipartUploadResponse_requestCharged,
    abortMultipartUploadResponse_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:/ 'newAbortMultipartUpload' smart constructor.
data AbortMultipartUpload = AbortMultipartUpload'
  { AbortMultipartUpload -> Maybe RequestPayer
requestPayer :: Prelude.Maybe RequestPayer,
    -- | 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.
    AbortMultipartUpload -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The bucket name to which the upload was taking place.
    --
    -- 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/.
    AbortMultipartUpload -> BucketName
bucket :: BucketName,
    -- | Key of the object for which the multipart upload was initiated.
    AbortMultipartUpload -> ObjectKey
key :: ObjectKey,
    -- | Upload ID that identifies the multipart upload.
    AbortMultipartUpload -> Text
uploadId :: Prelude.Text
  }
  deriving (AbortMultipartUpload -> AbortMultipartUpload -> Bool
(AbortMultipartUpload -> AbortMultipartUpload -> Bool)
-> (AbortMultipartUpload -> AbortMultipartUpload -> Bool)
-> Eq AbortMultipartUpload
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AbortMultipartUpload -> AbortMultipartUpload -> Bool
$c/= :: AbortMultipartUpload -> AbortMultipartUpload -> Bool
== :: AbortMultipartUpload -> AbortMultipartUpload -> Bool
$c== :: AbortMultipartUpload -> AbortMultipartUpload -> Bool
Prelude.Eq, ReadPrec [AbortMultipartUpload]
ReadPrec AbortMultipartUpload
Int -> ReadS AbortMultipartUpload
ReadS [AbortMultipartUpload]
(Int -> ReadS AbortMultipartUpload)
-> ReadS [AbortMultipartUpload]
-> ReadPrec AbortMultipartUpload
-> ReadPrec [AbortMultipartUpload]
-> Read AbortMultipartUpload
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AbortMultipartUpload]
$creadListPrec :: ReadPrec [AbortMultipartUpload]
readPrec :: ReadPrec AbortMultipartUpload
$creadPrec :: ReadPrec AbortMultipartUpload
readList :: ReadS [AbortMultipartUpload]
$creadList :: ReadS [AbortMultipartUpload]
readsPrec :: Int -> ReadS AbortMultipartUpload
$creadsPrec :: Int -> ReadS AbortMultipartUpload
Prelude.Read, Int -> AbortMultipartUpload -> ShowS
[AbortMultipartUpload] -> ShowS
AbortMultipartUpload -> String
(Int -> AbortMultipartUpload -> ShowS)
-> (AbortMultipartUpload -> String)
-> ([AbortMultipartUpload] -> ShowS)
-> Show AbortMultipartUpload
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AbortMultipartUpload] -> ShowS
$cshowList :: [AbortMultipartUpload] -> ShowS
show :: AbortMultipartUpload -> String
$cshow :: AbortMultipartUpload -> String
showsPrec :: Int -> AbortMultipartUpload -> ShowS
$cshowsPrec :: Int -> AbortMultipartUpload -> ShowS
Prelude.Show, (forall x. AbortMultipartUpload -> Rep AbortMultipartUpload x)
-> (forall x. Rep AbortMultipartUpload x -> AbortMultipartUpload)
-> Generic AbortMultipartUpload
forall x. Rep AbortMultipartUpload x -> AbortMultipartUpload
forall x. AbortMultipartUpload -> Rep AbortMultipartUpload x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AbortMultipartUpload x -> AbortMultipartUpload
$cfrom :: forall x. AbortMultipartUpload -> Rep AbortMultipartUpload x
Prelude.Generic)

-- |
-- Create a value of 'AbortMultipartUpload' 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', 'abortMultipartUpload_requestPayer' - Undocumented member.
--
-- 'expectedBucketOwner', 'abortMultipartUpload_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', 'abortMultipartUpload_bucket' - The bucket name to which the upload was taking place.
--
-- 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', 'abortMultipartUpload_key' - Key of the object for which the multipart upload was initiated.
--
-- 'uploadId', 'abortMultipartUpload_uploadId' - Upload ID that identifies the multipart upload.
newAbortMultipartUpload ::
  -- | 'bucket'
  BucketName ->
  -- | 'key'
  ObjectKey ->
  -- | 'uploadId'
  Prelude.Text ->
  AbortMultipartUpload
newAbortMultipartUpload :: BucketName -> ObjectKey -> Text -> AbortMultipartUpload
newAbortMultipartUpload BucketName
pBucket_ ObjectKey
pKey_ Text
pUploadId_ =
  AbortMultipartUpload' :: Maybe RequestPayer
-> Maybe Text
-> BucketName
-> ObjectKey
-> Text
-> AbortMultipartUpload
AbortMultipartUpload'
    { $sel:requestPayer:AbortMultipartUpload' :: Maybe RequestPayer
requestPayer =
        Maybe RequestPayer
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:AbortMultipartUpload' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:AbortMultipartUpload' :: BucketName
bucket = BucketName
pBucket_,
      $sel:key:AbortMultipartUpload' :: ObjectKey
key = ObjectKey
pKey_,
      $sel:uploadId:AbortMultipartUpload' :: Text
uploadId = Text
pUploadId_
    }

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

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

-- | The bucket name to which the upload was taking place.
--
-- 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/.
abortMultipartUpload_bucket :: Lens.Lens' AbortMultipartUpload BucketName
abortMultipartUpload_bucket :: (BucketName -> f BucketName)
-> AbortMultipartUpload -> f AbortMultipartUpload
abortMultipartUpload_bucket = (AbortMultipartUpload -> BucketName)
-> (AbortMultipartUpload -> BucketName -> AbortMultipartUpload)
-> Lens
     AbortMultipartUpload AbortMultipartUpload BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AbortMultipartUpload' {BucketName
bucket :: BucketName
$sel:bucket:AbortMultipartUpload' :: AbortMultipartUpload -> BucketName
bucket} -> BucketName
bucket) (\s :: AbortMultipartUpload
s@AbortMultipartUpload' {} BucketName
a -> AbortMultipartUpload
s {$sel:bucket:AbortMultipartUpload' :: BucketName
bucket = BucketName
a} :: AbortMultipartUpload)

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

-- | Upload ID that identifies the multipart upload.
abortMultipartUpload_uploadId :: Lens.Lens' AbortMultipartUpload Prelude.Text
abortMultipartUpload_uploadId :: (Text -> f Text) -> AbortMultipartUpload -> f AbortMultipartUpload
abortMultipartUpload_uploadId = (AbortMultipartUpload -> Text)
-> (AbortMultipartUpload -> Text -> AbortMultipartUpload)
-> Lens AbortMultipartUpload AbortMultipartUpload Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AbortMultipartUpload' {Text
uploadId :: Text
$sel:uploadId:AbortMultipartUpload' :: AbortMultipartUpload -> Text
uploadId} -> Text
uploadId) (\s :: AbortMultipartUpload
s@AbortMultipartUpload' {} Text
a -> AbortMultipartUpload
s {$sel:uploadId:AbortMultipartUpload' :: Text
uploadId = Text
a} :: AbortMultipartUpload)

instance Core.AWSRequest AbortMultipartUpload where
  type
    AWSResponse AbortMultipartUpload =
      AbortMultipartUploadResponse
  request :: AbortMultipartUpload -> Request AbortMultipartUpload
request =
    Request AbortMultipartUpload -> Request AbortMultipartUpload
forall a. Request a -> Request a
Request.s3vhost
      (Request AbortMultipartUpload -> Request AbortMultipartUpload)
-> (AbortMultipartUpload -> Request AbortMultipartUpload)
-> AbortMultipartUpload
-> Request AbortMultipartUpload
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> AbortMultipartUpload -> Request AbortMultipartUpload
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy AbortMultipartUpload
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AbortMultipartUpload)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse AbortMultipartUpload))
-> Logger
-> Service
-> Proxy AbortMultipartUpload
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AbortMultipartUpload)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Maybe RequestCharged -> Int -> AbortMultipartUploadResponse
AbortMultipartUploadResponse'
            (Maybe RequestCharged -> Int -> AbortMultipartUploadResponse)
-> Either String (Maybe RequestCharged)
-> Either String (Int -> AbortMultipartUploadResponse)
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 (Int -> AbortMultipartUploadResponse)
-> Either String Int -> Either String AbortMultipartUploadResponse
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 AbortMultipartUpload

instance Prelude.NFData AbortMultipartUpload

instance Core.ToHeaders AbortMultipartUpload where
  toHeaders :: AbortMultipartUpload -> ResponseHeaders
toHeaders AbortMultipartUpload' {Maybe Text
Maybe RequestPayer
Text
ObjectKey
BucketName
uploadId :: Text
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
requestPayer :: Maybe RequestPayer
$sel:uploadId:AbortMultipartUpload' :: AbortMultipartUpload -> Text
$sel:key:AbortMultipartUpload' :: AbortMultipartUpload -> ObjectKey
$sel:bucket:AbortMultipartUpload' :: AbortMultipartUpload -> BucketName
$sel:expectedBucketOwner:AbortMultipartUpload' :: AbortMultipartUpload -> Maybe Text
$sel:requestPayer:AbortMultipartUpload' :: AbortMultipartUpload -> 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 AbortMultipartUpload where
  toPath :: AbortMultipartUpload -> ByteString
toPath AbortMultipartUpload' {Maybe Text
Maybe RequestPayer
Text
ObjectKey
BucketName
uploadId :: Text
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
requestPayer :: Maybe RequestPayer
$sel:uploadId:AbortMultipartUpload' :: AbortMultipartUpload -> Text
$sel:key:AbortMultipartUpload' :: AbortMultipartUpload -> ObjectKey
$sel:bucket:AbortMultipartUpload' :: AbortMultipartUpload -> BucketName
$sel:expectedBucketOwner:AbortMultipartUpload' :: AbortMultipartUpload -> Maybe Text
$sel:requestPayer:AbortMultipartUpload' :: AbortMultipartUpload -> 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 AbortMultipartUpload where
  toQuery :: AbortMultipartUpload -> QueryString
toQuery AbortMultipartUpload' {Maybe Text
Maybe RequestPayer
Text
ObjectKey
BucketName
uploadId :: Text
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
requestPayer :: Maybe RequestPayer
$sel:uploadId:AbortMultipartUpload' :: AbortMultipartUpload -> Text
$sel:key:AbortMultipartUpload' :: AbortMultipartUpload -> ObjectKey
$sel:bucket:AbortMultipartUpload' :: AbortMultipartUpload -> BucketName
$sel:expectedBucketOwner:AbortMultipartUpload' :: AbortMultipartUpload -> Maybe Text
$sel:requestPayer:AbortMultipartUpload' :: AbortMultipartUpload -> 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:/ 'newAbortMultipartUploadResponse' smart constructor.
data AbortMultipartUploadResponse = AbortMultipartUploadResponse'
  { AbortMultipartUploadResponse -> Maybe RequestCharged
requestCharged :: Prelude.Maybe RequestCharged,
    -- | The response's http status code.
    AbortMultipartUploadResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AbortMultipartUploadResponse
-> AbortMultipartUploadResponse -> Bool
(AbortMultipartUploadResponse
 -> AbortMultipartUploadResponse -> Bool)
-> (AbortMultipartUploadResponse
    -> AbortMultipartUploadResponse -> Bool)
-> Eq AbortMultipartUploadResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AbortMultipartUploadResponse
-> AbortMultipartUploadResponse -> Bool
$c/= :: AbortMultipartUploadResponse
-> AbortMultipartUploadResponse -> Bool
== :: AbortMultipartUploadResponse
-> AbortMultipartUploadResponse -> Bool
$c== :: AbortMultipartUploadResponse
-> AbortMultipartUploadResponse -> Bool
Prelude.Eq, ReadPrec [AbortMultipartUploadResponse]
ReadPrec AbortMultipartUploadResponse
Int -> ReadS AbortMultipartUploadResponse
ReadS [AbortMultipartUploadResponse]
(Int -> ReadS AbortMultipartUploadResponse)
-> ReadS [AbortMultipartUploadResponse]
-> ReadPrec AbortMultipartUploadResponse
-> ReadPrec [AbortMultipartUploadResponse]
-> Read AbortMultipartUploadResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AbortMultipartUploadResponse]
$creadListPrec :: ReadPrec [AbortMultipartUploadResponse]
readPrec :: ReadPrec AbortMultipartUploadResponse
$creadPrec :: ReadPrec AbortMultipartUploadResponse
readList :: ReadS [AbortMultipartUploadResponse]
$creadList :: ReadS [AbortMultipartUploadResponse]
readsPrec :: Int -> ReadS AbortMultipartUploadResponse
$creadsPrec :: Int -> ReadS AbortMultipartUploadResponse
Prelude.Read, Int -> AbortMultipartUploadResponse -> ShowS
[AbortMultipartUploadResponse] -> ShowS
AbortMultipartUploadResponse -> String
(Int -> AbortMultipartUploadResponse -> ShowS)
-> (AbortMultipartUploadResponse -> String)
-> ([AbortMultipartUploadResponse] -> ShowS)
-> Show AbortMultipartUploadResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AbortMultipartUploadResponse] -> ShowS
$cshowList :: [AbortMultipartUploadResponse] -> ShowS
show :: AbortMultipartUploadResponse -> String
$cshow :: AbortMultipartUploadResponse -> String
showsPrec :: Int -> AbortMultipartUploadResponse -> ShowS
$cshowsPrec :: Int -> AbortMultipartUploadResponse -> ShowS
Prelude.Show, (forall x.
 AbortMultipartUploadResponse -> Rep AbortMultipartUploadResponse x)
-> (forall x.
    Rep AbortMultipartUploadResponse x -> AbortMultipartUploadResponse)
-> Generic AbortMultipartUploadResponse
forall x.
Rep AbortMultipartUploadResponse x -> AbortMultipartUploadResponse
forall x.
AbortMultipartUploadResponse -> Rep AbortMultipartUploadResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AbortMultipartUploadResponse x -> AbortMultipartUploadResponse
$cfrom :: forall x.
AbortMultipartUploadResponse -> Rep AbortMultipartUploadResponse x
Prelude.Generic)

-- |
-- Create a value of 'AbortMultipartUploadResponse' 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', 'abortMultipartUploadResponse_requestCharged' - Undocumented member.
--
-- 'httpStatus', 'abortMultipartUploadResponse_httpStatus' - The response's http status code.
newAbortMultipartUploadResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AbortMultipartUploadResponse
newAbortMultipartUploadResponse :: Int -> AbortMultipartUploadResponse
newAbortMultipartUploadResponse Int
pHttpStatus_ =
  AbortMultipartUploadResponse' :: Maybe RequestCharged -> Int -> AbortMultipartUploadResponse
AbortMultipartUploadResponse'
    { $sel:requestCharged:AbortMultipartUploadResponse' :: Maybe RequestCharged
requestCharged =
        Maybe RequestCharged
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:AbortMultipartUploadResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

instance Prelude.NFData AbortMultipartUploadResponse