module Network.AWS.EC2.CreateVpcPeeringConnection
(
CreateVpcPeeringConnection
, createVpcPeeringConnection
, cvpcDryRun
, cvpcPeerOwnerId
, cvpcPeerVpcId
, cvpcVpcId
, CreateVpcPeeringConnectionResponse
, createVpcPeeringConnectionResponse
, cvpcrVpcPeeringConnection
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.EC2.Types
import qualified GHC.Exts
data CreateVpcPeeringConnection = CreateVpcPeeringConnection
{ _cvpcDryRun :: Maybe Bool
, _cvpcPeerOwnerId :: Maybe Text
, _cvpcPeerVpcId :: Maybe Text
, _cvpcVpcId :: Maybe Text
} deriving (Eq, Ord, Show)
createVpcPeeringConnection :: CreateVpcPeeringConnection
createVpcPeeringConnection = CreateVpcPeeringConnection
{ _cvpcDryRun = Nothing
, _cvpcVpcId = Nothing
, _cvpcPeerVpcId = Nothing
, _cvpcPeerOwnerId = Nothing
}
cvpcDryRun :: Lens' CreateVpcPeeringConnection (Maybe Bool)
cvpcDryRun = lens _cvpcDryRun (\s a -> s { _cvpcDryRun = a })
cvpcPeerOwnerId :: Lens' CreateVpcPeeringConnection (Maybe Text)
cvpcPeerOwnerId = lens _cvpcPeerOwnerId (\s a -> s { _cvpcPeerOwnerId = a })
cvpcPeerVpcId :: Lens' CreateVpcPeeringConnection (Maybe Text)
cvpcPeerVpcId = lens _cvpcPeerVpcId (\s a -> s { _cvpcPeerVpcId = a })
cvpcVpcId :: Lens' CreateVpcPeeringConnection (Maybe Text)
cvpcVpcId = lens _cvpcVpcId (\s a -> s { _cvpcVpcId = a })
newtype CreateVpcPeeringConnectionResponse = CreateVpcPeeringConnectionResponse
{ _cvpcrVpcPeeringConnection :: Maybe VpcPeeringConnection
} deriving (Eq, Show)
createVpcPeeringConnectionResponse :: CreateVpcPeeringConnectionResponse
createVpcPeeringConnectionResponse = CreateVpcPeeringConnectionResponse
{ _cvpcrVpcPeeringConnection = Nothing
}
cvpcrVpcPeeringConnection :: Lens' CreateVpcPeeringConnectionResponse (Maybe VpcPeeringConnection)
cvpcrVpcPeeringConnection =
lens _cvpcrVpcPeeringConnection
(\s a -> s { _cvpcrVpcPeeringConnection = a })
instance ToPath CreateVpcPeeringConnection where
toPath = const "/"
instance ToQuery CreateVpcPeeringConnection where
toQuery CreateVpcPeeringConnection{..} = mconcat
[ "dryRun" =? _cvpcDryRun
, "peerOwnerId" =? _cvpcPeerOwnerId
, "peerVpcId" =? _cvpcPeerVpcId
, "vpcId" =? _cvpcVpcId
]
instance ToHeaders CreateVpcPeeringConnection
instance AWSRequest CreateVpcPeeringConnection where
type Sv CreateVpcPeeringConnection = EC2
type Rs CreateVpcPeeringConnection = CreateVpcPeeringConnectionResponse
request = post "CreateVpcPeeringConnection"
response = xmlResponse
instance FromXML CreateVpcPeeringConnectionResponse where
parseXML x = CreateVpcPeeringConnectionResponse
<$> x .@? "vpcPeeringConnection"