{-# 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 #-}
module Amazonka.S3.PutBucketRequestPayment
(
PutBucketRequestPayment (..),
newPutBucketRequestPayment,
putBucketRequestPayment_contentMD5,
putBucketRequestPayment_expectedBucketOwner,
putBucketRequestPayment_bucket,
putBucketRequestPayment_requestPaymentConfiguration,
PutBucketRequestPaymentResponse (..),
newPutBucketRequestPaymentResponse,
)
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
data PutBucketRequestPayment = PutBucketRequestPayment'
{
PutBucketRequestPayment -> Maybe Text
contentMD5 :: Prelude.Maybe Prelude.Text,
PutBucketRequestPayment -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
PutBucketRequestPayment -> BucketName
bucket :: BucketName,
PutBucketRequestPayment -> RequestPaymentConfiguration
requestPaymentConfiguration :: RequestPaymentConfiguration
}
deriving (PutBucketRequestPayment -> PutBucketRequestPayment -> Bool
(PutBucketRequestPayment -> PutBucketRequestPayment -> Bool)
-> (PutBucketRequestPayment -> PutBucketRequestPayment -> Bool)
-> Eq PutBucketRequestPayment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketRequestPayment -> PutBucketRequestPayment -> Bool
$c/= :: PutBucketRequestPayment -> PutBucketRequestPayment -> Bool
== :: PutBucketRequestPayment -> PutBucketRequestPayment -> Bool
$c== :: PutBucketRequestPayment -> PutBucketRequestPayment -> Bool
Prelude.Eq, ReadPrec [PutBucketRequestPayment]
ReadPrec PutBucketRequestPayment
Int -> ReadS PutBucketRequestPayment
ReadS [PutBucketRequestPayment]
(Int -> ReadS PutBucketRequestPayment)
-> ReadS [PutBucketRequestPayment]
-> ReadPrec PutBucketRequestPayment
-> ReadPrec [PutBucketRequestPayment]
-> Read PutBucketRequestPayment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketRequestPayment]
$creadListPrec :: ReadPrec [PutBucketRequestPayment]
readPrec :: ReadPrec PutBucketRequestPayment
$creadPrec :: ReadPrec PutBucketRequestPayment
readList :: ReadS [PutBucketRequestPayment]
$creadList :: ReadS [PutBucketRequestPayment]
readsPrec :: Int -> ReadS PutBucketRequestPayment
$creadsPrec :: Int -> ReadS PutBucketRequestPayment
Prelude.Read, Int -> PutBucketRequestPayment -> ShowS
[PutBucketRequestPayment] -> ShowS
PutBucketRequestPayment -> String
(Int -> PutBucketRequestPayment -> ShowS)
-> (PutBucketRequestPayment -> String)
-> ([PutBucketRequestPayment] -> ShowS)
-> Show PutBucketRequestPayment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketRequestPayment] -> ShowS
$cshowList :: [PutBucketRequestPayment] -> ShowS
show :: PutBucketRequestPayment -> String
$cshow :: PutBucketRequestPayment -> String
showsPrec :: Int -> PutBucketRequestPayment -> ShowS
$cshowsPrec :: Int -> PutBucketRequestPayment -> ShowS
Prelude.Show, (forall x.
PutBucketRequestPayment -> Rep PutBucketRequestPayment x)
-> (forall x.
Rep PutBucketRequestPayment x -> PutBucketRequestPayment)
-> Generic PutBucketRequestPayment
forall x. Rep PutBucketRequestPayment x -> PutBucketRequestPayment
forall x. PutBucketRequestPayment -> Rep PutBucketRequestPayment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutBucketRequestPayment x -> PutBucketRequestPayment
$cfrom :: forall x. PutBucketRequestPayment -> Rep PutBucketRequestPayment x
Prelude.Generic)
newPutBucketRequestPayment ::
BucketName ->
RequestPaymentConfiguration ->
PutBucketRequestPayment
newPutBucketRequestPayment :: BucketName
-> RequestPaymentConfiguration -> PutBucketRequestPayment
newPutBucketRequestPayment
BucketName
pBucket_
RequestPaymentConfiguration
pRequestPaymentConfiguration_ =
PutBucketRequestPayment' :: Maybe Text
-> Maybe Text
-> BucketName
-> RequestPaymentConfiguration
-> PutBucketRequestPayment
PutBucketRequestPayment'
{ $sel:contentMD5:PutBucketRequestPayment' :: Maybe Text
contentMD5 =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:expectedBucketOwner:PutBucketRequestPayment' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:PutBucketRequestPayment' :: BucketName
bucket = BucketName
pBucket_,
$sel:requestPaymentConfiguration:PutBucketRequestPayment' :: RequestPaymentConfiguration
requestPaymentConfiguration =
RequestPaymentConfiguration
pRequestPaymentConfiguration_
}
putBucketRequestPayment_contentMD5 :: Lens.Lens' PutBucketRequestPayment (Prelude.Maybe Prelude.Text)
putBucketRequestPayment_contentMD5 :: (Maybe Text -> f (Maybe Text))
-> PutBucketRequestPayment -> f PutBucketRequestPayment
putBucketRequestPayment_contentMD5 = (PutBucketRequestPayment -> Maybe Text)
-> (PutBucketRequestPayment
-> Maybe Text -> PutBucketRequestPayment)
-> Lens
PutBucketRequestPayment
PutBucketRequestPayment
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketRequestPayment' {Maybe Text
contentMD5 :: Maybe Text
$sel:contentMD5:PutBucketRequestPayment' :: PutBucketRequestPayment -> Maybe Text
contentMD5} -> Maybe Text
contentMD5) (\s :: PutBucketRequestPayment
s@PutBucketRequestPayment' {} Maybe Text
a -> PutBucketRequestPayment
s {$sel:contentMD5:PutBucketRequestPayment' :: Maybe Text
contentMD5 = Maybe Text
a} :: PutBucketRequestPayment)
putBucketRequestPayment_expectedBucketOwner :: Lens.Lens' PutBucketRequestPayment (Prelude.Maybe Prelude.Text)
putBucketRequestPayment_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> PutBucketRequestPayment -> f PutBucketRequestPayment
putBucketRequestPayment_expectedBucketOwner = (PutBucketRequestPayment -> Maybe Text)
-> (PutBucketRequestPayment
-> Maybe Text -> PutBucketRequestPayment)
-> Lens
PutBucketRequestPayment
PutBucketRequestPayment
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketRequestPayment' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutBucketRequestPayment' :: PutBucketRequestPayment -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutBucketRequestPayment
s@PutBucketRequestPayment' {} Maybe Text
a -> PutBucketRequestPayment
s {$sel:expectedBucketOwner:PutBucketRequestPayment' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutBucketRequestPayment)
putBucketRequestPayment_bucket :: Lens.Lens' PutBucketRequestPayment BucketName
putBucketRequestPayment_bucket :: (BucketName -> f BucketName)
-> PutBucketRequestPayment -> f PutBucketRequestPayment
putBucketRequestPayment_bucket = (PutBucketRequestPayment -> BucketName)
-> (PutBucketRequestPayment
-> BucketName -> PutBucketRequestPayment)
-> Lens
PutBucketRequestPayment
PutBucketRequestPayment
BucketName
BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketRequestPayment' {BucketName
bucket :: BucketName
$sel:bucket:PutBucketRequestPayment' :: PutBucketRequestPayment -> BucketName
bucket} -> BucketName
bucket) (\s :: PutBucketRequestPayment
s@PutBucketRequestPayment' {} BucketName
a -> PutBucketRequestPayment
s {$sel:bucket:PutBucketRequestPayment' :: BucketName
bucket = BucketName
a} :: PutBucketRequestPayment)
putBucketRequestPayment_requestPaymentConfiguration :: Lens.Lens' PutBucketRequestPayment RequestPaymentConfiguration
putBucketRequestPayment_requestPaymentConfiguration :: (RequestPaymentConfiguration -> f RequestPaymentConfiguration)
-> PutBucketRequestPayment -> f PutBucketRequestPayment
putBucketRequestPayment_requestPaymentConfiguration = (PutBucketRequestPayment -> RequestPaymentConfiguration)
-> (PutBucketRequestPayment
-> RequestPaymentConfiguration -> PutBucketRequestPayment)
-> Lens
PutBucketRequestPayment
PutBucketRequestPayment
RequestPaymentConfiguration
RequestPaymentConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketRequestPayment' {RequestPaymentConfiguration
requestPaymentConfiguration :: RequestPaymentConfiguration
$sel:requestPaymentConfiguration:PutBucketRequestPayment' :: PutBucketRequestPayment -> RequestPaymentConfiguration
requestPaymentConfiguration} -> RequestPaymentConfiguration
requestPaymentConfiguration) (\s :: PutBucketRequestPayment
s@PutBucketRequestPayment' {} RequestPaymentConfiguration
a -> PutBucketRequestPayment
s {$sel:requestPaymentConfiguration:PutBucketRequestPayment' :: RequestPaymentConfiguration
requestPaymentConfiguration = RequestPaymentConfiguration
a} :: PutBucketRequestPayment)
instance Core.AWSRequest PutBucketRequestPayment where
type
AWSResponse PutBucketRequestPayment =
PutBucketRequestPaymentResponse
request :: PutBucketRequestPayment -> Request PutBucketRequestPayment
request =
Request PutBucketRequestPayment -> Request PutBucketRequestPayment
forall a. Request a -> Request a
Request.s3vhost
(Request PutBucketRequestPayment
-> Request PutBucketRequestPayment)
-> (PutBucketRequestPayment -> Request PutBucketRequestPayment)
-> PutBucketRequestPayment
-> Request PutBucketRequestPayment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service
-> PutBucketRequestPayment -> Request PutBucketRequestPayment
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
response :: Logger
-> Service
-> Proxy PutBucketRequestPayment
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutBucketRequestPayment)))
response =
AWSResponse PutBucketRequestPayment
-> Logger
-> Service
-> Proxy PutBucketRequestPayment
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutBucketRequestPayment)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse PutBucketRequestPayment
PutBucketRequestPaymentResponse
PutBucketRequestPaymentResponse'
instance Prelude.Hashable PutBucketRequestPayment
instance Prelude.NFData PutBucketRequestPayment
instance Core.ToElement PutBucketRequestPayment where
toElement :: PutBucketRequestPayment -> Element
toElement PutBucketRequestPayment' {Maybe Text
BucketName
RequestPaymentConfiguration
requestPaymentConfiguration :: RequestPaymentConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:requestPaymentConfiguration:PutBucketRequestPayment' :: PutBucketRequestPayment -> RequestPaymentConfiguration
$sel:bucket:PutBucketRequestPayment' :: PutBucketRequestPayment -> BucketName
$sel:expectedBucketOwner:PutBucketRequestPayment' :: PutBucketRequestPayment -> Maybe Text
$sel:contentMD5:PutBucketRequestPayment' :: PutBucketRequestPayment -> Maybe Text
..} =
Name -> RequestPaymentConfiguration -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{http://s3.amazonaws.com/doc/2006-03-01/}RequestPaymentConfiguration"
RequestPaymentConfiguration
requestPaymentConfiguration
instance Core.ToHeaders PutBucketRequestPayment where
toHeaders :: PutBucketRequestPayment -> [Header]
toHeaders PutBucketRequestPayment' {Maybe Text
BucketName
RequestPaymentConfiguration
requestPaymentConfiguration :: RequestPaymentConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:requestPaymentConfiguration:PutBucketRequestPayment' :: PutBucketRequestPayment -> RequestPaymentConfiguration
$sel:bucket:PutBucketRequestPayment' :: PutBucketRequestPayment -> BucketName
$sel:expectedBucketOwner:PutBucketRequestPayment' :: PutBucketRequestPayment -> Maybe Text
$sel:contentMD5:PutBucketRequestPayment' :: PutBucketRequestPayment -> Maybe Text
..} =
[[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-MD5" HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
contentMD5,
HeaderName
"x-amz-expected-bucket-owner"
HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
expectedBucketOwner
]
instance Core.ToPath PutBucketRequestPayment where
toPath :: PutBucketRequestPayment -> ByteString
toPath PutBucketRequestPayment' {Maybe Text
BucketName
RequestPaymentConfiguration
requestPaymentConfiguration :: RequestPaymentConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:requestPaymentConfiguration:PutBucketRequestPayment' :: PutBucketRequestPayment -> RequestPaymentConfiguration
$sel:bucket:PutBucketRequestPayment' :: PutBucketRequestPayment -> BucketName
$sel:expectedBucketOwner:PutBucketRequestPayment' :: PutBucketRequestPayment -> Maybe Text
$sel:contentMD5:PutBucketRequestPayment' :: PutBucketRequestPayment -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", BucketName -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS BucketName
bucket]
instance Core.ToQuery PutBucketRequestPayment where
toQuery :: PutBucketRequestPayment -> QueryString
toQuery =
QueryString -> PutBucketRequestPayment -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"requestPayment"])
data PutBucketRequestPaymentResponse = PutBucketRequestPaymentResponse'
{
}
deriving (PutBucketRequestPaymentResponse
-> PutBucketRequestPaymentResponse -> Bool
(PutBucketRequestPaymentResponse
-> PutBucketRequestPaymentResponse -> Bool)
-> (PutBucketRequestPaymentResponse
-> PutBucketRequestPaymentResponse -> Bool)
-> Eq PutBucketRequestPaymentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketRequestPaymentResponse
-> PutBucketRequestPaymentResponse -> Bool
$c/= :: PutBucketRequestPaymentResponse
-> PutBucketRequestPaymentResponse -> Bool
== :: PutBucketRequestPaymentResponse
-> PutBucketRequestPaymentResponse -> Bool
$c== :: PutBucketRequestPaymentResponse
-> PutBucketRequestPaymentResponse -> Bool
Prelude.Eq, ReadPrec [PutBucketRequestPaymentResponse]
ReadPrec PutBucketRequestPaymentResponse
Int -> ReadS PutBucketRequestPaymentResponse
ReadS [PutBucketRequestPaymentResponse]
(Int -> ReadS PutBucketRequestPaymentResponse)
-> ReadS [PutBucketRequestPaymentResponse]
-> ReadPrec PutBucketRequestPaymentResponse
-> ReadPrec [PutBucketRequestPaymentResponse]
-> Read PutBucketRequestPaymentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketRequestPaymentResponse]
$creadListPrec :: ReadPrec [PutBucketRequestPaymentResponse]
readPrec :: ReadPrec PutBucketRequestPaymentResponse
$creadPrec :: ReadPrec PutBucketRequestPaymentResponse
readList :: ReadS [PutBucketRequestPaymentResponse]
$creadList :: ReadS [PutBucketRequestPaymentResponse]
readsPrec :: Int -> ReadS PutBucketRequestPaymentResponse
$creadsPrec :: Int -> ReadS PutBucketRequestPaymentResponse
Prelude.Read, Int -> PutBucketRequestPaymentResponse -> ShowS
[PutBucketRequestPaymentResponse] -> ShowS
PutBucketRequestPaymentResponse -> String
(Int -> PutBucketRequestPaymentResponse -> ShowS)
-> (PutBucketRequestPaymentResponse -> String)
-> ([PutBucketRequestPaymentResponse] -> ShowS)
-> Show PutBucketRequestPaymentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketRequestPaymentResponse] -> ShowS
$cshowList :: [PutBucketRequestPaymentResponse] -> ShowS
show :: PutBucketRequestPaymentResponse -> String
$cshow :: PutBucketRequestPaymentResponse -> String
showsPrec :: Int -> PutBucketRequestPaymentResponse -> ShowS
$cshowsPrec :: Int -> PutBucketRequestPaymentResponse -> ShowS
Prelude.Show, (forall x.
PutBucketRequestPaymentResponse
-> Rep PutBucketRequestPaymentResponse x)
-> (forall x.
Rep PutBucketRequestPaymentResponse x
-> PutBucketRequestPaymentResponse)
-> Generic PutBucketRequestPaymentResponse
forall x.
Rep PutBucketRequestPaymentResponse x
-> PutBucketRequestPaymentResponse
forall x.
PutBucketRequestPaymentResponse
-> Rep PutBucketRequestPaymentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketRequestPaymentResponse x
-> PutBucketRequestPaymentResponse
$cfrom :: forall x.
PutBucketRequestPaymentResponse
-> Rep PutBucketRequestPaymentResponse x
Prelude.Generic)
newPutBucketRequestPaymentResponse ::
PutBucketRequestPaymentResponse
newPutBucketRequestPaymentResponse :: PutBucketRequestPaymentResponse
newPutBucketRequestPaymentResponse =
PutBucketRequestPaymentResponse
PutBucketRequestPaymentResponse'
instance
Prelude.NFData
PutBucketRequestPaymentResponse