{-# 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.StorageGateway.UpdateGatewayInformation
(
updateGatewayInformation
, UpdateGatewayInformation
, ugiGatewayName
, ugiGatewayTimezone
, ugiGatewayARN
, updateGatewayInformationResponse
, UpdateGatewayInformationResponse
, ugirsGatewayARN
, ugirsGatewayName
, ugirsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.StorageGateway.Types
import Network.AWS.StorageGateway.Types.Product
data UpdateGatewayInformation = UpdateGatewayInformation'
{ _ugiGatewayName :: !(Maybe Text)
, _ugiGatewayTimezone :: !(Maybe Text)
, _ugiGatewayARN :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateGatewayInformation
:: Text
-> UpdateGatewayInformation
updateGatewayInformation pGatewayARN_ =
UpdateGatewayInformation'
{ _ugiGatewayName = Nothing
, _ugiGatewayTimezone = Nothing
, _ugiGatewayARN = pGatewayARN_
}
ugiGatewayName :: Lens' UpdateGatewayInformation (Maybe Text)
ugiGatewayName = lens _ugiGatewayName (\ s a -> s{_ugiGatewayName = a})
ugiGatewayTimezone :: Lens' UpdateGatewayInformation (Maybe Text)
ugiGatewayTimezone = lens _ugiGatewayTimezone (\ s a -> s{_ugiGatewayTimezone = a})
ugiGatewayARN :: Lens' UpdateGatewayInformation Text
ugiGatewayARN = lens _ugiGatewayARN (\ s a -> s{_ugiGatewayARN = a})
instance AWSRequest UpdateGatewayInformation where
type Rs UpdateGatewayInformation =
UpdateGatewayInformationResponse
request = postJSON storageGateway
response
= receiveJSON
(\ s h x ->
UpdateGatewayInformationResponse' <$>
(x .?> "GatewayARN") <*> (x .?> "GatewayName") <*>
(pure (fromEnum s)))
instance Hashable UpdateGatewayInformation where
instance NFData UpdateGatewayInformation where
instance ToHeaders UpdateGatewayInformation where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StorageGateway_20130630.UpdateGatewayInformation"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateGatewayInformation where
toJSON UpdateGatewayInformation'{..}
= object
(catMaybes
[("GatewayName" .=) <$> _ugiGatewayName,
("GatewayTimezone" .=) <$> _ugiGatewayTimezone,
Just ("GatewayARN" .= _ugiGatewayARN)])
instance ToPath UpdateGatewayInformation where
toPath = const "/"
instance ToQuery UpdateGatewayInformation where
toQuery = const mempty
data UpdateGatewayInformationResponse = UpdateGatewayInformationResponse'
{ _ugirsGatewayARN :: !(Maybe Text)
, _ugirsGatewayName :: !(Maybe Text)
, _ugirsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateGatewayInformationResponse
:: Int
-> UpdateGatewayInformationResponse
updateGatewayInformationResponse pResponseStatus_ =
UpdateGatewayInformationResponse'
{ _ugirsGatewayARN = Nothing
, _ugirsGatewayName = Nothing
, _ugirsResponseStatus = pResponseStatus_
}
ugirsGatewayARN :: Lens' UpdateGatewayInformationResponse (Maybe Text)
ugirsGatewayARN = lens _ugirsGatewayARN (\ s a -> s{_ugirsGatewayARN = a})
ugirsGatewayName :: Lens' UpdateGatewayInformationResponse (Maybe Text)
ugirsGatewayName = lens _ugirsGatewayName (\ s a -> s{_ugirsGatewayName = a})
ugirsResponseStatus :: Lens' UpdateGatewayInformationResponse Int
ugirsResponseStatus = lens _ugirsResponseStatus (\ s a -> s{_ugirsResponseStatus = a})
instance NFData UpdateGatewayInformationResponse
where