module Network.AWS.EC2.AssociateRouteTable
(
associateRouteTable
, AssociateRouteTable
, artDryRun
, artSubnetId
, artRouteTableId
, 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)
, _artSubnetId :: !Text
, _artRouteTableId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
associateRouteTable
:: Text
-> Text
-> AssociateRouteTable
associateRouteTable pSubnetId_ pRouteTableId_ =
AssociateRouteTable'
{ _artDryRun = Nothing
, _artSubnetId = pSubnetId_
, _artRouteTableId = pRouteTableId_
}
artDryRun :: Lens' AssociateRouteTable (Maybe Bool)
artDryRun = lens _artDryRun (\ s a -> s{_artDryRun = a});
artSubnetId :: Lens' AssociateRouteTable Text
artSubnetId = lens _artSubnetId (\ s a -> s{_artSubnetId = a});
artRouteTableId :: Lens' AssociateRouteTable Text
artRouteTableId = lens _artRouteTableId (\ s a -> s{_artRouteTableId = 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
instance ToHeaders AssociateRouteTable where
toHeaders = const mempty
instance ToPath AssociateRouteTable where
toPath = const "/"
instance ToQuery AssociateRouteTable where
toQuery AssociateRouteTable'{..}
= mconcat
["Action" =: ("AssociateRouteTable" :: ByteString),
"Version" =: ("2015-10-01" :: ByteString),
"DryRun" =: _artDryRun, "SubnetId" =: _artSubnetId,
"RouteTableId" =: _artRouteTableId]
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});