{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.S3.PutBucketRequestPayment
(
putBucketRequestPayment
, PutBucketRequestPayment
, pbrpContentMD5
, pbrpBucket
, pbrpRequestPaymentConfiguration
, putBucketRequestPaymentResponse
, PutBucketRequestPaymentResponse
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.S3.Types
import Network.AWS.S3.Types.Product
data PutBucketRequestPayment = PutBucketRequestPayment'
{ _pbrpContentMD5 :: !(Maybe Text)
, _pbrpBucket :: !BucketName
, _pbrpRequestPaymentConfiguration :: !RequestPaymentConfiguration
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putBucketRequestPayment
:: BucketName
-> RequestPaymentConfiguration
-> PutBucketRequestPayment
putBucketRequestPayment pBucket_ pRequestPaymentConfiguration_ =
PutBucketRequestPayment'
{ _pbrpContentMD5 = Nothing
, _pbrpBucket = pBucket_
, _pbrpRequestPaymentConfiguration = pRequestPaymentConfiguration_
}
pbrpContentMD5 :: Lens' PutBucketRequestPayment (Maybe Text)
pbrpContentMD5 = lens _pbrpContentMD5 (\ s a -> s{_pbrpContentMD5 = a})
pbrpBucket :: Lens' PutBucketRequestPayment BucketName
pbrpBucket = lens _pbrpBucket (\ s a -> s{_pbrpBucket = a})
pbrpRequestPaymentConfiguration :: Lens' PutBucketRequestPayment RequestPaymentConfiguration
pbrpRequestPaymentConfiguration = lens _pbrpRequestPaymentConfiguration (\ s a -> s{_pbrpRequestPaymentConfiguration = a})
instance AWSRequest PutBucketRequestPayment where
type Rs PutBucketRequestPayment =
PutBucketRequestPaymentResponse
request = putXML s3
response
= receiveNull PutBucketRequestPaymentResponse'
instance Hashable PutBucketRequestPayment where
instance NFData PutBucketRequestPayment where
instance ToElement PutBucketRequestPayment where
toElement
= mkElement
"{http://s3.amazonaws.com/doc/2006-03-01/}RequestPaymentConfiguration"
.
_pbrpRequestPaymentConfiguration
instance ToHeaders PutBucketRequestPayment where
toHeaders PutBucketRequestPayment'{..}
= mconcat ["Content-MD5" =# _pbrpContentMD5]
instance ToPath PutBucketRequestPayment where
toPath PutBucketRequestPayment'{..}
= mconcat ["/", toBS _pbrpBucket]
instance ToQuery PutBucketRequestPayment where
toQuery = const (mconcat ["requestPayment"])
data PutBucketRequestPaymentResponse =
PutBucketRequestPaymentResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
putBucketRequestPaymentResponse
:: PutBucketRequestPaymentResponse
putBucketRequestPaymentResponse = PutBucketRequestPaymentResponse'
instance NFData PutBucketRequestPaymentResponse where