{-# 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.CreateRouteTable
(
createRouteTable
, CreateRouteTable
, crtDryRun
, crtVPCId
, createRouteTableResponse
, CreateRouteTableResponse
, crtrsRouteTable
, crtrsResponseStatus
) 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 CreateRouteTable = CreateRouteTable'
{ _crtDryRun :: !(Maybe Bool)
, _crtVPCId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createRouteTable
:: Text
-> CreateRouteTable
createRouteTable pVPCId_ =
CreateRouteTable'
{ _crtDryRun = Nothing
, _crtVPCId = pVPCId_
}
crtDryRun :: Lens' CreateRouteTable (Maybe Bool)
crtDryRun = lens _crtDryRun (\ s a -> s{_crtDryRun = a});
crtVPCId :: Lens' CreateRouteTable Text
crtVPCId = lens _crtVPCId (\ s a -> s{_crtVPCId = a});
instance AWSRequest CreateRouteTable where
type Rs CreateRouteTable = CreateRouteTableResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
CreateRouteTableResponse' <$>
(x .@? "routeTable") <*> (pure (fromEnum s)))
instance Hashable CreateRouteTable
instance NFData CreateRouteTable
instance ToHeaders CreateRouteTable where
toHeaders = const mempty
instance ToPath CreateRouteTable where
toPath = const "/"
instance ToQuery CreateRouteTable where
toQuery CreateRouteTable'{..}
= mconcat
["Action" =: ("CreateRouteTable" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"DryRun" =: _crtDryRun, "VpcId" =: _crtVPCId]
data CreateRouteTableResponse = CreateRouteTableResponse'
{ _crtrsRouteTable :: !(Maybe RouteTable)
, _crtrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createRouteTableResponse
:: Int
-> CreateRouteTableResponse
createRouteTableResponse pResponseStatus_ =
CreateRouteTableResponse'
{ _crtrsRouteTable = Nothing
, _crtrsResponseStatus = pResponseStatus_
}
crtrsRouteTable :: Lens' CreateRouteTableResponse (Maybe RouteTable)
crtrsRouteTable = lens _crtrsRouteTable (\ s a -> s{_crtrsRouteTable = a});
crtrsResponseStatus :: Lens' CreateRouteTableResponse Int
crtrsResponseStatus = lens _crtrsResponseStatus (\ s a -> s{_crtrsResponseStatus = a});
instance NFData CreateRouteTableResponse