module Network.AWS.S3.PutBucketACL
(
putBucketACL
, PutBucketACL
, pbaGrantReadACP
, pbaGrantWriteACP
, pbaGrantRead
, pbaGrantFullControl
, pbaContentMD5
, pbaAccessControlPolicy
, pbaGrantWrite
, pbaACL
, pbaBucket
, putBucketACLResponse
, PutBucketACLResponse
) 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 PutBucketACL = PutBucketACL'
{ _pbaGrantReadACP :: !(Maybe Text)
, _pbaGrantWriteACP :: !(Maybe Text)
, _pbaGrantRead :: !(Maybe Text)
, _pbaGrantFullControl :: !(Maybe Text)
, _pbaContentMD5 :: !(Maybe Text)
, _pbaAccessControlPolicy :: !(Maybe AccessControlPolicy)
, _pbaGrantWrite :: !(Maybe Text)
, _pbaACL :: !(Maybe BucketCannedACL)
, _pbaBucket :: !BucketName
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putBucketACL
:: BucketName
-> PutBucketACL
putBucketACL pBucket_ =
PutBucketACL'
{ _pbaGrantReadACP = Nothing
, _pbaGrantWriteACP = Nothing
, _pbaGrantRead = Nothing
, _pbaGrantFullControl = Nothing
, _pbaContentMD5 = Nothing
, _pbaAccessControlPolicy = Nothing
, _pbaGrantWrite = Nothing
, _pbaACL = Nothing
, _pbaBucket = pBucket_
}
pbaGrantReadACP :: Lens' PutBucketACL (Maybe Text)
pbaGrantReadACP = lens _pbaGrantReadACP (\ s a -> s{_pbaGrantReadACP = a});
pbaGrantWriteACP :: Lens' PutBucketACL (Maybe Text)
pbaGrantWriteACP = lens _pbaGrantWriteACP (\ s a -> s{_pbaGrantWriteACP = a});
pbaGrantRead :: Lens' PutBucketACL (Maybe Text)
pbaGrantRead = lens _pbaGrantRead (\ s a -> s{_pbaGrantRead = a});
pbaGrantFullControl :: Lens' PutBucketACL (Maybe Text)
pbaGrantFullControl = lens _pbaGrantFullControl (\ s a -> s{_pbaGrantFullControl = a});
pbaContentMD5 :: Lens' PutBucketACL (Maybe Text)
pbaContentMD5 = lens _pbaContentMD5 (\ s a -> s{_pbaContentMD5 = a});
pbaAccessControlPolicy :: Lens' PutBucketACL (Maybe AccessControlPolicy)
pbaAccessControlPolicy = lens _pbaAccessControlPolicy (\ s a -> s{_pbaAccessControlPolicy = a});
pbaGrantWrite :: Lens' PutBucketACL (Maybe Text)
pbaGrantWrite = lens _pbaGrantWrite (\ s a -> s{_pbaGrantWrite = a});
pbaACL :: Lens' PutBucketACL (Maybe BucketCannedACL)
pbaACL = lens _pbaACL (\ s a -> s{_pbaACL = a});
pbaBucket :: Lens' PutBucketACL BucketName
pbaBucket = lens _pbaBucket (\ s a -> s{_pbaBucket = a});
instance AWSRequest PutBucketACL where
type Rs PutBucketACL = PutBucketACLResponse
request = putXML s3
response = receiveNull PutBucketACLResponse'
instance Hashable PutBucketACL where
instance NFData PutBucketACL where
instance ToElement PutBucketACL where
toElement
= mkElement
"{http://s3.amazonaws.com/doc/2006-03-01/}AccessControlPolicy"
.
_pbaAccessControlPolicy
instance ToHeaders PutBucketACL where
toHeaders PutBucketACL'{..}
= mconcat
["x-amz-grant-read-acp" =# _pbaGrantReadACP,
"x-amz-grant-write-acp" =# _pbaGrantWriteACP,
"x-amz-grant-read" =# _pbaGrantRead,
"x-amz-grant-full-control" =# _pbaGrantFullControl,
"Content-MD5" =# _pbaContentMD5,
"x-amz-grant-write" =# _pbaGrantWrite,
"x-amz-acl" =# _pbaACL]
instance ToPath PutBucketACL where
toPath PutBucketACL'{..}
= mconcat ["/", toBS _pbaBucket]
instance ToQuery PutBucketACL where
toQuery = const (mconcat ["acl"])
data PutBucketACLResponse =
PutBucketACLResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
putBucketACLResponse
:: PutBucketACLResponse
putBucketACLResponse = PutBucketACLResponse'
instance NFData PutBucketACLResponse where