module Network.AWS.S3.PutBucketTagging
(
PutBucketTagging
, putBucketTagging
, pbtBucket
, pbtContentMD5
, pbtTagging
, PutBucketTaggingResponse
, putBucketTaggingResponse
) where
import Network.AWS.Prelude
import Network.AWS.Request.S3
import Network.AWS.S3.Types
import qualified GHC.Exts
data PutBucketTagging = PutBucketTagging
{ _pbtBucket :: Text
, _pbtContentMD5 :: Maybe Text
, _pbtTagging :: Tagging
} deriving (Eq, Show)
putBucketTagging :: Text
-> Tagging
-> PutBucketTagging
putBucketTagging p1 p2 = PutBucketTagging
{ _pbtBucket = p1
, _pbtTagging = p2
, _pbtContentMD5 = Nothing
}
pbtBucket :: Lens' PutBucketTagging Text
pbtBucket = lens _pbtBucket (\s a -> s { _pbtBucket = a })
pbtContentMD5 :: Lens' PutBucketTagging (Maybe Text)
pbtContentMD5 = lens _pbtContentMD5 (\s a -> s { _pbtContentMD5 = a })
pbtTagging :: Lens' PutBucketTagging Tagging
pbtTagging = lens _pbtTagging (\s a -> s { _pbtTagging = a })
data PutBucketTaggingResponse = PutBucketTaggingResponse
deriving (Eq, Ord, Show, Generic)
putBucketTaggingResponse :: PutBucketTaggingResponse
putBucketTaggingResponse = PutBucketTaggingResponse
instance ToPath PutBucketTagging where
toPath PutBucketTagging{..} = mconcat
[ "/"
, toText _pbtBucket
]
instance ToQuery PutBucketTagging where
toQuery = const "tagging"
instance ToHeaders PutBucketTagging where
toHeaders PutBucketTagging{..} = mconcat
[ "Content-MD5" =: _pbtContentMD5
]
instance ToXMLRoot PutBucketTagging where
toXMLRoot PutBucketTagging{..} = namespaced ns "PutBucketTagging"
[ "Tagging" =@ _pbtTagging
]
instance ToXML PutBucketTagging
instance AWSRequest PutBucketTagging where
type Sv PutBucketTagging = S3
type Rs PutBucketTagging = PutBucketTaggingResponse
request = put
response = nullResponse PutBucketTaggingResponse