{-# 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.AssociateRouteTable
(
associateRouteTable
, AssociateRouteTable
, artDryRun
, artRouteTableId
, artSubnetId
, associateRouteTableResponse
, AssociateRouteTableResponse
, artrsAssociationId
, artrsResponseStatus
) 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 AssociateRouteTable = AssociateRouteTable'
{ _artDryRun :: !(Maybe Bool)
, _artRouteTableId :: !Text
, _artSubnetId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateRouteTable
:: Text
-> Text
-> AssociateRouteTable
associateRouteTable pRouteTableId_ pSubnetId_ =
AssociateRouteTable'
{ _artDryRun = Nothing
, _artRouteTableId = pRouteTableId_
, _artSubnetId = pSubnetId_
}
artDryRun :: Lens' AssociateRouteTable (Maybe Bool)
artDryRun = lens _artDryRun (\ s a -> s{_artDryRun = a})
artRouteTableId :: Lens' AssociateRouteTable Text
artRouteTableId = lens _artRouteTableId (\ s a -> s{_artRouteTableId = a})
artSubnetId :: Lens' AssociateRouteTable Text
artSubnetId = lens _artSubnetId (\ s a -> s{_artSubnetId = a})
instance AWSRequest AssociateRouteTable where
type Rs AssociateRouteTable =
AssociateRouteTableResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
AssociateRouteTableResponse' <$>
(x .@? "associationId") <*> (pure (fromEnum s)))
instance Hashable AssociateRouteTable where
instance NFData AssociateRouteTable where
instance ToHeaders AssociateRouteTable where
toHeaders = const mempty
instance ToPath AssociateRouteTable where
toPath = const "/"
instance ToQuery AssociateRouteTable where
toQuery AssociateRouteTable'{..}
= mconcat
["Action" =: ("AssociateRouteTable" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"DryRun" =: _artDryRun,
"RouteTableId" =: _artRouteTableId,
"SubnetId" =: _artSubnetId]
data AssociateRouteTableResponse = AssociateRouteTableResponse'
{ _artrsAssociationId :: !(Maybe Text)
, _artrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateRouteTableResponse
:: Int
-> AssociateRouteTableResponse
associateRouteTableResponse pResponseStatus_ =
AssociateRouteTableResponse'
{_artrsAssociationId = Nothing, _artrsResponseStatus = pResponseStatus_}
artrsAssociationId :: Lens' AssociateRouteTableResponse (Maybe Text)
artrsAssociationId = lens _artrsAssociationId (\ s a -> s{_artrsAssociationId = a})
artrsResponseStatus :: Lens' AssociateRouteTableResponse Int
artrsResponseStatus = lens _artrsResponseStatus (\ s a -> s{_artrsResponseStatus = a})
instance NFData AssociateRouteTableResponse where