module Network.AWS.S3.GetBucketLogging
(
GetBucketLogging
, getBucketLogging
, gbl2Bucket
, GetBucketLoggingResponse
, getBucketLoggingResponse
, gblrLoggingEnabled
) where
import Network.AWS.Prelude
import Network.AWS.Request.S3
import Network.AWS.S3.Types
import qualified GHC.Exts
newtype GetBucketLogging = GetBucketLogging
{ _gbl2Bucket :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
getBucketLogging :: Text
-> GetBucketLogging
getBucketLogging p1 = GetBucketLogging
{ _gbl2Bucket = p1
}
gbl2Bucket :: Lens' GetBucketLogging Text
gbl2Bucket = lens _gbl2Bucket (\s a -> s { _gbl2Bucket = a })
newtype GetBucketLoggingResponse = GetBucketLoggingResponse
{ _gblrLoggingEnabled :: Maybe LoggingEnabled
} deriving (Eq, Show)
getBucketLoggingResponse :: GetBucketLoggingResponse
getBucketLoggingResponse = GetBucketLoggingResponse
{ _gblrLoggingEnabled = Nothing
}
gblrLoggingEnabled :: Lens' GetBucketLoggingResponse (Maybe LoggingEnabled)
gblrLoggingEnabled =
lens _gblrLoggingEnabled (\s a -> s { _gblrLoggingEnabled = a })
instance ToPath GetBucketLogging where
toPath GetBucketLogging{..} = mconcat
[ "/"
, toText _gbl2Bucket
]
instance ToQuery GetBucketLogging where
toQuery = const "logging"
instance ToHeaders GetBucketLogging
instance ToXMLRoot GetBucketLogging where
toXMLRoot = const (namespaced ns "GetBucketLogging" [])
instance ToXML GetBucketLogging
instance AWSRequest GetBucketLogging where
type Sv GetBucketLogging = S3
type Rs GetBucketLogging = GetBucketLoggingResponse
request = get
response = xmlResponse
instance FromXML GetBucketLoggingResponse where
parseXML x = GetBucketLoggingResponse
<$> x .@? "LoggingEnabled"