{-# 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.ShutdownGateway
(
shutdownGateway
, ShutdownGateway
, sGatewayARN
, shutdownGatewayResponse
, ShutdownGatewayResponse
, srsGatewayARN
, srsResponseStatus
) 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
newtype ShutdownGateway = ShutdownGateway'
{ _sGatewayARN :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
shutdownGateway
:: Text
-> ShutdownGateway
shutdownGateway pGatewayARN_ = ShutdownGateway' {_sGatewayARN = pGatewayARN_}
sGatewayARN :: Lens' ShutdownGateway Text
sGatewayARN = lens _sGatewayARN (\ s a -> s{_sGatewayARN = a})
instance AWSRequest ShutdownGateway where
type Rs ShutdownGateway = ShutdownGatewayResponse
request = postJSON storageGateway
response
= receiveJSON
(\ s h x ->
ShutdownGatewayResponse' <$>
(x .?> "GatewayARN") <*> (pure (fromEnum s)))
instance Hashable ShutdownGateway where
instance NFData ShutdownGateway where
instance ToHeaders ShutdownGateway where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StorageGateway_20130630.ShutdownGateway" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ShutdownGateway where
toJSON ShutdownGateway'{..}
= object
(catMaybes [Just ("GatewayARN" .= _sGatewayARN)])
instance ToPath ShutdownGateway where
toPath = const "/"
instance ToQuery ShutdownGateway where
toQuery = const mempty
data ShutdownGatewayResponse = ShutdownGatewayResponse'
{ _srsGatewayARN :: !(Maybe Text)
, _srsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
shutdownGatewayResponse
:: Int
-> ShutdownGatewayResponse
shutdownGatewayResponse pResponseStatus_ =
ShutdownGatewayResponse'
{_srsGatewayARN = Nothing, _srsResponseStatus = pResponseStatus_}
srsGatewayARN :: Lens' ShutdownGatewayResponse (Maybe Text)
srsGatewayARN = lens _srsGatewayARN (\ s a -> s{_srsGatewayARN = a})
srsResponseStatus :: Lens' ShutdownGatewayResponse Int
srsResponseStatus = lens _srsResponseStatus (\ s a -> s{_srsResponseStatus = a})
instance NFData ShutdownGatewayResponse where