{-# 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.ModifyVPCEndpointServicePermissions
(
modifyVPCEndpointServicePermissions
, ModifyVPCEndpointServicePermissions
, mvespRemoveAllowedPrincipals
, mvespAddAllowedPrincipals
, mvespDryRun
, mvespServiceId
, modifyVPCEndpointServicePermissionsResponse
, ModifyVPCEndpointServicePermissionsResponse
, mvesprsReturnValue
, mvesprsResponseStatus
) 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 ModifyVPCEndpointServicePermissions = ModifyVPCEndpointServicePermissions'
{ _mvespRemoveAllowedPrincipals :: !(Maybe [Text])
, _mvespAddAllowedPrincipals :: !(Maybe [Text])
, _mvespDryRun :: !(Maybe Bool)
, _mvespServiceId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
modifyVPCEndpointServicePermissions
:: Text
-> ModifyVPCEndpointServicePermissions
modifyVPCEndpointServicePermissions pServiceId_ =
ModifyVPCEndpointServicePermissions'
{ _mvespRemoveAllowedPrincipals = Nothing
, _mvespAddAllowedPrincipals = Nothing
, _mvespDryRun = Nothing
, _mvespServiceId = pServiceId_
}
mvespRemoveAllowedPrincipals :: Lens' ModifyVPCEndpointServicePermissions [Text]
mvespRemoveAllowedPrincipals = lens _mvespRemoveAllowedPrincipals (\ s a -> s{_mvespRemoveAllowedPrincipals = a}) . _Default . _Coerce
mvespAddAllowedPrincipals :: Lens' ModifyVPCEndpointServicePermissions [Text]
mvespAddAllowedPrincipals = lens _mvespAddAllowedPrincipals (\ s a -> s{_mvespAddAllowedPrincipals = a}) . _Default . _Coerce
mvespDryRun :: Lens' ModifyVPCEndpointServicePermissions (Maybe Bool)
mvespDryRun = lens _mvespDryRun (\ s a -> s{_mvespDryRun = a})
mvespServiceId :: Lens' ModifyVPCEndpointServicePermissions Text
mvespServiceId = lens _mvespServiceId (\ s a -> s{_mvespServiceId = a})
instance AWSRequest
ModifyVPCEndpointServicePermissions
where
type Rs ModifyVPCEndpointServicePermissions =
ModifyVPCEndpointServicePermissionsResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
ModifyVPCEndpointServicePermissionsResponse' <$>
(x .@? "return") <*> (pure (fromEnum s)))
instance Hashable ModifyVPCEndpointServicePermissions
where
instance NFData ModifyVPCEndpointServicePermissions
where
instance ToHeaders
ModifyVPCEndpointServicePermissions
where
toHeaders = const mempty
instance ToPath ModifyVPCEndpointServicePermissions
where
toPath = const "/"
instance ToQuery ModifyVPCEndpointServicePermissions
where
toQuery ModifyVPCEndpointServicePermissions'{..}
= mconcat
["Action" =:
("ModifyVpcEndpointServicePermissions" ::
ByteString),
"Version" =: ("2016-11-15" :: ByteString),
toQuery
(toQueryList "RemoveAllowedPrincipals" <$>
_mvespRemoveAllowedPrincipals),
toQuery
(toQueryList "AddAllowedPrincipals" <$>
_mvespAddAllowedPrincipals),
"DryRun" =: _mvespDryRun,
"ServiceId" =: _mvespServiceId]
data ModifyVPCEndpointServicePermissionsResponse = ModifyVPCEndpointServicePermissionsResponse'
{ _mvesprsReturnValue :: !(Maybe Bool)
, _mvesprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
modifyVPCEndpointServicePermissionsResponse
:: Int
-> ModifyVPCEndpointServicePermissionsResponse
modifyVPCEndpointServicePermissionsResponse pResponseStatus_ =
ModifyVPCEndpointServicePermissionsResponse'
{_mvesprsReturnValue = Nothing, _mvesprsResponseStatus = pResponseStatus_}
mvesprsReturnValue :: Lens' ModifyVPCEndpointServicePermissionsResponse (Maybe Bool)
mvesprsReturnValue = lens _mvesprsReturnValue (\ s a -> s{_mvesprsReturnValue = a})
mvesprsResponseStatus :: Lens' ModifyVPCEndpointServicePermissionsResponse Int
mvesprsResponseStatus = lens _mvesprsResponseStatus (\ s a -> s{_mvesprsResponseStatus = a})
instance NFData
ModifyVPCEndpointServicePermissionsResponse
where