module Network.AWS.EC2.AcceptVPCPeeringConnection
(
acceptVPCPeeringConnection
, AcceptVPCPeeringConnection
, avpcVPCPeeringConnectionId
, avpcDryRun
, acceptVPCPeeringConnectionResponse
, AcceptVPCPeeringConnectionResponse
, avpcrsVPCPeeringConnection
, avpcrsResponseStatus
) 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 AcceptVPCPeeringConnection = AcceptVPCPeeringConnection'
{ _avpcVPCPeeringConnectionId :: !(Maybe Text)
, _avpcDryRun :: !(Maybe Bool)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
acceptVPCPeeringConnection
:: AcceptVPCPeeringConnection
acceptVPCPeeringConnection =
AcceptVPCPeeringConnection'
{_avpcVPCPeeringConnectionId = Nothing, _avpcDryRun = Nothing}
avpcVPCPeeringConnectionId :: Lens' AcceptVPCPeeringConnection (Maybe Text)
avpcVPCPeeringConnectionId = lens _avpcVPCPeeringConnectionId (\ s a -> s{_avpcVPCPeeringConnectionId = a});
avpcDryRun :: Lens' AcceptVPCPeeringConnection (Maybe Bool)
avpcDryRun = lens _avpcDryRun (\ s a -> s{_avpcDryRun = a});
instance AWSRequest AcceptVPCPeeringConnection where
type Rs AcceptVPCPeeringConnection =
AcceptVPCPeeringConnectionResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
AcceptVPCPeeringConnectionResponse' <$>
(x .@? "vpcPeeringConnection") <*>
(pure (fromEnum s)))
instance Hashable AcceptVPCPeeringConnection where
instance NFData AcceptVPCPeeringConnection where
instance ToHeaders AcceptVPCPeeringConnection where
toHeaders = const mempty
instance ToPath AcceptVPCPeeringConnection where
toPath = const "/"
instance ToQuery AcceptVPCPeeringConnection where
toQuery AcceptVPCPeeringConnection'{..}
= mconcat
["Action" =:
("AcceptVpcPeeringConnection" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"VpcPeeringConnectionId" =:
_avpcVPCPeeringConnectionId,
"DryRun" =: _avpcDryRun]
data AcceptVPCPeeringConnectionResponse = AcceptVPCPeeringConnectionResponse'
{ _avpcrsVPCPeeringConnection :: !(Maybe VPCPeeringConnection)
, _avpcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
acceptVPCPeeringConnectionResponse
:: Int
-> AcceptVPCPeeringConnectionResponse
acceptVPCPeeringConnectionResponse pResponseStatus_ =
AcceptVPCPeeringConnectionResponse'
{ _avpcrsVPCPeeringConnection = Nothing
, _avpcrsResponseStatus = pResponseStatus_
}
avpcrsVPCPeeringConnection :: Lens' AcceptVPCPeeringConnectionResponse (Maybe VPCPeeringConnection)
avpcrsVPCPeeringConnection = lens _avpcrsVPCPeeringConnection (\ s a -> s{_avpcrsVPCPeeringConnection = a});
avpcrsResponseStatus :: Lens' AcceptVPCPeeringConnectionResponse Int
avpcrsResponseStatus = lens _avpcrsResponseStatus (\ s a -> s{_avpcrsResponseStatus = a});
instance NFData AcceptVPCPeeringConnectionResponse
where