{-# 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.ModifyVPCEndpoint
(
modifyVPCEndpoint
, ModifyVPCEndpoint
, mvePolicyDocument
, mveRemoveRouteTableIds
, mveResetPolicy
, mveAddRouteTableIds
, mvePrivateDNSEnabled
, mveAddSubnetIds
, mveRemoveSubnetIds
, mveAddSecurityGroupIds
, mveDryRun
, mveRemoveSecurityGroupIds
, mveVPCEndpointId
, modifyVPCEndpointResponse
, ModifyVPCEndpointResponse
, mversReturn
, mversResponseStatus
) 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 ModifyVPCEndpoint = ModifyVPCEndpoint'
{ _mvePolicyDocument :: !(Maybe Text)
, _mveRemoveRouteTableIds :: !(Maybe [Text])
, _mveResetPolicy :: !(Maybe Bool)
, _mveAddRouteTableIds :: !(Maybe [Text])
, _mvePrivateDNSEnabled :: !(Maybe Bool)
, _mveAddSubnetIds :: !(Maybe [Text])
, _mveRemoveSubnetIds :: !(Maybe [Text])
, _mveAddSecurityGroupIds :: !(Maybe [Text])
, _mveDryRun :: !(Maybe Bool)
, _mveRemoveSecurityGroupIds :: !(Maybe [Text])
, _mveVPCEndpointId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
modifyVPCEndpoint
:: Text
-> ModifyVPCEndpoint
modifyVPCEndpoint pVPCEndpointId_ =
ModifyVPCEndpoint'
{ _mvePolicyDocument = Nothing
, _mveRemoveRouteTableIds = Nothing
, _mveResetPolicy = Nothing
, _mveAddRouteTableIds = Nothing
, _mvePrivateDNSEnabled = Nothing
, _mveAddSubnetIds = Nothing
, _mveRemoveSubnetIds = Nothing
, _mveAddSecurityGroupIds = Nothing
, _mveDryRun = Nothing
, _mveRemoveSecurityGroupIds = Nothing
, _mveVPCEndpointId = pVPCEndpointId_
}
mvePolicyDocument :: Lens' ModifyVPCEndpoint (Maybe Text)
mvePolicyDocument = lens _mvePolicyDocument (\ s a -> s{_mvePolicyDocument = a})
mveRemoveRouteTableIds :: Lens' ModifyVPCEndpoint [Text]
mveRemoveRouteTableIds = lens _mveRemoveRouteTableIds (\ s a -> s{_mveRemoveRouteTableIds = a}) . _Default . _Coerce
mveResetPolicy :: Lens' ModifyVPCEndpoint (Maybe Bool)
mveResetPolicy = lens _mveResetPolicy (\ s a -> s{_mveResetPolicy = a})
mveAddRouteTableIds :: Lens' ModifyVPCEndpoint [Text]
mveAddRouteTableIds = lens _mveAddRouteTableIds (\ s a -> s{_mveAddRouteTableIds = a}) . _Default . _Coerce
mvePrivateDNSEnabled :: Lens' ModifyVPCEndpoint (Maybe Bool)
mvePrivateDNSEnabled = lens _mvePrivateDNSEnabled (\ s a -> s{_mvePrivateDNSEnabled = a})
mveAddSubnetIds :: Lens' ModifyVPCEndpoint [Text]
mveAddSubnetIds = lens _mveAddSubnetIds (\ s a -> s{_mveAddSubnetIds = a}) . _Default . _Coerce
mveRemoveSubnetIds :: Lens' ModifyVPCEndpoint [Text]
mveRemoveSubnetIds = lens _mveRemoveSubnetIds (\ s a -> s{_mveRemoveSubnetIds = a}) . _Default . _Coerce
mveAddSecurityGroupIds :: Lens' ModifyVPCEndpoint [Text]
mveAddSecurityGroupIds = lens _mveAddSecurityGroupIds (\ s a -> s{_mveAddSecurityGroupIds = a}) . _Default . _Coerce
mveDryRun :: Lens' ModifyVPCEndpoint (Maybe Bool)
mveDryRun = lens _mveDryRun (\ s a -> s{_mveDryRun = a})
mveRemoveSecurityGroupIds :: Lens' ModifyVPCEndpoint [Text]
mveRemoveSecurityGroupIds = lens _mveRemoveSecurityGroupIds (\ s a -> s{_mveRemoveSecurityGroupIds = a}) . _Default . _Coerce
mveVPCEndpointId :: Lens' ModifyVPCEndpoint Text
mveVPCEndpointId = lens _mveVPCEndpointId (\ s a -> s{_mveVPCEndpointId = a})
instance AWSRequest ModifyVPCEndpoint where
type Rs ModifyVPCEndpoint = ModifyVPCEndpointResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
ModifyVPCEndpointResponse' <$>
(x .@? "return") <*> (pure (fromEnum s)))
instance Hashable ModifyVPCEndpoint where
instance NFData ModifyVPCEndpoint where
instance ToHeaders ModifyVPCEndpoint where
toHeaders = const mempty
instance ToPath ModifyVPCEndpoint where
toPath = const "/"
instance ToQuery ModifyVPCEndpoint where
toQuery ModifyVPCEndpoint'{..}
= mconcat
["Action" =: ("ModifyVpcEndpoint" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"PolicyDocument" =: _mvePolicyDocument,
toQuery
(toQueryList "RemoveRouteTableId" <$>
_mveRemoveRouteTableIds),
"ResetPolicy" =: _mveResetPolicy,
toQuery
(toQueryList "AddRouteTableId" <$>
_mveAddRouteTableIds),
"PrivateDnsEnabled" =: _mvePrivateDNSEnabled,
toQuery
(toQueryList "AddSubnetId" <$> _mveAddSubnetIds),
toQuery
(toQueryList "RemoveSubnetId" <$>
_mveRemoveSubnetIds),
toQuery
(toQueryList "AddSecurityGroupId" <$>
_mveAddSecurityGroupIds),
"DryRun" =: _mveDryRun,
toQuery
(toQueryList "RemoveSecurityGroupId" <$>
_mveRemoveSecurityGroupIds),
"VpcEndpointId" =: _mveVPCEndpointId]
data ModifyVPCEndpointResponse = ModifyVPCEndpointResponse'
{ _mversReturn :: !(Maybe Bool)
, _mversResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
modifyVPCEndpointResponse
:: Int
-> ModifyVPCEndpointResponse
modifyVPCEndpointResponse pResponseStatus_ =
ModifyVPCEndpointResponse'
{_mversReturn = Nothing, _mversResponseStatus = pResponseStatus_}
mversReturn :: Lens' ModifyVPCEndpointResponse (Maybe Bool)
mversReturn = lens _mversReturn (\ s a -> s{_mversReturn = a})
mversResponseStatus :: Lens' ModifyVPCEndpointResponse Int
mversResponseStatus = lens _mversResponseStatus (\ s a -> s{_mversResponseStatus = a})
instance NFData ModifyVPCEndpointResponse where