module Network.AWS.StorageGateway.StartGateway
(
startGateway
, StartGateway
, sgGatewayARN
, startGatewayResponse
, StartGatewayResponse
, sgrsGatewayARN
, sgrsResponseStatus
) 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 StartGateway = StartGateway'
{ _sgGatewayARN :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startGateway
:: Text
-> StartGateway
startGateway pGatewayARN_ = StartGateway' {_sgGatewayARN = pGatewayARN_}
sgGatewayARN :: Lens' StartGateway Text
sgGatewayARN = lens _sgGatewayARN (\ s a -> s{_sgGatewayARN = a});
instance AWSRequest StartGateway where
type Rs StartGateway = StartGatewayResponse
request = postJSON storageGateway
response
= receiveJSON
(\ s h x ->
StartGatewayResponse' <$>
(x .?> "GatewayARN") <*> (pure (fromEnum s)))
instance Hashable StartGateway where
instance NFData StartGateway where
instance ToHeaders StartGateway where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StorageGateway_20130630.StartGateway" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StartGateway where
toJSON StartGateway'{..}
= object
(catMaybes [Just ("GatewayARN" .= _sgGatewayARN)])
instance ToPath StartGateway where
toPath = const "/"
instance ToQuery StartGateway where
toQuery = const mempty
data StartGatewayResponse = StartGatewayResponse'
{ _sgrsGatewayARN :: !(Maybe Text)
, _sgrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startGatewayResponse
:: Int
-> StartGatewayResponse
startGatewayResponse pResponseStatus_ =
StartGatewayResponse'
{_sgrsGatewayARN = Nothing, _sgrsResponseStatus = pResponseStatus_}
sgrsGatewayARN :: Lens' StartGatewayResponse (Maybe Text)
sgrsGatewayARN = lens _sgrsGatewayARN (\ s a -> s{_sgrsGatewayARN = a});
sgrsResponseStatus :: Lens' StartGatewayResponse Int
sgrsResponseStatus = lens _sgrsResponseStatus (\ s a -> s{_sgrsResponseStatus = a});
instance NFData StartGatewayResponse where