{-# 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.AcceptVPCEndpointConnections
(
acceptVPCEndpointConnections
, AcceptVPCEndpointConnections
, avecDryRun
, avecServiceId
, avecVPCEndpointIds
, acceptVPCEndpointConnectionsResponse
, AcceptVPCEndpointConnectionsResponse
, avecrsUnsuccessful
, avecrsResponseStatus
) 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 AcceptVPCEndpointConnections = AcceptVPCEndpointConnections'
{ _avecDryRun :: !(Maybe Bool)
, _avecServiceId :: !Text
, _avecVPCEndpointIds :: ![Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
acceptVPCEndpointConnections
:: Text
-> AcceptVPCEndpointConnections
acceptVPCEndpointConnections pServiceId_ =
AcceptVPCEndpointConnections'
{ _avecDryRun = Nothing
, _avecServiceId = pServiceId_
, _avecVPCEndpointIds = mempty
}
avecDryRun :: Lens' AcceptVPCEndpointConnections (Maybe Bool)
avecDryRun = lens _avecDryRun (\ s a -> s{_avecDryRun = a})
avecServiceId :: Lens' AcceptVPCEndpointConnections Text
avecServiceId = lens _avecServiceId (\ s a -> s{_avecServiceId = a})
avecVPCEndpointIds :: Lens' AcceptVPCEndpointConnections [Text]
avecVPCEndpointIds = lens _avecVPCEndpointIds (\ s a -> s{_avecVPCEndpointIds = a}) . _Coerce
instance AWSRequest AcceptVPCEndpointConnections
where
type Rs AcceptVPCEndpointConnections =
AcceptVPCEndpointConnectionsResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
AcceptVPCEndpointConnectionsResponse' <$>
(x .@? "unsuccessful" .!@ mempty >>=
may (parseXMLList "item"))
<*> (pure (fromEnum s)))
instance Hashable AcceptVPCEndpointConnections where
instance NFData AcceptVPCEndpointConnections where
instance ToHeaders AcceptVPCEndpointConnections where
toHeaders = const mempty
instance ToPath AcceptVPCEndpointConnections where
toPath = const "/"
instance ToQuery AcceptVPCEndpointConnections where
toQuery AcceptVPCEndpointConnections'{..}
= mconcat
["Action" =:
("AcceptVpcEndpointConnections" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"DryRun" =: _avecDryRun,
"ServiceId" =: _avecServiceId,
toQueryList "VpcEndpointId" _avecVPCEndpointIds]
data AcceptVPCEndpointConnectionsResponse = AcceptVPCEndpointConnectionsResponse'
{ _avecrsUnsuccessful :: !(Maybe [UnsuccessfulItem])
, _avecrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
acceptVPCEndpointConnectionsResponse
:: Int
-> AcceptVPCEndpointConnectionsResponse
acceptVPCEndpointConnectionsResponse pResponseStatus_ =
AcceptVPCEndpointConnectionsResponse'
{_avecrsUnsuccessful = Nothing, _avecrsResponseStatus = pResponseStatus_}
avecrsUnsuccessful :: Lens' AcceptVPCEndpointConnectionsResponse [UnsuccessfulItem]
avecrsUnsuccessful = lens _avecrsUnsuccessful (\ s a -> s{_avecrsUnsuccessful = a}) . _Default . _Coerce
avecrsResponseStatus :: Lens' AcceptVPCEndpointConnectionsResponse Int
avecrsResponseStatus = lens _avecrsResponseStatus (\ s a -> s{_avecrsResponseStatus = a})
instance NFData AcceptVPCEndpointConnectionsResponse
where