{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.S3.ListBucketAnalyticsConfigurations
(
listBucketAnalyticsConfigurations
, ListBucketAnalyticsConfigurations
, lbacContinuationToken
, lbacBucket
, listBucketAnalyticsConfigurationsResponse
, ListBucketAnalyticsConfigurationsResponse
, lbacrsAnalyticsConfigurationList
, lbacrsContinuationToken
, lbacrsNextContinuationToken
, lbacrsIsTruncated
, lbacrsResponseStatus
) 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 ListBucketAnalyticsConfigurations = ListBucketAnalyticsConfigurations'
{ _lbacContinuationToken :: !(Maybe Text)
, _lbacBucket :: !BucketName
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listBucketAnalyticsConfigurations
:: BucketName
-> ListBucketAnalyticsConfigurations
listBucketAnalyticsConfigurations pBucket_ =
ListBucketAnalyticsConfigurations'
{_lbacContinuationToken = Nothing, _lbacBucket = pBucket_}
lbacContinuationToken :: Lens' ListBucketAnalyticsConfigurations (Maybe Text)
lbacContinuationToken = lens _lbacContinuationToken (\ s a -> s{_lbacContinuationToken = a})
lbacBucket :: Lens' ListBucketAnalyticsConfigurations BucketName
lbacBucket = lens _lbacBucket (\ s a -> s{_lbacBucket = a})
instance AWSRequest ListBucketAnalyticsConfigurations
where
type Rs ListBucketAnalyticsConfigurations =
ListBucketAnalyticsConfigurationsResponse
request = get s3
response
= receiveXML
(\ s h x ->
ListBucketAnalyticsConfigurationsResponse' <$>
(may (parseXMLList "AnalyticsConfiguration") x) <*>
(x .@? "ContinuationToken")
<*> (x .@? "NextContinuationToken")
<*> (x .@? "IsTruncated")
<*> (pure (fromEnum s)))
instance Hashable ListBucketAnalyticsConfigurations
where
instance NFData ListBucketAnalyticsConfigurations
where
instance ToHeaders ListBucketAnalyticsConfigurations
where
toHeaders = const mempty
instance ToPath ListBucketAnalyticsConfigurations
where
toPath ListBucketAnalyticsConfigurations'{..}
= mconcat ["/", toBS _lbacBucket]
instance ToQuery ListBucketAnalyticsConfigurations
where
toQuery ListBucketAnalyticsConfigurations'{..}
= mconcat
["continuation-token" =: _lbacContinuationToken,
"analytics"]
data ListBucketAnalyticsConfigurationsResponse = ListBucketAnalyticsConfigurationsResponse'
{ _lbacrsAnalyticsConfigurationList :: !(Maybe [AnalyticsConfiguration])
, _lbacrsContinuationToken :: !(Maybe Text)
, _lbacrsNextContinuationToken :: !(Maybe Text)
, _lbacrsIsTruncated :: !(Maybe Bool)
, _lbacrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listBucketAnalyticsConfigurationsResponse
:: Int
-> ListBucketAnalyticsConfigurationsResponse
listBucketAnalyticsConfigurationsResponse pResponseStatus_ =
ListBucketAnalyticsConfigurationsResponse'
{ _lbacrsAnalyticsConfigurationList = Nothing
, _lbacrsContinuationToken = Nothing
, _lbacrsNextContinuationToken = Nothing
, _lbacrsIsTruncated = Nothing
, _lbacrsResponseStatus = pResponseStatus_
}
lbacrsAnalyticsConfigurationList :: Lens' ListBucketAnalyticsConfigurationsResponse [AnalyticsConfiguration]
lbacrsAnalyticsConfigurationList = lens _lbacrsAnalyticsConfigurationList (\ s a -> s{_lbacrsAnalyticsConfigurationList = a}) . _Default . _Coerce
lbacrsContinuationToken :: Lens' ListBucketAnalyticsConfigurationsResponse (Maybe Text)
lbacrsContinuationToken = lens _lbacrsContinuationToken (\ s a -> s{_lbacrsContinuationToken = a})
lbacrsNextContinuationToken :: Lens' ListBucketAnalyticsConfigurationsResponse (Maybe Text)
lbacrsNextContinuationToken = lens _lbacrsNextContinuationToken (\ s a -> s{_lbacrsNextContinuationToken = a})
lbacrsIsTruncated :: Lens' ListBucketAnalyticsConfigurationsResponse (Maybe Bool)
lbacrsIsTruncated = lens _lbacrsIsTruncated (\ s a -> s{_lbacrsIsTruncated = a})
lbacrsResponseStatus :: Lens' ListBucketAnalyticsConfigurationsResponse Int
lbacrsResponseStatus = lens _lbacrsResponseStatus (\ s a -> s{_lbacrsResponseStatus = a})
instance NFData
ListBucketAnalyticsConfigurationsResponse
where