module Network.AWS.EC2.ModifyVPCEndpoint
(
modifyVPCEndpoint
, ModifyVPCEndpoint
, mvePolicyDocument
, mveRemoveRouteTableIds
, mveResetPolicy
, mveAddRouteTableIds
, mveDryRun
, mveVPCEndpointId
, modifyVPCEndpointResponse
, ModifyVPCEndpointResponse
, mversReturn
, mversStatus
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
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])
, _mveDryRun :: !(Maybe Bool)
, _mveVPCEndpointId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyVPCEndpoint
:: Text
-> ModifyVPCEndpoint
modifyVPCEndpoint pVPCEndpointId_ =
ModifyVPCEndpoint'
{ _mvePolicyDocument = Nothing
, _mveRemoveRouteTableIds = Nothing
, _mveResetPolicy = Nothing
, _mveAddRouteTableIds = Nothing
, _mveDryRun = 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;
mveDryRun :: Lens' ModifyVPCEndpoint (Maybe Bool)
mveDryRun = lens _mveDryRun (\ s a -> s{_mveDryRun = a});
mveVPCEndpointId :: Lens' ModifyVPCEndpoint Text
mveVPCEndpointId = lens _mveVPCEndpointId (\ s a -> s{_mveVPCEndpointId = a});
instance AWSRequest ModifyVPCEndpoint where
type Sv ModifyVPCEndpoint = EC2
type Rs ModifyVPCEndpoint = ModifyVPCEndpointResponse
request = post
response
= receiveXML
(\ s h x ->
ModifyVPCEndpointResponse' <$>
(x .@? "return") <*> (pure (fromEnum s)))
instance ToHeaders ModifyVPCEndpoint where
toHeaders = const mempty
instance ToPath ModifyVPCEndpoint where
toPath = const "/"
instance ToQuery ModifyVPCEndpoint where
toQuery ModifyVPCEndpoint'{..}
= mconcat
["Action" =: ("ModifyVpcEndpoint" :: ByteString),
"Version" =: ("2015-04-15" :: ByteString),
"PolicyDocument" =: _mvePolicyDocument,
toQuery
(toQueryList "item" <$> _mveRemoveRouteTableIds),
"ResetPolicy" =: _mveResetPolicy,
toQuery
(toQueryList "item" <$> _mveAddRouteTableIds),
"DryRun" =: _mveDryRun,
"VpcEndpointId" =: _mveVPCEndpointId]
data ModifyVPCEndpointResponse = ModifyVPCEndpointResponse'
{ _mversReturn :: !(Maybe Bool)
, _mversStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyVPCEndpointResponse
:: Int
-> ModifyVPCEndpointResponse
modifyVPCEndpointResponse pStatus_ =
ModifyVPCEndpointResponse'
{ _mversReturn = Nothing
, _mversStatus = pStatus_
}
mversReturn :: Lens' ModifyVPCEndpointResponse (Maybe Bool)
mversReturn = lens _mversReturn (\ s a -> s{_mversReturn = a});
mversStatus :: Lens' ModifyVPCEndpointResponse Int
mversStatus = lens _mversStatus (\ s a -> s{_mversStatus = a});