module Network.AWS.EC2.AttachVPNGateway
(
attachVPNGateway
, AttachVPNGateway
, avgDryRun
, avgVPNGatewayId
, avgVPCId
, attachVPNGatewayResponse
, AttachVPNGatewayResponse
, avgrsVPCAttachment
, avgrsStatus
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data AttachVPNGateway = AttachVPNGateway'
{ _avgDryRun :: !(Maybe Bool)
, _avgVPNGatewayId :: !Text
, _avgVPCId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
attachVPNGateway
:: Text
-> Text
-> AttachVPNGateway
attachVPNGateway pVPNGatewayId_ pVPCId_ =
AttachVPNGateway'
{ _avgDryRun = Nothing
, _avgVPNGatewayId = pVPNGatewayId_
, _avgVPCId = pVPCId_
}
avgDryRun :: Lens' AttachVPNGateway (Maybe Bool)
avgDryRun = lens _avgDryRun (\ s a -> s{_avgDryRun = a});
avgVPNGatewayId :: Lens' AttachVPNGateway Text
avgVPNGatewayId = lens _avgVPNGatewayId (\ s a -> s{_avgVPNGatewayId = a});
avgVPCId :: Lens' AttachVPNGateway Text
avgVPCId = lens _avgVPCId (\ s a -> s{_avgVPCId = a});
instance AWSRequest AttachVPNGateway where
type Rs AttachVPNGateway = AttachVPNGatewayResponse
request = postQuery eC2
response
= receiveXML
(\ s h x ->
AttachVPNGatewayResponse' <$>
(x .@? "attachment") <*> (pure (fromEnum s)))
instance ToHeaders AttachVPNGateway where
toHeaders = const mempty
instance ToPath AttachVPNGateway where
toPath = const "/"
instance ToQuery AttachVPNGateway where
toQuery AttachVPNGateway'{..}
= mconcat
["Action" =: ("AttachVpnGateway" :: ByteString),
"Version" =: ("2015-04-15" :: ByteString),
"DryRun" =: _avgDryRun,
"VpnGatewayId" =: _avgVPNGatewayId,
"VpcId" =: _avgVPCId]
data AttachVPNGatewayResponse = AttachVPNGatewayResponse'
{ _avgrsVPCAttachment :: !(Maybe VPCAttachment)
, _avgrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
attachVPNGatewayResponse
:: Int
-> AttachVPNGatewayResponse
attachVPNGatewayResponse pStatus_ =
AttachVPNGatewayResponse'
{ _avgrsVPCAttachment = Nothing
, _avgrsStatus = pStatus_
}
avgrsVPCAttachment :: Lens' AttachVPNGatewayResponse (Maybe VPCAttachment)
avgrsVPCAttachment = lens _avgrsVPCAttachment (\ s a -> s{_avgrsVPCAttachment = a});
avgrsStatus :: Lens' AttachVPNGatewayResponse Int
avgrsStatus = lens _avgrsStatus (\ s a -> s{_avgrsStatus = a});