{-# 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.EC2.CreateInternetGateway
(
createInternetGateway
, CreateInternetGateway
, cigDryRun
, createInternetGatewayResponse
, CreateInternetGatewayResponse
, cigrsInternetGateway
, cigrsResponseStatus
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype CreateInternetGateway = CreateInternetGateway'
{ _cigDryRun :: Maybe Bool
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createInternetGateway
:: CreateInternetGateway
createInternetGateway = CreateInternetGateway' {_cigDryRun = Nothing}
cigDryRun :: Lens' CreateInternetGateway (Maybe Bool)
cigDryRun = lens _cigDryRun (\ s a -> s{_cigDryRun = a})
instance AWSRequest CreateInternetGateway where
type Rs CreateInternetGateway =
CreateInternetGatewayResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
CreateInternetGatewayResponse' <$>
(x .@? "internetGateway") <*> (pure (fromEnum s)))
instance Hashable CreateInternetGateway where
instance NFData CreateInternetGateway where
instance ToHeaders CreateInternetGateway where
toHeaders = const mempty
instance ToPath CreateInternetGateway where
toPath = const "/"
instance ToQuery CreateInternetGateway where
toQuery CreateInternetGateway'{..}
= mconcat
["Action" =: ("CreateInternetGateway" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"DryRun" =: _cigDryRun]
data CreateInternetGatewayResponse = CreateInternetGatewayResponse'
{ _cigrsInternetGateway :: !(Maybe InternetGateway)
, _cigrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createInternetGatewayResponse
:: Int
-> CreateInternetGatewayResponse
createInternetGatewayResponse pResponseStatus_ =
CreateInternetGatewayResponse'
{_cigrsInternetGateway = Nothing, _cigrsResponseStatus = pResponseStatus_}
cigrsInternetGateway :: Lens' CreateInternetGatewayResponse (Maybe InternetGateway)
cigrsInternetGateway = lens _cigrsInternetGateway (\ s a -> s{_cigrsInternetGateway = a})
cigrsResponseStatus :: Lens' CreateInternetGatewayResponse Int
cigrsResponseStatus = lens _cigrsResponseStatus (\ s a -> s{_cigrsResponseStatus = a})
instance NFData CreateInternetGatewayResponse where