{-# 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.GetBucketAccelerateConfiguration
(
getBucketAccelerateConfiguration
, GetBucketAccelerateConfiguration
, gbacBucket
, getBucketAccelerateConfigurationResponse
, GetBucketAccelerateConfigurationResponse
, grsStatus
, grsResponseStatus
) 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
newtype GetBucketAccelerateConfiguration = GetBucketAccelerateConfiguration'
{ _gbacBucket :: BucketName
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getBucketAccelerateConfiguration
:: BucketName
-> GetBucketAccelerateConfiguration
getBucketAccelerateConfiguration pBucket_ =
GetBucketAccelerateConfiguration' {_gbacBucket = pBucket_}
gbacBucket :: Lens' GetBucketAccelerateConfiguration BucketName
gbacBucket = lens _gbacBucket (\ s a -> s{_gbacBucket = a})
instance AWSRequest GetBucketAccelerateConfiguration
where
type Rs GetBucketAccelerateConfiguration =
GetBucketAccelerateConfigurationResponse
request = get s3
response
= receiveXML
(\ s h x ->
GetBucketAccelerateConfigurationResponse' <$>
(x .@? "Status") <*> (pure (fromEnum s)))
instance Hashable GetBucketAccelerateConfiguration
where
instance NFData GetBucketAccelerateConfiguration
where
instance ToHeaders GetBucketAccelerateConfiguration
where
toHeaders = const mempty
instance ToPath GetBucketAccelerateConfiguration
where
toPath GetBucketAccelerateConfiguration'{..}
= mconcat ["/", toBS _gbacBucket]
instance ToQuery GetBucketAccelerateConfiguration
where
toQuery = const (mconcat ["accelerate"])
data GetBucketAccelerateConfigurationResponse = GetBucketAccelerateConfigurationResponse'
{ _grsStatus :: !(Maybe BucketAccelerateStatus)
, _grsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getBucketAccelerateConfigurationResponse
:: Int
-> GetBucketAccelerateConfigurationResponse
getBucketAccelerateConfigurationResponse pResponseStatus_ =
GetBucketAccelerateConfigurationResponse'
{_grsStatus = Nothing, _grsResponseStatus = pResponseStatus_}
grsStatus :: Lens' GetBucketAccelerateConfigurationResponse (Maybe BucketAccelerateStatus)
grsStatus = lens _grsStatus (\ s a -> s{_grsStatus = a})
grsResponseStatus :: Lens' GetBucketAccelerateConfigurationResponse Int
grsResponseStatus = lens _grsResponseStatus (\ s a -> s{_grsResponseStatus = a})
instance NFData
GetBucketAccelerateConfigurationResponse
where