{-# 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.DescribeVPCPeeringConnections
(
describeVPCPeeringConnections
, DescribeVPCPeeringConnections
, dvpcpcFilters
, dvpcpcVPCPeeringConnectionIds
, dvpcpcDryRun
, describeVPCPeeringConnectionsResponse
, DescribeVPCPeeringConnectionsResponse
, dvpcpcrsVPCPeeringConnections
, dvpcpcrsResponseStatus
) 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 DescribeVPCPeeringConnections = DescribeVPCPeeringConnections'
{ _dvpcpcFilters :: !(Maybe [Filter])
, _dvpcpcVPCPeeringConnectionIds :: !(Maybe [Text])
, _dvpcpcDryRun :: !(Maybe Bool)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeVPCPeeringConnections
:: DescribeVPCPeeringConnections
describeVPCPeeringConnections =
DescribeVPCPeeringConnections'
{ _dvpcpcFilters = Nothing
, _dvpcpcVPCPeeringConnectionIds = Nothing
, _dvpcpcDryRun = Nothing
}
dvpcpcFilters :: Lens' DescribeVPCPeeringConnections [Filter]
dvpcpcFilters = lens _dvpcpcFilters (\ s a -> s{_dvpcpcFilters = a}) . _Default . _Coerce;
dvpcpcVPCPeeringConnectionIds :: Lens' DescribeVPCPeeringConnections [Text]
dvpcpcVPCPeeringConnectionIds = lens _dvpcpcVPCPeeringConnectionIds (\ s a -> s{_dvpcpcVPCPeeringConnectionIds = a}) . _Default . _Coerce;
dvpcpcDryRun :: Lens' DescribeVPCPeeringConnections (Maybe Bool)
dvpcpcDryRun = lens _dvpcpcDryRun (\ s a -> s{_dvpcpcDryRun = a});
instance AWSRequest DescribeVPCPeeringConnections
where
type Rs DescribeVPCPeeringConnections =
DescribeVPCPeeringConnectionsResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
DescribeVPCPeeringConnectionsResponse' <$>
(x .@? "vpcPeeringConnectionSet" .!@ mempty >>=
may (parseXMLList "item"))
<*> (pure (fromEnum s)))
instance Hashable DescribeVPCPeeringConnections
instance NFData DescribeVPCPeeringConnections
instance ToHeaders DescribeVPCPeeringConnections
where
toHeaders = const mempty
instance ToPath DescribeVPCPeeringConnections where
toPath = const "/"
instance ToQuery DescribeVPCPeeringConnections where
toQuery DescribeVPCPeeringConnections'{..}
= mconcat
["Action" =:
("DescribeVpcPeeringConnections" :: ByteString),
"Version" =: ("2016-04-01" :: ByteString),
toQuery (toQueryList "Filter" <$> _dvpcpcFilters),
toQuery
(toQueryList "VpcPeeringConnectionId" <$>
_dvpcpcVPCPeeringConnectionIds),
"DryRun" =: _dvpcpcDryRun]
data DescribeVPCPeeringConnectionsResponse = DescribeVPCPeeringConnectionsResponse'
{ _dvpcpcrsVPCPeeringConnections :: !(Maybe [VPCPeeringConnection])
, _dvpcpcrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeVPCPeeringConnectionsResponse
:: Int
-> DescribeVPCPeeringConnectionsResponse
describeVPCPeeringConnectionsResponse pResponseStatus_ =
DescribeVPCPeeringConnectionsResponse'
{ _dvpcpcrsVPCPeeringConnections = Nothing
, _dvpcpcrsResponseStatus = pResponseStatus_
}
dvpcpcrsVPCPeeringConnections :: Lens' DescribeVPCPeeringConnectionsResponse [VPCPeeringConnection]
dvpcpcrsVPCPeeringConnections = lens _dvpcpcrsVPCPeeringConnections (\ s a -> s{_dvpcpcrsVPCPeeringConnections = a}) . _Default . _Coerce;
dvpcpcrsResponseStatus :: Lens' DescribeVPCPeeringConnectionsResponse Int
dvpcpcrsResponseStatus = lens _dvpcpcrsResponseStatus (\ s a -> s{_dvpcpcrsResponseStatus = a});
instance NFData DescribeVPCPeeringConnectionsResponse