{-# 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.DeleteVPCEndpoints
(
deleteVPCEndpoints
, DeleteVPCEndpoints
, dveDryRun
, dveVPCEndpointIds
, deleteVPCEndpointsResponse
, DeleteVPCEndpointsResponse
, dversUnsuccessful
, dversResponseStatus
) 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 DeleteVPCEndpoints = DeleteVPCEndpoints'
{ _dveDryRun :: !(Maybe Bool)
, _dveVPCEndpointIds :: ![Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteVPCEndpoints
:: DeleteVPCEndpoints
deleteVPCEndpoints =
DeleteVPCEndpoints' {_dveDryRun = Nothing, _dveVPCEndpointIds = mempty}
dveDryRun :: Lens' DeleteVPCEndpoints (Maybe Bool)
dveDryRun = lens _dveDryRun (\ s a -> s{_dveDryRun = a})
dveVPCEndpointIds :: Lens' DeleteVPCEndpoints [Text]
dveVPCEndpointIds = lens _dveVPCEndpointIds (\ s a -> s{_dveVPCEndpointIds = a}) . _Coerce
instance AWSRequest DeleteVPCEndpoints where
type Rs DeleteVPCEndpoints =
DeleteVPCEndpointsResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
DeleteVPCEndpointsResponse' <$>
(x .@? "unsuccessful" .!@ mempty >>=
may (parseXMLList "item"))
<*> (pure (fromEnum s)))
instance Hashable DeleteVPCEndpoints where
instance NFData DeleteVPCEndpoints where
instance ToHeaders DeleteVPCEndpoints where
toHeaders = const mempty
instance ToPath DeleteVPCEndpoints where
toPath = const "/"
instance ToQuery DeleteVPCEndpoints where
toQuery DeleteVPCEndpoints'{..}
= mconcat
["Action" =: ("DeleteVpcEndpoints" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"DryRun" =: _dveDryRun,
toQueryList "VpcEndpointId" _dveVPCEndpointIds]
data DeleteVPCEndpointsResponse = DeleteVPCEndpointsResponse'
{ _dversUnsuccessful :: !(Maybe [UnsuccessfulItem])
, _dversResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteVPCEndpointsResponse
:: Int
-> DeleteVPCEndpointsResponse
deleteVPCEndpointsResponse pResponseStatus_ =
DeleteVPCEndpointsResponse'
{_dversUnsuccessful = Nothing, _dversResponseStatus = pResponseStatus_}
dversUnsuccessful :: Lens' DeleteVPCEndpointsResponse [UnsuccessfulItem]
dversUnsuccessful = lens _dversUnsuccessful (\ s a -> s{_dversUnsuccessful = a}) . _Default . _Coerce
dversResponseStatus :: Lens' DeleteVPCEndpointsResponse Int
dversResponseStatus = lens _dversResponseStatus (\ s a -> s{_dversResponseStatus = a})
instance NFData DeleteVPCEndpointsResponse where