{-# 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.Snowball.GetSnowballUsage
(
getSnowballUsage
, GetSnowballUsage
, getSnowballUsageResponse
, GetSnowballUsageResponse
, gsursSnowballsInUse
, gsursSnowballLimit
, gsursResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.Snowball.Types
import Network.AWS.Snowball.Types.Product
data GetSnowballUsage =
GetSnowballUsage'
deriving (Eq, Read, Show, Data, Typeable, Generic)
getSnowballUsage
:: GetSnowballUsage
getSnowballUsage = GetSnowballUsage'
instance AWSRequest GetSnowballUsage where
type Rs GetSnowballUsage = GetSnowballUsageResponse
request = postJSON snowball
response
= receiveJSON
(\ s h x ->
GetSnowballUsageResponse' <$>
(x .?> "SnowballsInUse") <*> (x .?> "SnowballLimit")
<*> (pure (fromEnum s)))
instance Hashable GetSnowballUsage where
instance NFData GetSnowballUsage where
instance ToHeaders GetSnowballUsage where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSIESnowballJobManagementService.GetSnowballUsage"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetSnowballUsage where
toJSON = const (Object mempty)
instance ToPath GetSnowballUsage where
toPath = const "/"
instance ToQuery GetSnowballUsage where
toQuery = const mempty
data GetSnowballUsageResponse = GetSnowballUsageResponse'
{ _gsursSnowballsInUse :: !(Maybe Int)
, _gsursSnowballLimit :: !(Maybe Int)
, _gsursResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getSnowballUsageResponse
:: Int
-> GetSnowballUsageResponse
getSnowballUsageResponse pResponseStatus_ =
GetSnowballUsageResponse'
{ _gsursSnowballsInUse = Nothing
, _gsursSnowballLimit = Nothing
, _gsursResponseStatus = pResponseStatus_
}
gsursSnowballsInUse :: Lens' GetSnowballUsageResponse (Maybe Int)
gsursSnowballsInUse = lens _gsursSnowballsInUse (\ s a -> s{_gsursSnowballsInUse = a})
gsursSnowballLimit :: Lens' GetSnowballUsageResponse (Maybe Int)
gsursSnowballLimit = lens _gsursSnowballLimit (\ s a -> s{_gsursSnowballLimit = a})
gsursResponseStatus :: Lens' GetSnowballUsageResponse Int
gsursResponseStatus = lens _gsursResponseStatus (\ s a -> s{_gsursResponseStatus = a})
instance NFData GetSnowballUsageResponse where