{-# 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.CreateEgressOnlyInternetGateway
(
createEgressOnlyInternetGateway
, CreateEgressOnlyInternetGateway
, ceoigClientToken
, ceoigDryRun
, ceoigVPCId
, createEgressOnlyInternetGatewayResponse
, CreateEgressOnlyInternetGatewayResponse
, ceoigrsClientToken
, ceoigrsEgressOnlyInternetGateway
, ceoigrsResponseStatus
) 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
data CreateEgressOnlyInternetGateway = CreateEgressOnlyInternetGateway'
{ _ceoigClientToken :: !(Maybe Text)
, _ceoigDryRun :: !(Maybe Bool)
, _ceoigVPCId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createEgressOnlyInternetGateway
:: Text
-> CreateEgressOnlyInternetGateway
createEgressOnlyInternetGateway pVPCId_ =
CreateEgressOnlyInternetGateway'
{_ceoigClientToken = Nothing, _ceoigDryRun = Nothing, _ceoigVPCId = pVPCId_}
ceoigClientToken :: Lens' CreateEgressOnlyInternetGateway (Maybe Text)
ceoigClientToken = lens _ceoigClientToken (\ s a -> s{_ceoigClientToken = a})
ceoigDryRun :: Lens' CreateEgressOnlyInternetGateway (Maybe Bool)
ceoigDryRun = lens _ceoigDryRun (\ s a -> s{_ceoigDryRun = a})
ceoigVPCId :: Lens' CreateEgressOnlyInternetGateway Text
ceoigVPCId = lens _ceoigVPCId (\ s a -> s{_ceoigVPCId = a})
instance AWSRequest CreateEgressOnlyInternetGateway
where
type Rs CreateEgressOnlyInternetGateway =
CreateEgressOnlyInternetGatewayResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
CreateEgressOnlyInternetGatewayResponse' <$>
(x .@? "clientToken") <*>
(x .@? "egressOnlyInternetGateway")
<*> (pure (fromEnum s)))
instance Hashable CreateEgressOnlyInternetGateway
where
instance NFData CreateEgressOnlyInternetGateway where
instance ToHeaders CreateEgressOnlyInternetGateway
where
toHeaders = const mempty
instance ToPath CreateEgressOnlyInternetGateway where
toPath = const "/"
instance ToQuery CreateEgressOnlyInternetGateway
where
toQuery CreateEgressOnlyInternetGateway'{..}
= mconcat
["Action" =:
("CreateEgressOnlyInternetGateway" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"ClientToken" =: _ceoigClientToken,
"DryRun" =: _ceoigDryRun, "VpcId" =: _ceoigVPCId]
data CreateEgressOnlyInternetGatewayResponse = CreateEgressOnlyInternetGatewayResponse'
{ _ceoigrsClientToken :: !(Maybe Text)
, _ceoigrsEgressOnlyInternetGateway :: !(Maybe EgressOnlyInternetGateway)
, _ceoigrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createEgressOnlyInternetGatewayResponse
:: Int
-> CreateEgressOnlyInternetGatewayResponse
createEgressOnlyInternetGatewayResponse pResponseStatus_ =
CreateEgressOnlyInternetGatewayResponse'
{ _ceoigrsClientToken = Nothing
, _ceoigrsEgressOnlyInternetGateway = Nothing
, _ceoigrsResponseStatus = pResponseStatus_
}
ceoigrsClientToken :: Lens' CreateEgressOnlyInternetGatewayResponse (Maybe Text)
ceoigrsClientToken = lens _ceoigrsClientToken (\ s a -> s{_ceoigrsClientToken = a})
ceoigrsEgressOnlyInternetGateway :: Lens' CreateEgressOnlyInternetGatewayResponse (Maybe EgressOnlyInternetGateway)
ceoigrsEgressOnlyInternetGateway = lens _ceoigrsEgressOnlyInternetGateway (\ s a -> s{_ceoigrsEgressOnlyInternetGateway = a})
ceoigrsResponseStatus :: Lens' CreateEgressOnlyInternetGatewayResponse Int
ceoigrsResponseStatus = lens _ceoigrsResponseStatus (\ s a -> s{_ceoigrsResponseStatus = a})
instance NFData
CreateEgressOnlyInternetGatewayResponse
where