{-# 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.GetBucketMetricsConfiguration
(
getBucketMetricsConfiguration
, GetBucketMetricsConfiguration
, gbmcBucket
, gbmcId
, getBucketMetricsConfigurationResponse
, GetBucketMetricsConfigurationResponse
, gbmcrsMetricsConfiguration
, gbmcrsResponseStatus
) 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 GetBucketMetricsConfiguration = GetBucketMetricsConfiguration'
{ _gbmcBucket :: !BucketName
, _gbmcId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getBucketMetricsConfiguration
:: BucketName
-> Text
-> GetBucketMetricsConfiguration
getBucketMetricsConfiguration pBucket_ pId_ =
GetBucketMetricsConfiguration' {_gbmcBucket = pBucket_, _gbmcId = pId_}
gbmcBucket :: Lens' GetBucketMetricsConfiguration BucketName
gbmcBucket = lens _gbmcBucket (\ s a -> s{_gbmcBucket = a})
gbmcId :: Lens' GetBucketMetricsConfiguration Text
gbmcId = lens _gbmcId (\ s a -> s{_gbmcId = a})
instance AWSRequest GetBucketMetricsConfiguration
where
type Rs GetBucketMetricsConfiguration =
GetBucketMetricsConfigurationResponse
request = get s3
response
= receiveXML
(\ s h x ->
GetBucketMetricsConfigurationResponse' <$>
(parseXML x) <*> (pure (fromEnum s)))
instance Hashable GetBucketMetricsConfiguration where
instance NFData GetBucketMetricsConfiguration where
instance ToHeaders GetBucketMetricsConfiguration
where
toHeaders = const mempty
instance ToPath GetBucketMetricsConfiguration where
toPath GetBucketMetricsConfiguration'{..}
= mconcat ["/", toBS _gbmcBucket]
instance ToQuery GetBucketMetricsConfiguration where
toQuery GetBucketMetricsConfiguration'{..}
= mconcat ["id" =: _gbmcId, "metrics"]
data GetBucketMetricsConfigurationResponse = GetBucketMetricsConfigurationResponse'
{ _gbmcrsMetricsConfiguration :: !(Maybe MetricsConfiguration)
, _gbmcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getBucketMetricsConfigurationResponse
:: Int
-> GetBucketMetricsConfigurationResponse
getBucketMetricsConfigurationResponse pResponseStatus_ =
GetBucketMetricsConfigurationResponse'
{ _gbmcrsMetricsConfiguration = Nothing
, _gbmcrsResponseStatus = pResponseStatus_
}
gbmcrsMetricsConfiguration :: Lens' GetBucketMetricsConfigurationResponse (Maybe MetricsConfiguration)
gbmcrsMetricsConfiguration = lens _gbmcrsMetricsConfiguration (\ s a -> s{_gbmcrsMetricsConfiguration = a})
gbmcrsResponseStatus :: Lens' GetBucketMetricsConfigurationResponse Int
gbmcrsResponseStatus = lens _gbmcrsResponseStatus (\ s a -> s{_gbmcrsResponseStatus = a})
instance NFData GetBucketMetricsConfigurationResponse
where