module Network.AWS.S3.PutObjectAcl
(
PutObjectAcl
, putObjectAcl
, poaACL
, poaAccessControlPolicy
, poaBucket
, poaContentMD5
, poaGrantFullControl
, poaGrantRead
, poaGrantReadACP
, poaGrantWrite
, poaGrantWriteACP
, poaKey
, PutObjectAclResponse
, putObjectAclResponse
) where
import Network.AWS.Prelude
import Network.AWS.Request.RestXML
import Network.AWS.S3.Types
import qualified GHC.Exts
data PutObjectAcl = PutObjectAcl
{ _poaACL :: Maybe Text
, _poaAccessControlPolicy :: Maybe AccessControlPolicy
, _poaBucket :: Text
, _poaContentMD5 :: Maybe Text
, _poaGrantFullControl :: Maybe Text
, _poaGrantRead :: Maybe Text
, _poaGrantReadACP :: Maybe Text
, _poaGrantWrite :: Maybe Text
, _poaGrantWriteACP :: Maybe Text
, _poaKey :: Text
} deriving (Eq, Show)
putObjectAcl :: Text
-> Text
-> PutObjectAcl
putObjectAcl p1 p2 = PutObjectAcl
{ _poaBucket = p1
, _poaKey = p2
, _poaACL = Nothing
, _poaAccessControlPolicy = Nothing
, _poaContentMD5 = Nothing
, _poaGrantFullControl = Nothing
, _poaGrantRead = Nothing
, _poaGrantReadACP = Nothing
, _poaGrantWrite = Nothing
, _poaGrantWriteACP = Nothing
}
poaACL :: Lens' PutObjectAcl (Maybe Text)
poaACL = lens _poaACL (\s a -> s { _poaACL = a })
poaAccessControlPolicy :: Lens' PutObjectAcl (Maybe AccessControlPolicy)
poaAccessControlPolicy =
lens _poaAccessControlPolicy (\s a -> s { _poaAccessControlPolicy = a })
poaBucket :: Lens' PutObjectAcl Text
poaBucket = lens _poaBucket (\s a -> s { _poaBucket = a })
poaContentMD5 :: Lens' PutObjectAcl (Maybe Text)
poaContentMD5 = lens _poaContentMD5 (\s a -> s { _poaContentMD5 = a })
poaGrantFullControl :: Lens' PutObjectAcl (Maybe Text)
poaGrantFullControl =
lens _poaGrantFullControl (\s a -> s { _poaGrantFullControl = a })
poaGrantRead :: Lens' PutObjectAcl (Maybe Text)
poaGrantRead = lens _poaGrantRead (\s a -> s { _poaGrantRead = a })
poaGrantReadACP :: Lens' PutObjectAcl (Maybe Text)
poaGrantReadACP = lens _poaGrantReadACP (\s a -> s { _poaGrantReadACP = a })
poaGrantWrite :: Lens' PutObjectAcl (Maybe Text)
poaGrantWrite = lens _poaGrantWrite (\s a -> s { _poaGrantWrite = a })
poaGrantWriteACP :: Lens' PutObjectAcl (Maybe Text)
poaGrantWriteACP = lens _poaGrantWriteACP (\s a -> s { _poaGrantWriteACP = a })
poaKey :: Lens' PutObjectAcl Text
poaKey = lens _poaKey (\s a -> s { _poaKey = a })
data PutObjectAclResponse = PutObjectAclResponse
deriving (Eq, Ord, Show, Generic)
putObjectAclResponse :: PutObjectAclResponse
putObjectAclResponse = PutObjectAclResponse
instance ToPath PutObjectAcl where
toPath PutObjectAcl{..} = mconcat
[ "/"
, toText _poaBucket
, "/"
, toText _poaKey
]
instance ToQuery PutObjectAcl where
toQuery = const "acl"
instance ToHeaders PutObjectAcl where
toHeaders PutObjectAcl{..} = mconcat
[ "x-amz-acl" =: _poaACL
, "Content-MD5" =: _poaContentMD5
, "x-amz-grant-full-control" =: _poaGrantFullControl
, "x-amz-grant-read" =: _poaGrantRead
, "x-amz-grant-read-acp" =: _poaGrantReadACP
, "x-amz-grant-write" =: _poaGrantWrite
, "x-amz-grant-write-acp" =: _poaGrantWriteACP
]
instance ToXMLRoot PutObjectAcl where
toXMLRoot PutObjectAcl{..} = namespaced ns "PutObjectAcl"
[ "AccessControlPolicy" =@ _poaAccessControlPolicy
]
instance ToXML PutObjectAcl
instance AWSRequest PutObjectAcl where
type Sv PutObjectAcl = S3
type Rs PutObjectAcl = PutObjectAclResponse
request = put
response = nullResponse PutObjectAclResponse