module Network.AWS.S3.PutBucketLogging
(
PutBucketLogging
, putBucketLogging
, pblBucket
, pblBucketLoggingStatus
, pblContentMD5
, PutBucketLoggingResponse
, putBucketLoggingResponse
) where
import Network.AWS.Prelude
import Network.AWS.Request.RestXML
import Network.AWS.S3.Types
import qualified GHC.Exts
data PutBucketLogging = PutBucketLogging
{ _pblBucket :: Text
, _pblBucketLoggingStatus :: BucketLoggingStatus
, _pblContentMD5 :: Maybe Text
} deriving (Eq, Show)
putBucketLogging :: Text
-> BucketLoggingStatus
-> PutBucketLogging
putBucketLogging p1 p2 = PutBucketLogging
{ _pblBucket = p1
, _pblBucketLoggingStatus = p2
, _pblContentMD5 = Nothing
}
pblBucket :: Lens' PutBucketLogging Text
pblBucket = lens _pblBucket (\s a -> s { _pblBucket = a })
pblBucketLoggingStatus :: Lens' PutBucketLogging BucketLoggingStatus
pblBucketLoggingStatus =
lens _pblBucketLoggingStatus (\s a -> s { _pblBucketLoggingStatus = a })
pblContentMD5 :: Lens' PutBucketLogging (Maybe Text)
pblContentMD5 = lens _pblContentMD5 (\s a -> s { _pblContentMD5 = a })
data PutBucketLoggingResponse = PutBucketLoggingResponse
deriving (Eq, Ord, Show, Generic)
putBucketLoggingResponse :: PutBucketLoggingResponse
putBucketLoggingResponse = PutBucketLoggingResponse
instance ToPath PutBucketLogging where
toPath PutBucketLogging{..} = mconcat
[ "/"
, toText _pblBucket
]
instance ToQuery PutBucketLogging where
toQuery = const "logging"
instance ToHeaders PutBucketLogging where
toHeaders PutBucketLogging{..} = mconcat
[ "Content-MD5" =: _pblContentMD5
]
instance ToXMLRoot PutBucketLogging where
toXMLRoot PutBucketLogging{..} = namespaced ns "PutBucketLogging"
[ "BucketLoggingStatus" =@ _pblBucketLoggingStatus
]
instance ToXML PutBucketLogging
instance AWSRequest PutBucketLogging where
type Sv PutBucketLogging = S3
type Rs PutBucketLogging = PutBucketLoggingResponse
request = put
response = nullResponse PutBucketLoggingResponse