module Network.AWS.S3.PutBucketReplication
(
putBucketReplication
, PutBucketReplication
, pbrContentMD5
, pbrBucket
, pbrReplicationConfiguration
, putBucketReplicationResponse
, PutBucketReplicationResponse
) 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 PutBucketReplication = PutBucketReplication'
{ _pbrContentMD5 :: !(Maybe Text)
, _pbrBucket :: !BucketName
, _pbrReplicationConfiguration :: !ReplicationConfiguration
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putBucketReplication
:: BucketName
-> ReplicationConfiguration
-> PutBucketReplication
putBucketReplication pBucket_ pReplicationConfiguration_ =
PutBucketReplication'
{ _pbrContentMD5 = Nothing
, _pbrBucket = pBucket_
, _pbrReplicationConfiguration = pReplicationConfiguration_
}
pbrContentMD5 :: Lens' PutBucketReplication (Maybe Text)
pbrContentMD5 = lens _pbrContentMD5 (\ s a -> s{_pbrContentMD5 = a});
pbrBucket :: Lens' PutBucketReplication BucketName
pbrBucket = lens _pbrBucket (\ s a -> s{_pbrBucket = a});
pbrReplicationConfiguration :: Lens' PutBucketReplication ReplicationConfiguration
pbrReplicationConfiguration = lens _pbrReplicationConfiguration (\ s a -> s{_pbrReplicationConfiguration = a});
instance AWSRequest PutBucketReplication where
type Rs PutBucketReplication =
PutBucketReplicationResponse
request = putXML s3
response = receiveNull PutBucketReplicationResponse'
instance Hashable PutBucketReplication where
instance NFData PutBucketReplication where
instance ToElement PutBucketReplication where
toElement
= mkElement
"{http://s3.amazonaws.com/doc/2006-03-01/}ReplicationConfiguration"
.
_pbrReplicationConfiguration
instance ToHeaders PutBucketReplication where
toHeaders PutBucketReplication'{..}
= mconcat ["Content-MD5" =# _pbrContentMD5]
instance ToPath PutBucketReplication where
toPath PutBucketReplication'{..}
= mconcat ["/", toBS _pbrBucket]
instance ToQuery PutBucketReplication where
toQuery = const (mconcat ["replication"])
data PutBucketReplicationResponse =
PutBucketReplicationResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
putBucketReplicationResponse
:: PutBucketReplicationResponse
putBucketReplicationResponse = PutBucketReplicationResponse'
instance NFData PutBucketReplicationResponse where