{-# 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.CreateRoute
(
createRoute
, CreateRoute
, crVPCPeeringConnectionId
, crInstanceId
, crNatGatewayId
, crNetworkInterfaceId
, crGatewayId
, crDryRun
, crRouteTableId
, crDestinationCIdRBlock
, createRouteResponse
, CreateRouteResponse
, crrsReturn
, crrsResponseStatus
) 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 CreateRoute = CreateRoute'
{ _crVPCPeeringConnectionId :: !(Maybe Text)
, _crInstanceId :: !(Maybe Text)
, _crNatGatewayId :: !(Maybe Text)
, _crNetworkInterfaceId :: !(Maybe Text)
, _crGatewayId :: !(Maybe Text)
, _crDryRun :: !(Maybe Bool)
, _crRouteTableId :: !Text
, _crDestinationCIdRBlock :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createRoute
:: Text
-> Text
-> CreateRoute
createRoute pRouteTableId_ pDestinationCIdRBlock_ =
CreateRoute'
{ _crVPCPeeringConnectionId = Nothing
, _crInstanceId = Nothing
, _crNatGatewayId = Nothing
, _crNetworkInterfaceId = Nothing
, _crGatewayId = Nothing
, _crDryRun = Nothing
, _crRouteTableId = pRouteTableId_
, _crDestinationCIdRBlock = pDestinationCIdRBlock_
}
crVPCPeeringConnectionId :: Lens' CreateRoute (Maybe Text)
crVPCPeeringConnectionId = lens _crVPCPeeringConnectionId (\ s a -> s{_crVPCPeeringConnectionId = a});
crInstanceId :: Lens' CreateRoute (Maybe Text)
crInstanceId = lens _crInstanceId (\ s a -> s{_crInstanceId = a});
crNatGatewayId :: Lens' CreateRoute (Maybe Text)
crNatGatewayId = lens _crNatGatewayId (\ s a -> s{_crNatGatewayId = a});
crNetworkInterfaceId :: Lens' CreateRoute (Maybe Text)
crNetworkInterfaceId = lens _crNetworkInterfaceId (\ s a -> s{_crNetworkInterfaceId = a});
crGatewayId :: Lens' CreateRoute (Maybe Text)
crGatewayId = lens _crGatewayId (\ s a -> s{_crGatewayId = a});
crDryRun :: Lens' CreateRoute (Maybe Bool)
crDryRun = lens _crDryRun (\ s a -> s{_crDryRun = a});
crRouteTableId :: Lens' CreateRoute Text
crRouteTableId = lens _crRouteTableId (\ s a -> s{_crRouteTableId = a});
crDestinationCIdRBlock :: Lens' CreateRoute Text
crDestinationCIdRBlock = lens _crDestinationCIdRBlock (\ s a -> s{_crDestinationCIdRBlock = a});
instance AWSRequest CreateRoute where
type Rs CreateRoute = CreateRouteResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
CreateRouteResponse' <$>
(x .@? "return") <*> (pure (fromEnum s)))
instance Hashable CreateRoute
instance NFData CreateRoute
instance ToHeaders CreateRoute where
toHeaders = const mempty
instance ToPath CreateRoute where
toPath = const "/"
instance ToQuery CreateRoute where
toQuery CreateRoute'{..}
= mconcat
["Action" =: ("CreateRoute" :: ByteString),
"Version" =: ("2016-04-01" :: ByteString),
"VpcPeeringConnectionId" =:
_crVPCPeeringConnectionId,
"InstanceId" =: _crInstanceId,
"NatGatewayId" =: _crNatGatewayId,
"NetworkInterfaceId" =: _crNetworkInterfaceId,
"GatewayId" =: _crGatewayId, "DryRun" =: _crDryRun,
"RouteTableId" =: _crRouteTableId,
"DestinationCidrBlock" =: _crDestinationCIdRBlock]
data CreateRouteResponse = CreateRouteResponse'
{ _crrsReturn :: !(Maybe Bool)
, _crrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createRouteResponse
:: Int
-> CreateRouteResponse
createRouteResponse pResponseStatus_ =
CreateRouteResponse'
{ _crrsReturn = Nothing
, _crrsResponseStatus = pResponseStatus_
}
crrsReturn :: Lens' CreateRouteResponse (Maybe Bool)
crrsReturn = lens _crrsReturn (\ s a -> s{_crrsReturn = a});
crrsResponseStatus :: Lens' CreateRouteResponse Int
crrsResponseStatus = lens _crrsResponseStatus (\ s a -> s{_crrsResponseStatus = a});
instance NFData CreateRouteResponse