module Network.AWS.StorageGateway.UpdateGatewayInformation
    (
    
      updateGatewayInformation
    , UpdateGatewayInformation
    
    , ugiGatewayName
    , ugiGatewayTimezone
    , ugiGatewayARN
    
    , updateGatewayInformationResponse
    , UpdateGatewayInformationResponse
    
    , ugirsGatewayARN
    , ugirsStatus
    ) where
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") <*> (pure (fromEnum s)))
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)
    , _ugirsStatus     :: !Int
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
updateGatewayInformationResponse
    :: Int 
    -> UpdateGatewayInformationResponse
updateGatewayInformationResponse pStatus_ =
    UpdateGatewayInformationResponse'
    { _ugirsGatewayARN = Nothing
    , _ugirsStatus = pStatus_
    }
ugirsGatewayARN :: Lens' UpdateGatewayInformationResponse (Maybe Text)
ugirsGatewayARN = lens _ugirsGatewayARN (\ s a -> s{_ugirsGatewayARN = a});
ugirsStatus :: Lens' UpdateGatewayInformationResponse Int
ugirsStatus = lens _ugirsStatus (\ s a -> s{_ugirsStatus = a});