module Network.AWS.S3.GetBucketLifecycle
(
GetBucketLifecycle
, getBucketLifecycle
, gbl1Bucket
, GetBucketLifecycleResponse
, getBucketLifecycleResponse
, gblrRules
) where
import Network.AWS.Prelude
import Network.AWS.Request.S3
import Network.AWS.S3.Types
import qualified GHC.Exts
newtype GetBucketLifecycle = GetBucketLifecycle
{ _gbl1Bucket :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
getBucketLifecycle :: Text
-> GetBucketLifecycle
getBucketLifecycle p1 = GetBucketLifecycle
{ _gbl1Bucket = p1
}
gbl1Bucket :: Lens' GetBucketLifecycle Text
gbl1Bucket = lens _gbl1Bucket (\s a -> s { _gbl1Bucket = a })
newtype GetBucketLifecycleResponse = GetBucketLifecycleResponse
{ _gblrRules :: List "Rule" Rule
} deriving (Eq, Show, Monoid, Semigroup)
getBucketLifecycleResponse :: GetBucketLifecycleResponse
getBucketLifecycleResponse = GetBucketLifecycleResponse
{ _gblrRules = mempty
}
gblrRules :: Lens' GetBucketLifecycleResponse [Rule]
gblrRules = lens _gblrRules (\s a -> s { _gblrRules = a }) . _List
instance ToPath GetBucketLifecycle where
toPath GetBucketLifecycle{..} = mconcat
[ "/"
, toText _gbl1Bucket
]
instance ToQuery GetBucketLifecycle where
toQuery = const "lifecycle"
instance ToHeaders GetBucketLifecycle
instance ToXMLRoot GetBucketLifecycle where
toXMLRoot = const (namespaced ns "GetBucketLifecycle" [])
instance ToXML GetBucketLifecycle
instance AWSRequest GetBucketLifecycle where
type Sv GetBucketLifecycle = S3
type Rs GetBucketLifecycle = GetBucketLifecycleResponse
request = get
response = xmlResponse
instance FromXML GetBucketLifecycleResponse where
parseXML x = GetBucketLifecycleResponse
<$> parseXML x