module Network.AWS.StorageGateway.DescribeGatewayInformation
(
describeGatewayInformation
, DescribeGatewayInformation
, dgiGatewayARN
, describeGatewayInformationResponse
, DescribeGatewayInformationResponse
, dgirsGatewayState
, dgirsGatewayARN
, dgirsGatewayNetworkInterfaces
, dgirsNextUpdateAvailabilityDate
, dgirsLastSoftwareUpdate
, dgirsGatewayName
, dgirsGatewayId
, dgirsGatewayType
, dgirsGatewayTimezone
, dgirsResponseStatus
) where
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.StorageGateway.Types
import Network.AWS.StorageGateway.Types.Product
newtype DescribeGatewayInformation = DescribeGatewayInformation'
{ _dgiGatewayARN :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeGatewayInformation
:: Text
-> DescribeGatewayInformation
describeGatewayInformation pGatewayARN_ =
DescribeGatewayInformation'
{ _dgiGatewayARN = pGatewayARN_
}
dgiGatewayARN :: Lens' DescribeGatewayInformation Text
dgiGatewayARN = lens _dgiGatewayARN (\ s a -> s{_dgiGatewayARN = a});
instance AWSRequest DescribeGatewayInformation where
type Rs DescribeGatewayInformation =
DescribeGatewayInformationResponse
request = postJSON storageGateway
response
= receiveJSON
(\ s h x ->
DescribeGatewayInformationResponse' <$>
(x .?> "GatewayState") <*> (x .?> "GatewayARN") <*>
(x .?> "GatewayNetworkInterfaces" .!@ mempty)
<*> (x .?> "NextUpdateAvailabilityDate")
<*> (x .?> "LastSoftwareUpdate")
<*> (x .?> "GatewayName")
<*> (x .?> "GatewayId")
<*> (x .?> "GatewayType")
<*> (x .?> "GatewayTimezone")
<*> (pure (fromEnum s)))
instance ToHeaders DescribeGatewayInformation where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StorageGateway_20130630.DescribeGatewayInformation"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeGatewayInformation where
toJSON DescribeGatewayInformation'{..}
= object
(catMaybes [Just ("GatewayARN" .= _dgiGatewayARN)])
instance ToPath DescribeGatewayInformation where
toPath = const "/"
instance ToQuery DescribeGatewayInformation where
toQuery = const mempty
data DescribeGatewayInformationResponse = DescribeGatewayInformationResponse'
{ _dgirsGatewayState :: !(Maybe Text)
, _dgirsGatewayARN :: !(Maybe Text)
, _dgirsGatewayNetworkInterfaces :: !(Maybe [NetworkInterface])
, _dgirsNextUpdateAvailabilityDate :: !(Maybe Text)
, _dgirsLastSoftwareUpdate :: !(Maybe Text)
, _dgirsGatewayName :: !(Maybe Text)
, _dgirsGatewayId :: !(Maybe Text)
, _dgirsGatewayType :: !(Maybe Text)
, _dgirsGatewayTimezone :: !(Maybe Text)
, _dgirsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeGatewayInformationResponse
:: Int
-> DescribeGatewayInformationResponse
describeGatewayInformationResponse pResponseStatus_ =
DescribeGatewayInformationResponse'
{ _dgirsGatewayState = Nothing
, _dgirsGatewayARN = Nothing
, _dgirsGatewayNetworkInterfaces = Nothing
, _dgirsNextUpdateAvailabilityDate = Nothing
, _dgirsLastSoftwareUpdate = Nothing
, _dgirsGatewayName = Nothing
, _dgirsGatewayId = Nothing
, _dgirsGatewayType = Nothing
, _dgirsGatewayTimezone = Nothing
, _dgirsResponseStatus = pResponseStatus_
}
dgirsGatewayState :: Lens' DescribeGatewayInformationResponse (Maybe Text)
dgirsGatewayState = lens _dgirsGatewayState (\ s a -> s{_dgirsGatewayState = a});
dgirsGatewayARN :: Lens' DescribeGatewayInformationResponse (Maybe Text)
dgirsGatewayARN = lens _dgirsGatewayARN (\ s a -> s{_dgirsGatewayARN = a});
dgirsGatewayNetworkInterfaces :: Lens' DescribeGatewayInformationResponse [NetworkInterface]
dgirsGatewayNetworkInterfaces = lens _dgirsGatewayNetworkInterfaces (\ s a -> s{_dgirsGatewayNetworkInterfaces = a}) . _Default . _Coerce;
dgirsNextUpdateAvailabilityDate :: Lens' DescribeGatewayInformationResponse (Maybe Text)
dgirsNextUpdateAvailabilityDate = lens _dgirsNextUpdateAvailabilityDate (\ s a -> s{_dgirsNextUpdateAvailabilityDate = a});
dgirsLastSoftwareUpdate :: Lens' DescribeGatewayInformationResponse (Maybe Text)
dgirsLastSoftwareUpdate = lens _dgirsLastSoftwareUpdate (\ s a -> s{_dgirsLastSoftwareUpdate = a});
dgirsGatewayName :: Lens' DescribeGatewayInformationResponse (Maybe Text)
dgirsGatewayName = lens _dgirsGatewayName (\ s a -> s{_dgirsGatewayName = a});
dgirsGatewayId :: Lens' DescribeGatewayInformationResponse (Maybe Text)
dgirsGatewayId = lens _dgirsGatewayId (\ s a -> s{_dgirsGatewayId = a});
dgirsGatewayType :: Lens' DescribeGatewayInformationResponse (Maybe Text)
dgirsGatewayType = lens _dgirsGatewayType (\ s a -> s{_dgirsGatewayType = a});
dgirsGatewayTimezone :: Lens' DescribeGatewayInformationResponse (Maybe Text)
dgirsGatewayTimezone = lens _dgirsGatewayTimezone (\ s a -> s{_dgirsGatewayTimezone = a});
dgirsResponseStatus :: Lens' DescribeGatewayInformationResponse Int
dgirsResponseStatus = lens _dgirsResponseStatus (\ s a -> s{_dgirsResponseStatus = a});