module Network.AWS.S3.GetBucketTagging
(
GetBucketTagging
, getBucketTagging
, gbtBucket
, GetBucketTaggingResponse
, getBucketTaggingResponse
, gbtrTagSet
) where
import Network.AWS.Prelude
import Network.AWS.Request.S3
import Network.AWS.S3.Types
import qualified GHC.Exts
newtype GetBucketTagging = GetBucketTagging
{ _gbtBucket :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
getBucketTagging :: Text
-> GetBucketTagging
getBucketTagging p1 = GetBucketTagging
{ _gbtBucket = p1
}
gbtBucket :: Lens' GetBucketTagging Text
gbtBucket = lens _gbtBucket (\s a -> s { _gbtBucket = a })
newtype GetBucketTaggingResponse = GetBucketTaggingResponse
{ _gbtrTagSet :: List "Tag" Tag
} deriving (Eq, Show, Monoid, Semigroup)
instance GHC.Exts.IsList GetBucketTaggingResponse where
type Item GetBucketTaggingResponse = Tag
fromList = GetBucketTaggingResponse . GHC.Exts.fromList
toList = GHC.Exts.toList . _gbtrTagSet
getBucketTaggingResponse :: GetBucketTaggingResponse
getBucketTaggingResponse = GetBucketTaggingResponse
{ _gbtrTagSet = mempty
}
gbtrTagSet :: Lens' GetBucketTaggingResponse [Tag]
gbtrTagSet = lens _gbtrTagSet (\s a -> s { _gbtrTagSet = a }) . _List
instance ToPath GetBucketTagging where
toPath GetBucketTagging{..} = mconcat
[ "/"
, toText _gbtBucket
]
instance ToQuery GetBucketTagging where
toQuery = const "tagging"
instance ToHeaders GetBucketTagging
instance ToXMLRoot GetBucketTagging where
toXMLRoot = const (namespaced ns "GetBucketTagging" [])
instance ToXML GetBucketTagging
instance AWSRequest GetBucketTagging where
type Sv GetBucketTagging = S3
type Rs GetBucketTagging = GetBucketTaggingResponse
request = get
response = xmlResponse
instance FromXML GetBucketTaggingResponse where
parseXML x = GetBucketTaggingResponse
<$> x .@ "TagSet"