{-# 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.DescribeVPCEndpointConnections
(
describeVPCEndpointConnections
, DescribeVPCEndpointConnections
, dvecFilters
, dvecNextToken
, dvecDryRun
, dvecMaxResults
, describeVPCEndpointConnectionsResponse
, DescribeVPCEndpointConnectionsResponse
, dvecrsVPCEndpointConnections
, dvecrsNextToken
, dvecrsResponseStatus
) 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 DescribeVPCEndpointConnections = DescribeVPCEndpointConnections'
{ _dvecFilters :: !(Maybe [Filter])
, _dvecNextToken :: !(Maybe Text)
, _dvecDryRun :: !(Maybe Bool)
, _dvecMaxResults :: !(Maybe Int)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeVPCEndpointConnections
:: DescribeVPCEndpointConnections
describeVPCEndpointConnections =
DescribeVPCEndpointConnections'
{ _dvecFilters = Nothing
, _dvecNextToken = Nothing
, _dvecDryRun = Nothing
, _dvecMaxResults = Nothing
}
dvecFilters :: Lens' DescribeVPCEndpointConnections [Filter]
dvecFilters = lens _dvecFilters (\ s a -> s{_dvecFilters = a}) . _Default . _Coerce
dvecNextToken :: Lens' DescribeVPCEndpointConnections (Maybe Text)
dvecNextToken = lens _dvecNextToken (\ s a -> s{_dvecNextToken = a})
dvecDryRun :: Lens' DescribeVPCEndpointConnections (Maybe Bool)
dvecDryRun = lens _dvecDryRun (\ s a -> s{_dvecDryRun = a})
dvecMaxResults :: Lens' DescribeVPCEndpointConnections (Maybe Int)
dvecMaxResults = lens _dvecMaxResults (\ s a -> s{_dvecMaxResults = a})
instance AWSRequest DescribeVPCEndpointConnections
where
type Rs DescribeVPCEndpointConnections =
DescribeVPCEndpointConnectionsResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
DescribeVPCEndpointConnectionsResponse' <$>
(x .@? "vpcEndpointConnectionSet" .!@ mempty >>=
may (parseXMLList "item"))
<*> (x .@? "nextToken")
<*> (pure (fromEnum s)))
instance Hashable DescribeVPCEndpointConnections
where
instance NFData DescribeVPCEndpointConnections where
instance ToHeaders DescribeVPCEndpointConnections
where
toHeaders = const mempty
instance ToPath DescribeVPCEndpointConnections where
toPath = const "/"
instance ToQuery DescribeVPCEndpointConnections where
toQuery DescribeVPCEndpointConnections'{..}
= mconcat
["Action" =:
("DescribeVpcEndpointConnections" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
toQuery (toQueryList "Filter" <$> _dvecFilters),
"NextToken" =: _dvecNextToken,
"DryRun" =: _dvecDryRun,
"MaxResults" =: _dvecMaxResults]
data DescribeVPCEndpointConnectionsResponse = DescribeVPCEndpointConnectionsResponse'
{ _dvecrsVPCEndpointConnections :: !(Maybe [VPCEndpointConnection])
, _dvecrsNextToken :: !(Maybe Text)
, _dvecrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeVPCEndpointConnectionsResponse
:: Int
-> DescribeVPCEndpointConnectionsResponse
describeVPCEndpointConnectionsResponse pResponseStatus_ =
DescribeVPCEndpointConnectionsResponse'
{ _dvecrsVPCEndpointConnections = Nothing
, _dvecrsNextToken = Nothing
, _dvecrsResponseStatus = pResponseStatus_
}
dvecrsVPCEndpointConnections :: Lens' DescribeVPCEndpointConnectionsResponse [VPCEndpointConnection]
dvecrsVPCEndpointConnections = lens _dvecrsVPCEndpointConnections (\ s a -> s{_dvecrsVPCEndpointConnections = a}) . _Default . _Coerce
dvecrsNextToken :: Lens' DescribeVPCEndpointConnectionsResponse (Maybe Text)
dvecrsNextToken = lens _dvecrsNextToken (\ s a -> s{_dvecrsNextToken = a})
dvecrsResponseStatus :: Lens' DescribeVPCEndpointConnectionsResponse Int
dvecrsResponseStatus = lens _dvecrsResponseStatus (\ s a -> s{_dvecrsResponseStatus = a})
instance NFData
DescribeVPCEndpointConnectionsResponse
where