module Network.AWS.S3.GetBucketReplication
(
GetBucketReplication
, getBucketReplication
, gbrBucket
, GetBucketReplicationResponse
, getBucketReplicationResponse
, gbrrReplicationConfiguration
) where
import Network.AWS.Prelude
import Network.AWS.Request.S3
import Network.AWS.S3.Types
import qualified GHC.Exts
newtype GetBucketReplication = GetBucketReplication
{ _gbrBucket :: Text
} deriving (Eq, Ord, Read, Show, Monoid, IsString)
getBucketReplication :: Text
-> GetBucketReplication
getBucketReplication p1 = GetBucketReplication
{ _gbrBucket = p1
}
gbrBucket :: Lens' GetBucketReplication Text
gbrBucket = lens _gbrBucket (\s a -> s { _gbrBucket = a })
newtype GetBucketReplicationResponse = GetBucketReplicationResponse
{ _gbrrReplicationConfiguration :: Maybe ReplicationConfiguration
} deriving (Eq, Read, Show)
getBucketReplicationResponse :: GetBucketReplicationResponse
getBucketReplicationResponse = GetBucketReplicationResponse
{ _gbrrReplicationConfiguration = Nothing
}
gbrrReplicationConfiguration :: Lens' GetBucketReplicationResponse (Maybe ReplicationConfiguration)
gbrrReplicationConfiguration =
lens _gbrrReplicationConfiguration
(\s a -> s { _gbrrReplicationConfiguration = a })
instance ToPath GetBucketReplication where
toPath GetBucketReplication{..} = mconcat
[ "/"
, toText _gbrBucket
]
instance ToQuery GetBucketReplication where
toQuery = const "replication"
instance ToHeaders GetBucketReplication
instance ToXMLRoot GetBucketReplication where
toXMLRoot = const (namespaced ns "GetBucketReplication" [])
instance ToXML GetBucketReplication
instance AWSRequest GetBucketReplication where
type Sv GetBucketReplication = S3
type Rs GetBucketReplication = GetBucketReplicationResponse
request = get
response = xmlResponse
instance FromXML GetBucketReplicationResponse where
parseXML x = GetBucketReplicationResponse
<$> x .@? "ReplicationConfiguration"