module Network.AWS.StorageGateway.DisableGateway
(
disableGateway
, DisableGateway
, dGatewayARN
, disableGatewayResponse
, DisableGatewayResponse
, disrsGatewayARN
, disrsStatus
) 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 DisableGateway = DisableGateway'
{ _dGatewayARN :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
disableGateway
:: Text
-> DisableGateway
disableGateway pGatewayARN_ =
DisableGateway'
{ _dGatewayARN = pGatewayARN_
}
dGatewayARN :: Lens' DisableGateway Text
dGatewayARN = lens _dGatewayARN (\ s a -> s{_dGatewayARN = a});
instance AWSRequest DisableGateway where
type Rs DisableGateway = DisableGatewayResponse
request = postJSON storageGateway
response
= receiveJSON
(\ s h x ->
DisableGatewayResponse' <$>
(x .?> "GatewayARN") <*> (pure (fromEnum s)))
instance ToHeaders DisableGateway where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StorageGateway_20130630.DisableGateway" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DisableGateway where
toJSON DisableGateway'{..}
= object
(catMaybes [Just ("GatewayARN" .= _dGatewayARN)])
instance ToPath DisableGateway where
toPath = const "/"
instance ToQuery DisableGateway where
toQuery = const mempty
data DisableGatewayResponse = DisableGatewayResponse'
{ _disrsGatewayARN :: !(Maybe Text)
, _disrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
disableGatewayResponse
:: Int
-> DisableGatewayResponse
disableGatewayResponse pStatus_ =
DisableGatewayResponse'
{ _disrsGatewayARN = Nothing
, _disrsStatus = pStatus_
}
disrsGatewayARN :: Lens' DisableGatewayResponse (Maybe Text)
disrsGatewayARN = lens _disrsGatewayARN (\ s a -> s{_disrsGatewayARN = a});
disrsStatus :: Lens' DisableGatewayResponse Int
disrsStatus = lens _disrsStatus (\ s a -> s{_disrsStatus = a});