module Network.AWS.EC2.AttachVpnGateway
(
AttachVpnGateway
, attachVpnGateway
, avgDryRun
, avgVpcId
, avgVpnGatewayId
, AttachVpnGatewayResponse
, attachVpnGatewayResponse
, avgrVpcAttachment
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.EC2.Types
import qualified GHC.Exts
data AttachVpnGateway = AttachVpnGateway
{ _avgDryRun :: Maybe Bool
, _avgVpcId :: Text
, _avgVpnGatewayId :: Text
} deriving (Eq, Ord, Show)
attachVpnGateway :: Text
-> Text
-> AttachVpnGateway
attachVpnGateway p1 p2 = AttachVpnGateway
{ _avgVpnGatewayId = p1
, _avgVpcId = p2
, _avgDryRun = Nothing
}
avgDryRun :: Lens' AttachVpnGateway (Maybe Bool)
avgDryRun = lens _avgDryRun (\s a -> s { _avgDryRun = a })
avgVpcId :: Lens' AttachVpnGateway Text
avgVpcId = lens _avgVpcId (\s a -> s { _avgVpcId = a })
avgVpnGatewayId :: Lens' AttachVpnGateway Text
avgVpnGatewayId = lens _avgVpnGatewayId (\s a -> s { _avgVpnGatewayId = a })
newtype AttachVpnGatewayResponse = AttachVpnGatewayResponse
{ _avgrVpcAttachment :: Maybe VpcAttachment
} deriving (Eq, Show)
attachVpnGatewayResponse :: AttachVpnGatewayResponse
attachVpnGatewayResponse = AttachVpnGatewayResponse
{ _avgrVpcAttachment = Nothing
}
avgrVpcAttachment :: Lens' AttachVpnGatewayResponse (Maybe VpcAttachment)
avgrVpcAttachment =
lens _avgrVpcAttachment (\s a -> s { _avgrVpcAttachment = a })
instance ToPath AttachVpnGateway where
toPath = const "/"
instance ToQuery AttachVpnGateway where
toQuery AttachVpnGateway{..} = mconcat
[ "dryRun" =? _avgDryRun
, "VpcId" =? _avgVpcId
, "VpnGatewayId" =? _avgVpnGatewayId
]
instance ToHeaders AttachVpnGateway
instance AWSRequest AttachVpnGateway where
type Sv AttachVpnGateway = EC2
type Rs AttachVpnGateway = AttachVpnGatewayResponse
request = post "AttachVpnGateway"
response = xmlResponse
instance FromXML AttachVpnGatewayResponse where
parseXML x = AttachVpnGatewayResponse
<$> x .@? "attachment"