{-# 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
, crEgressOnlyInternetGatewayId
, crDestinationIPv6CidrBlock
, crNatGatewayId
, crNetworkInterfaceId
, crGatewayId
, crDryRun
, crDestinationCidrBlock
, crRouteTableId
, 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)
, _crEgressOnlyInternetGatewayId :: !(Maybe Text)
, _crDestinationIPv6CidrBlock :: !(Maybe Text)
, _crNatGatewayId :: !(Maybe Text)
, _crNetworkInterfaceId :: !(Maybe Text)
, _crGatewayId :: !(Maybe Text)
, _crDryRun :: !(Maybe Bool)
, _crDestinationCidrBlock :: !(Maybe Text)
, _crRouteTableId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createRoute
:: Text
-> CreateRoute
createRoute pRouteTableId_ =
CreateRoute'
{ _crVPCPeeringConnectionId = Nothing
, _crInstanceId = Nothing
, _crEgressOnlyInternetGatewayId = Nothing
, _crDestinationIPv6CidrBlock = Nothing
, _crNatGatewayId = Nothing
, _crNetworkInterfaceId = Nothing
, _crGatewayId = Nothing
, _crDryRun = Nothing
, _crDestinationCidrBlock = Nothing
, _crRouteTableId = pRouteTableId_
}
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})
crEgressOnlyInternetGatewayId :: Lens' CreateRoute (Maybe Text)
crEgressOnlyInternetGatewayId = lens _crEgressOnlyInternetGatewayId (\ s a -> s{_crEgressOnlyInternetGatewayId = a})
crDestinationIPv6CidrBlock :: Lens' CreateRoute (Maybe Text)
crDestinationIPv6CidrBlock = lens _crDestinationIPv6CidrBlock (\ s a -> s{_crDestinationIPv6CidrBlock = 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})
crDestinationCidrBlock :: Lens' CreateRoute (Maybe Text)
crDestinationCidrBlock = lens _crDestinationCidrBlock (\ s a -> s{_crDestinationCidrBlock = a})
crRouteTableId :: Lens' CreateRoute Text
crRouteTableId = lens _crRouteTableId (\ s a -> s{_crRouteTableId = 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 where
instance NFData CreateRoute where
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-11-15" :: ByteString),
"VpcPeeringConnectionId" =:
_crVPCPeeringConnectionId,
"InstanceId" =: _crInstanceId,
"EgressOnlyInternetGatewayId" =:
_crEgressOnlyInternetGatewayId,
"DestinationIpv6CidrBlock" =:
_crDestinationIPv6CidrBlock,
"NatGatewayId" =: _crNatGatewayId,
"NetworkInterfaceId" =: _crNetworkInterfaceId,
"GatewayId" =: _crGatewayId, "DryRun" =: _crDryRun,
"DestinationCidrBlock" =: _crDestinationCidrBlock,
"RouteTableId" =: _crRouteTableId]
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 where