module Network.AWS.S3.ListBucketMetricsConfigurations
(
listBucketMetricsConfigurations
, ListBucketMetricsConfigurations
, lbmcContinuationToken
, lbmcBucket
, listBucketMetricsConfigurationsResponse
, ListBucketMetricsConfigurationsResponse
, lbmcrsContinuationToken
, lbmcrsMetricsConfigurationList
, lbmcrsNextContinuationToken
, lbmcrsIsTruncated
, lbmcrsResponseStatus
) 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 ListBucketMetricsConfigurations = ListBucketMetricsConfigurations'
{ _lbmcContinuationToken :: !(Maybe Text)
, _lbmcBucket :: !BucketName
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listBucketMetricsConfigurations
:: BucketName
-> ListBucketMetricsConfigurations
listBucketMetricsConfigurations pBucket_ =
ListBucketMetricsConfigurations'
{_lbmcContinuationToken = Nothing, _lbmcBucket = pBucket_}
lbmcContinuationToken :: Lens' ListBucketMetricsConfigurations (Maybe Text)
lbmcContinuationToken = lens _lbmcContinuationToken (\ s a -> s{_lbmcContinuationToken = a});
lbmcBucket :: Lens' ListBucketMetricsConfigurations BucketName
lbmcBucket = lens _lbmcBucket (\ s a -> s{_lbmcBucket = a});
instance AWSRequest ListBucketMetricsConfigurations
where
type Rs ListBucketMetricsConfigurations =
ListBucketMetricsConfigurationsResponse
request = get s3
response
= receiveXML
(\ s h x ->
ListBucketMetricsConfigurationsResponse' <$>
(x .@? "ContinuationToken") <*>
(may (parseXMLList "MetricsConfiguration") x)
<*> (x .@? "NextContinuationToken")
<*> (x .@? "IsTruncated")
<*> (pure (fromEnum s)))
instance Hashable ListBucketMetricsConfigurations
where
instance NFData ListBucketMetricsConfigurations where
instance ToHeaders ListBucketMetricsConfigurations
where
toHeaders = const mempty
instance ToPath ListBucketMetricsConfigurations where
toPath ListBucketMetricsConfigurations'{..}
= mconcat ["/", toBS _lbmcBucket]
instance ToQuery ListBucketMetricsConfigurations
where
toQuery ListBucketMetricsConfigurations'{..}
= mconcat
["continuation-token" =: _lbmcContinuationToken,
"metrics"]
data ListBucketMetricsConfigurationsResponse = ListBucketMetricsConfigurationsResponse'
{ _lbmcrsContinuationToken :: !(Maybe Text)
, _lbmcrsMetricsConfigurationList :: !(Maybe [MetricsConfiguration])
, _lbmcrsNextContinuationToken :: !(Maybe Text)
, _lbmcrsIsTruncated :: !(Maybe Bool)
, _lbmcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listBucketMetricsConfigurationsResponse
:: Int
-> ListBucketMetricsConfigurationsResponse
listBucketMetricsConfigurationsResponse pResponseStatus_ =
ListBucketMetricsConfigurationsResponse'
{ _lbmcrsContinuationToken = Nothing
, _lbmcrsMetricsConfigurationList = Nothing
, _lbmcrsNextContinuationToken = Nothing
, _lbmcrsIsTruncated = Nothing
, _lbmcrsResponseStatus = pResponseStatus_
}
lbmcrsContinuationToken :: Lens' ListBucketMetricsConfigurationsResponse (Maybe Text)
lbmcrsContinuationToken = lens _lbmcrsContinuationToken (\ s a -> s{_lbmcrsContinuationToken = a});
lbmcrsMetricsConfigurationList :: Lens' ListBucketMetricsConfigurationsResponse [MetricsConfiguration]
lbmcrsMetricsConfigurationList = lens _lbmcrsMetricsConfigurationList (\ s a -> s{_lbmcrsMetricsConfigurationList = a}) . _Default . _Coerce;
lbmcrsNextContinuationToken :: Lens' ListBucketMetricsConfigurationsResponse (Maybe Text)
lbmcrsNextContinuationToken = lens _lbmcrsNextContinuationToken (\ s a -> s{_lbmcrsNextContinuationToken = a});
lbmcrsIsTruncated :: Lens' ListBucketMetricsConfigurationsResponse (Maybe Bool)
lbmcrsIsTruncated = lens _lbmcrsIsTruncated (\ s a -> s{_lbmcrsIsTruncated = a});
lbmcrsResponseStatus :: Lens' ListBucketMetricsConfigurationsResponse Int
lbmcrsResponseStatus = lens _lbmcrsResponseStatus (\ s a -> s{_lbmcrsResponseStatus = a});
instance NFData
ListBucketMetricsConfigurationsResponse
where