module Network.AWS.S3.GetBucketRequestPayment
(
getBucketRequestPayment
, GetBucketRequestPayment
, gbrpBucket
, getBucketRequestPaymentResponse
, GetBucketRequestPaymentResponse
, gbrprsPayer
, gbrprsResponseStatus
) 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
newtype GetBucketRequestPayment = GetBucketRequestPayment'
{ _gbrpBucket :: BucketName
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getBucketRequestPayment
:: BucketName
-> GetBucketRequestPayment
getBucketRequestPayment pBucket_ =
GetBucketRequestPayment' {_gbrpBucket = pBucket_}
gbrpBucket :: Lens' GetBucketRequestPayment BucketName
gbrpBucket = lens _gbrpBucket (\ s a -> s{_gbrpBucket = a});
instance AWSRequest GetBucketRequestPayment where
type Rs GetBucketRequestPayment =
GetBucketRequestPaymentResponse
request = get s3
response
= receiveXML
(\ s h x ->
GetBucketRequestPaymentResponse' <$>
(x .@? "Payer") <*> (pure (fromEnum s)))
instance Hashable GetBucketRequestPayment where
instance NFData GetBucketRequestPayment where
instance ToHeaders GetBucketRequestPayment where
toHeaders = const mempty
instance ToPath GetBucketRequestPayment where
toPath GetBucketRequestPayment'{..}
= mconcat ["/", toBS _gbrpBucket]
instance ToQuery GetBucketRequestPayment where
toQuery = const (mconcat ["requestPayment"])
data GetBucketRequestPaymentResponse = GetBucketRequestPaymentResponse'
{ _gbrprsPayer :: !(Maybe Payer)
, _gbrprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getBucketRequestPaymentResponse
:: Int
-> GetBucketRequestPaymentResponse
getBucketRequestPaymentResponse pResponseStatus_ =
GetBucketRequestPaymentResponse'
{_gbrprsPayer = Nothing, _gbrprsResponseStatus = pResponseStatus_}
gbrprsPayer :: Lens' GetBucketRequestPaymentResponse (Maybe Payer)
gbrprsPayer = lens _gbrprsPayer (\ s a -> s{_gbrprsPayer = a});
gbrprsResponseStatus :: Lens' GetBucketRequestPaymentResponse Int
gbrprsResponseStatus = lens _gbrprsResponseStatus (\ s a -> s{_gbrprsResponseStatus = a});
instance NFData GetBucketRequestPaymentResponse where