{-# 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.DescribeVPCEndpointServicePermissions
(
describeVPCEndpointServicePermissions
, DescribeVPCEndpointServicePermissions
, dvespFilters
, dvespNextToken
, dvespDryRun
, dvespMaxResults
, dvespServiceId
, describeVPCEndpointServicePermissionsResponse
, DescribeVPCEndpointServicePermissionsResponse
, dvesprsNextToken
, dvesprsAllowedPrincipals
, dvesprsResponseStatus
) 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 DescribeVPCEndpointServicePermissions = DescribeVPCEndpointServicePermissions'
{ _dvespFilters :: !(Maybe [Filter])
, _dvespNextToken :: !(Maybe Text)
, _dvespDryRun :: !(Maybe Bool)
, _dvespMaxResults :: !(Maybe Int)
, _dvespServiceId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeVPCEndpointServicePermissions
:: Text
-> DescribeVPCEndpointServicePermissions
describeVPCEndpointServicePermissions pServiceId_ =
DescribeVPCEndpointServicePermissions'
{ _dvespFilters = Nothing
, _dvespNextToken = Nothing
, _dvespDryRun = Nothing
, _dvespMaxResults = Nothing
, _dvespServiceId = pServiceId_
}
dvespFilters :: Lens' DescribeVPCEndpointServicePermissions [Filter]
dvespFilters = lens _dvespFilters (\ s a -> s{_dvespFilters = a}) . _Default . _Coerce
dvespNextToken :: Lens' DescribeVPCEndpointServicePermissions (Maybe Text)
dvespNextToken = lens _dvespNextToken (\ s a -> s{_dvespNextToken = a})
dvespDryRun :: Lens' DescribeVPCEndpointServicePermissions (Maybe Bool)
dvespDryRun = lens _dvespDryRun (\ s a -> s{_dvespDryRun = a})
dvespMaxResults :: Lens' DescribeVPCEndpointServicePermissions (Maybe Int)
dvespMaxResults = lens _dvespMaxResults (\ s a -> s{_dvespMaxResults = a})
dvespServiceId :: Lens' DescribeVPCEndpointServicePermissions Text
dvespServiceId = lens _dvespServiceId (\ s a -> s{_dvespServiceId = a})
instance AWSRequest
DescribeVPCEndpointServicePermissions
where
type Rs DescribeVPCEndpointServicePermissions =
DescribeVPCEndpointServicePermissionsResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
DescribeVPCEndpointServicePermissionsResponse' <$>
(x .@? "nextToken") <*>
(x .@? "allowedPrincipals" .!@ mempty >>=
may (parseXMLList "item"))
<*> (pure (fromEnum s)))
instance Hashable
DescribeVPCEndpointServicePermissions
where
instance NFData DescribeVPCEndpointServicePermissions
where
instance ToHeaders
DescribeVPCEndpointServicePermissions
where
toHeaders = const mempty
instance ToPath DescribeVPCEndpointServicePermissions
where
toPath = const "/"
instance ToQuery
DescribeVPCEndpointServicePermissions
where
toQuery DescribeVPCEndpointServicePermissions'{..}
= mconcat
["Action" =:
("DescribeVpcEndpointServicePermissions" ::
ByteString),
"Version" =: ("2016-11-15" :: ByteString),
toQuery (toQueryList "Filter" <$> _dvespFilters),
"NextToken" =: _dvespNextToken,
"DryRun" =: _dvespDryRun,
"MaxResults" =: _dvespMaxResults,
"ServiceId" =: _dvespServiceId]
data DescribeVPCEndpointServicePermissionsResponse = DescribeVPCEndpointServicePermissionsResponse'
{ _dvesprsNextToken :: !(Maybe Text)
, _dvesprsAllowedPrincipals :: !(Maybe [AllowedPrincipal])
, _dvesprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeVPCEndpointServicePermissionsResponse
:: Int
-> DescribeVPCEndpointServicePermissionsResponse
describeVPCEndpointServicePermissionsResponse pResponseStatus_ =
DescribeVPCEndpointServicePermissionsResponse'
{ _dvesprsNextToken = Nothing
, _dvesprsAllowedPrincipals = Nothing
, _dvesprsResponseStatus = pResponseStatus_
}
dvesprsNextToken :: Lens' DescribeVPCEndpointServicePermissionsResponse (Maybe Text)
dvesprsNextToken = lens _dvesprsNextToken (\ s a -> s{_dvesprsNextToken = a})
dvesprsAllowedPrincipals :: Lens' DescribeVPCEndpointServicePermissionsResponse [AllowedPrincipal]
dvesprsAllowedPrincipals = lens _dvesprsAllowedPrincipals (\ s a -> s{_dvesprsAllowedPrincipals = a}) . _Default . _Coerce
dvesprsResponseStatus :: Lens' DescribeVPCEndpointServicePermissionsResponse Int
dvesprsResponseStatus = lens _dvesprsResponseStatus (\ s a -> s{_dvesprsResponseStatus = a})
instance NFData
DescribeVPCEndpointServicePermissionsResponse
where