module Network.AWS.S3.PutBucketVersioning
(
putBucketVersioning
, PutBucketVersioning
, pbvMFA
, pbvContentMD5
, pbvBucket
, pbvVersioningConfiguration
, putBucketVersioningResponse
, PutBucketVersioningResponse
) 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 PutBucketVersioning = PutBucketVersioning'
{ _pbvMFA :: !(Maybe Text)
, _pbvContentMD5 :: !(Maybe Text)
, _pbvBucket :: !BucketName
, _pbvVersioningConfiguration :: !VersioningConfiguration
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putBucketVersioning
:: BucketName
-> VersioningConfiguration
-> PutBucketVersioning
putBucketVersioning pBucket_ pVersioningConfiguration_ =
PutBucketVersioning'
{ _pbvMFA = Nothing
, _pbvContentMD5 = Nothing
, _pbvBucket = pBucket_
, _pbvVersioningConfiguration = pVersioningConfiguration_
}
pbvMFA :: Lens' PutBucketVersioning (Maybe Text)
pbvMFA = lens _pbvMFA (\ s a -> s{_pbvMFA = a});
pbvContentMD5 :: Lens' PutBucketVersioning (Maybe Text)
pbvContentMD5 = lens _pbvContentMD5 (\ s a -> s{_pbvContentMD5 = a});
pbvBucket :: Lens' PutBucketVersioning BucketName
pbvBucket = lens _pbvBucket (\ s a -> s{_pbvBucket = a});
pbvVersioningConfiguration :: Lens' PutBucketVersioning VersioningConfiguration
pbvVersioningConfiguration = lens _pbvVersioningConfiguration (\ s a -> s{_pbvVersioningConfiguration = a});
instance AWSRequest PutBucketVersioning where
type Rs PutBucketVersioning =
PutBucketVersioningResponse
request = putXML s3
response = receiveNull PutBucketVersioningResponse'
instance Hashable PutBucketVersioning where
instance NFData PutBucketVersioning where
instance ToElement PutBucketVersioning where
toElement
= mkElement
"{http://s3.amazonaws.com/doc/2006-03-01/}VersioningConfiguration"
.
_pbvVersioningConfiguration
instance ToHeaders PutBucketVersioning where
toHeaders PutBucketVersioning'{..}
= mconcat
["x-amz-mfa" =# _pbvMFA,
"Content-MD5" =# _pbvContentMD5]
instance ToPath PutBucketVersioning where
toPath PutBucketVersioning'{..}
= mconcat ["/", toBS _pbvBucket]
instance ToQuery PutBucketVersioning where
toQuery = const (mconcat ["versioning"])
data PutBucketVersioningResponse =
PutBucketVersioningResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
putBucketVersioningResponse
:: PutBucketVersioningResponse
putBucketVersioningResponse = PutBucketVersioningResponse'
instance NFData PutBucketVersioningResponse where