module Network.AWS.StorageGateway.DescribeBandwidthRateLimit
(
DescribeBandwidthRateLimit
, describeBandwidthRateLimit
, dbrlGatewayARN
, DescribeBandwidthRateLimitResponse
, describeBandwidthRateLimitResponse
, dbrlrAverageDownloadRateLimitInBitsPerSec
, dbrlrAverageUploadRateLimitInBitsPerSec
, dbrlrGatewayARN
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.StorageGateway.Types
import qualified GHC.Exts
newtype DescribeBandwidthRateLimit = DescribeBandwidthRateLimit
{ _dbrlGatewayARN :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
describeBandwidthRateLimit :: Text
-> DescribeBandwidthRateLimit
describeBandwidthRateLimit p1 = DescribeBandwidthRateLimit
{ _dbrlGatewayARN = p1
}
dbrlGatewayARN :: Lens' DescribeBandwidthRateLimit Text
dbrlGatewayARN = lens _dbrlGatewayARN (\s a -> s { _dbrlGatewayARN = a })
data DescribeBandwidthRateLimitResponse = DescribeBandwidthRateLimitResponse
{ _dbrlrAverageDownloadRateLimitInBitsPerSec :: Maybe Nat
, _dbrlrAverageUploadRateLimitInBitsPerSec :: Maybe Nat
, _dbrlrGatewayARN :: Maybe Text
} deriving (Eq, Ord, Show)
describeBandwidthRateLimitResponse :: DescribeBandwidthRateLimitResponse
describeBandwidthRateLimitResponse = DescribeBandwidthRateLimitResponse
{ _dbrlrGatewayARN = Nothing
, _dbrlrAverageUploadRateLimitInBitsPerSec = Nothing
, _dbrlrAverageDownloadRateLimitInBitsPerSec = Nothing
}
dbrlrAverageDownloadRateLimitInBitsPerSec :: Lens' DescribeBandwidthRateLimitResponse (Maybe Natural)
dbrlrAverageDownloadRateLimitInBitsPerSec =
lens _dbrlrAverageDownloadRateLimitInBitsPerSec
(\s a -> s { _dbrlrAverageDownloadRateLimitInBitsPerSec = a })
. mapping _Nat
dbrlrAverageUploadRateLimitInBitsPerSec :: Lens' DescribeBandwidthRateLimitResponse (Maybe Natural)
dbrlrAverageUploadRateLimitInBitsPerSec =
lens _dbrlrAverageUploadRateLimitInBitsPerSec
(\s a -> s { _dbrlrAverageUploadRateLimitInBitsPerSec = a })
. mapping _Nat
dbrlrGatewayARN :: Lens' DescribeBandwidthRateLimitResponse (Maybe Text)
dbrlrGatewayARN = lens _dbrlrGatewayARN (\s a -> s { _dbrlrGatewayARN = a })
instance ToPath DescribeBandwidthRateLimit where
toPath = const "/"
instance ToQuery DescribeBandwidthRateLimit where
toQuery = const mempty
instance ToHeaders DescribeBandwidthRateLimit
instance ToJSON DescribeBandwidthRateLimit where
toJSON DescribeBandwidthRateLimit{..} = object
[ "GatewayARN" .= _dbrlGatewayARN
]
instance AWSRequest DescribeBandwidthRateLimit where
type Sv DescribeBandwidthRateLimit = StorageGateway
type Rs DescribeBandwidthRateLimit = DescribeBandwidthRateLimitResponse
request = post "DescribeBandwidthRateLimit"
response = jsonResponse
instance FromJSON DescribeBandwidthRateLimitResponse where
parseJSON = withObject "DescribeBandwidthRateLimitResponse" $ \o -> DescribeBandwidthRateLimitResponse
<$> o .:? "AverageDownloadRateLimitInBitsPerSec"
<*> o .:? "AverageUploadRateLimitInBitsPerSec"
<*> o .:? "GatewayARN"