module Network.AWS.StorageGateway.DescribeGatewayInformation
(
DescribeGatewayInformation
, describeGatewayInformation
, dgiGatewayARN
, DescribeGatewayInformationResponse
, describeGatewayInformationResponse
, dgirGatewayARN
, dgirGatewayId
, dgirGatewayNetworkInterfaces
, dgirGatewayState
, dgirGatewayTimezone
, dgirGatewayType
, dgirNextUpdateAvailabilityDate
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.StorageGateway.Types
import qualified GHC.Exts
newtype DescribeGatewayInformation = DescribeGatewayInformation
{ _dgiGatewayARN :: Text
} deriving (Eq, Ord, Read, Show, Monoid, IsString)
describeGatewayInformation :: Text
-> DescribeGatewayInformation
describeGatewayInformation p1 = DescribeGatewayInformation
{ _dgiGatewayARN = p1
}
dgiGatewayARN :: Lens' DescribeGatewayInformation Text
dgiGatewayARN = lens _dgiGatewayARN (\s a -> s { _dgiGatewayARN = a })
data DescribeGatewayInformationResponse = DescribeGatewayInformationResponse
{ _dgirGatewayARN :: Maybe Text
, _dgirGatewayId :: Maybe Text
, _dgirGatewayNetworkInterfaces :: List "GatewayNetworkInterfaces" NetworkInterface
, _dgirGatewayState :: Maybe Text
, _dgirGatewayTimezone :: Maybe Text
, _dgirGatewayType :: Maybe Text
, _dgirNextUpdateAvailabilityDate :: Maybe Text
} deriving (Eq, Read, Show)
describeGatewayInformationResponse :: DescribeGatewayInformationResponse
describeGatewayInformationResponse = DescribeGatewayInformationResponse
{ _dgirGatewayARN = Nothing
, _dgirGatewayId = Nothing
, _dgirGatewayTimezone = Nothing
, _dgirGatewayState = Nothing
, _dgirGatewayNetworkInterfaces = mempty
, _dgirGatewayType = Nothing
, _dgirNextUpdateAvailabilityDate = Nothing
}
dgirGatewayARN :: Lens' DescribeGatewayInformationResponse (Maybe Text)
dgirGatewayARN = lens _dgirGatewayARN (\s a -> s { _dgirGatewayARN = a })
dgirGatewayId :: Lens' DescribeGatewayInformationResponse (Maybe Text)
dgirGatewayId = lens _dgirGatewayId (\s a -> s { _dgirGatewayId = a })
dgirGatewayNetworkInterfaces :: Lens' DescribeGatewayInformationResponse [NetworkInterface]
dgirGatewayNetworkInterfaces =
lens _dgirGatewayNetworkInterfaces
(\s a -> s { _dgirGatewayNetworkInterfaces = a })
. _List
dgirGatewayState :: Lens' DescribeGatewayInformationResponse (Maybe Text)
dgirGatewayState = lens _dgirGatewayState (\s a -> s { _dgirGatewayState = a })
dgirGatewayTimezone :: Lens' DescribeGatewayInformationResponse (Maybe Text)
dgirGatewayTimezone =
lens _dgirGatewayTimezone (\s a -> s { _dgirGatewayTimezone = a })
dgirGatewayType :: Lens' DescribeGatewayInformationResponse (Maybe Text)
dgirGatewayType = lens _dgirGatewayType (\s a -> s { _dgirGatewayType = a })
dgirNextUpdateAvailabilityDate :: Lens' DescribeGatewayInformationResponse (Maybe Text)
dgirNextUpdateAvailabilityDate =
lens _dgirNextUpdateAvailabilityDate
(\s a -> s { _dgirNextUpdateAvailabilityDate = a })
instance ToPath DescribeGatewayInformation where
toPath = const "/"
instance ToQuery DescribeGatewayInformation where
toQuery = const mempty
instance ToHeaders DescribeGatewayInformation
instance ToJSON DescribeGatewayInformation where
toJSON DescribeGatewayInformation{..} = object
[ "GatewayARN" .= _dgiGatewayARN
]
instance AWSRequest DescribeGatewayInformation where
type Sv DescribeGatewayInformation = StorageGateway
type Rs DescribeGatewayInformation = DescribeGatewayInformationResponse
request = post "DescribeGatewayInformation"
response = jsonResponse
instance FromJSON DescribeGatewayInformationResponse where
parseJSON = withObject "DescribeGatewayInformationResponse" $ \o -> DescribeGatewayInformationResponse
<$> o .:? "GatewayARN"
<*> o .:? "GatewayId"
<*> o .:? "GatewayNetworkInterfaces" .!= mempty
<*> o .:? "GatewayState"
<*> o .:? "GatewayTimezone"
<*> o .:? "GatewayType"
<*> o .:? "NextUpdateAvailabilityDate"