{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric      #-}
{-# LANGUAGE OverloadedStrings  #-}
{-# LANGUAGE RecordWildCards    #-}
{-# LANGUAGE TypeFamilies       #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds   #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.EC2.CreateVPCPeeringConnection
    (
    
      createVPCPeeringConnection
    , CreateVPCPeeringConnection
    
    , cvpcPeerVPCId
    , cvpcVPCId
    , cvpcPeerOwnerId
    , cvpcDryRun
    
    , createVPCPeeringConnectionResponse
    , CreateVPCPeeringConnectionResponse
    
    , cvpcrsVPCPeeringConnection
    , cvpcrsResponseStatus
    ) 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 CreateVPCPeeringConnection = CreateVPCPeeringConnection'
    { _cvpcPeerVPCId   :: !(Maybe Text)
    , _cvpcVPCId       :: !(Maybe Text)
    , _cvpcPeerOwnerId :: !(Maybe Text)
    , _cvpcDryRun      :: !(Maybe Bool)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
createVPCPeeringConnection
    :: CreateVPCPeeringConnection
createVPCPeeringConnection =
    CreateVPCPeeringConnection'
    { _cvpcPeerVPCId = Nothing
    , _cvpcVPCId = Nothing
    , _cvpcPeerOwnerId = Nothing
    , _cvpcDryRun = Nothing
    }
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});
cvpcPeerOwnerId :: Lens' CreateVPCPeeringConnection (Maybe Text)
cvpcPeerOwnerId = lens _cvpcPeerOwnerId (\ s a -> s{_cvpcPeerOwnerId = a});
cvpcDryRun :: Lens' CreateVPCPeeringConnection (Maybe Bool)
cvpcDryRun = lens _cvpcDryRun (\ s a -> s{_cvpcDryRun = a});
instance AWSRequest CreateVPCPeeringConnection where
        type Rs CreateVPCPeeringConnection =
             CreateVPCPeeringConnectionResponse
        request = postQuery ec2
        response
          = receiveXML
              (\ s h x ->
                 CreateVPCPeeringConnectionResponse' <$>
                   (x .@? "vpcPeeringConnection") <*>
                     (pure (fromEnum s)))
instance Hashable CreateVPCPeeringConnection
instance NFData CreateVPCPeeringConnection
instance ToHeaders CreateVPCPeeringConnection where
        toHeaders = const mempty
instance ToPath CreateVPCPeeringConnection where
        toPath = const "/"
instance ToQuery CreateVPCPeeringConnection where
        toQuery CreateVPCPeeringConnection'{..}
          = mconcat
              ["Action" =:
                 ("CreateVpcPeeringConnection" :: ByteString),
               "Version" =: ("2016-04-01" :: ByteString),
               "PeerVpcId" =: _cvpcPeerVPCId, "VpcId" =: _cvpcVPCId,
               "PeerOwnerId" =: _cvpcPeerOwnerId,
               "DryRun" =: _cvpcDryRun]
data CreateVPCPeeringConnectionResponse = CreateVPCPeeringConnectionResponse'
    { _cvpcrsVPCPeeringConnection :: !(Maybe VPCPeeringConnection)
    , _cvpcrsResponseStatus       :: !Int
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
createVPCPeeringConnectionResponse
    :: Int 
    -> CreateVPCPeeringConnectionResponse
createVPCPeeringConnectionResponse pResponseStatus_ =
    CreateVPCPeeringConnectionResponse'
    { _cvpcrsVPCPeeringConnection = Nothing
    , _cvpcrsResponseStatus = pResponseStatus_
    }
cvpcrsVPCPeeringConnection :: Lens' CreateVPCPeeringConnectionResponse (Maybe VPCPeeringConnection)
cvpcrsVPCPeeringConnection = lens _cvpcrsVPCPeeringConnection (\ s a -> s{_cvpcrsVPCPeeringConnection = a});
cvpcrsResponseStatus :: Lens' CreateVPCPeeringConnectionResponse Int
cvpcrsResponseStatus = lens _cvpcrsResponseStatus (\ s a -> s{_cvpcrsResponseStatus = a});
instance NFData CreateVPCPeeringConnectionResponse