{-# 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.CreateVPCEndpointConnectionNotification
(
createVPCEndpointConnectionNotification
, CreateVPCEndpointConnectionNotification
, cvecnClientToken
, cvecnServiceId
, cvecnVPCEndpointId
, cvecnDryRun
, cvecnConnectionNotificationARN
, cvecnConnectionEvents
, createVPCEndpointConnectionNotificationResponse
, CreateVPCEndpointConnectionNotificationResponse
, cvecnrsClientToken
, cvecnrsConnectionNotification
, cvecnrsResponseStatus
) 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 CreateVPCEndpointConnectionNotification = CreateVPCEndpointConnectionNotification'
{ _cvecnClientToken :: !(Maybe Text)
, _cvecnServiceId :: !(Maybe Text)
, _cvecnVPCEndpointId :: !(Maybe Text)
, _cvecnDryRun :: !(Maybe Bool)
, _cvecnConnectionNotificationARN :: !Text
, _cvecnConnectionEvents :: ![Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createVPCEndpointConnectionNotification
:: Text
-> CreateVPCEndpointConnectionNotification
createVPCEndpointConnectionNotification pConnectionNotificationARN_ =
CreateVPCEndpointConnectionNotification'
{ _cvecnClientToken = Nothing
, _cvecnServiceId = Nothing
, _cvecnVPCEndpointId = Nothing
, _cvecnDryRun = Nothing
, _cvecnConnectionNotificationARN = pConnectionNotificationARN_
, _cvecnConnectionEvents = mempty
}
cvecnClientToken :: Lens' CreateVPCEndpointConnectionNotification (Maybe Text)
cvecnClientToken = lens _cvecnClientToken (\ s a -> s{_cvecnClientToken = a})
cvecnServiceId :: Lens' CreateVPCEndpointConnectionNotification (Maybe Text)
cvecnServiceId = lens _cvecnServiceId (\ s a -> s{_cvecnServiceId = a})
cvecnVPCEndpointId :: Lens' CreateVPCEndpointConnectionNotification (Maybe Text)
cvecnVPCEndpointId = lens _cvecnVPCEndpointId (\ s a -> s{_cvecnVPCEndpointId = a})
cvecnDryRun :: Lens' CreateVPCEndpointConnectionNotification (Maybe Bool)
cvecnDryRun = lens _cvecnDryRun (\ s a -> s{_cvecnDryRun = a})
cvecnConnectionNotificationARN :: Lens' CreateVPCEndpointConnectionNotification Text
cvecnConnectionNotificationARN = lens _cvecnConnectionNotificationARN (\ s a -> s{_cvecnConnectionNotificationARN = a})
cvecnConnectionEvents :: Lens' CreateVPCEndpointConnectionNotification [Text]
cvecnConnectionEvents = lens _cvecnConnectionEvents (\ s a -> s{_cvecnConnectionEvents = a}) . _Coerce
instance AWSRequest
CreateVPCEndpointConnectionNotification
where
type Rs CreateVPCEndpointConnectionNotification =
CreateVPCEndpointConnectionNotificationResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
CreateVPCEndpointConnectionNotificationResponse' <$>
(x .@? "clientToken") <*>
(x .@? "connectionNotification")
<*> (pure (fromEnum s)))
instance Hashable
CreateVPCEndpointConnectionNotification
where
instance NFData
CreateVPCEndpointConnectionNotification
where
instance ToHeaders
CreateVPCEndpointConnectionNotification
where
toHeaders = const mempty
instance ToPath
CreateVPCEndpointConnectionNotification
where
toPath = const "/"
instance ToQuery
CreateVPCEndpointConnectionNotification
where
toQuery CreateVPCEndpointConnectionNotification'{..}
= mconcat
["Action" =:
("CreateVpcEndpointConnectionNotification" ::
ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"ClientToken" =: _cvecnClientToken,
"ServiceId" =: _cvecnServiceId,
"VpcEndpointId" =: _cvecnVPCEndpointId,
"DryRun" =: _cvecnDryRun,
"ConnectionNotificationArn" =:
_cvecnConnectionNotificationARN,
toQueryList "ConnectionEvents"
_cvecnConnectionEvents]
data CreateVPCEndpointConnectionNotificationResponse = CreateVPCEndpointConnectionNotificationResponse'
{ _cvecnrsClientToken :: !(Maybe Text)
, _cvecnrsConnectionNotification :: !(Maybe ConnectionNotification)
, _cvecnrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createVPCEndpointConnectionNotificationResponse
:: Int
-> CreateVPCEndpointConnectionNotificationResponse
createVPCEndpointConnectionNotificationResponse pResponseStatus_ =
CreateVPCEndpointConnectionNotificationResponse'
{ _cvecnrsClientToken = Nothing
, _cvecnrsConnectionNotification = Nothing
, _cvecnrsResponseStatus = pResponseStatus_
}
cvecnrsClientToken :: Lens' CreateVPCEndpointConnectionNotificationResponse (Maybe Text)
cvecnrsClientToken = lens _cvecnrsClientToken (\ s a -> s{_cvecnrsClientToken = a})
cvecnrsConnectionNotification :: Lens' CreateVPCEndpointConnectionNotificationResponse (Maybe ConnectionNotification)
cvecnrsConnectionNotification = lens _cvecnrsConnectionNotification (\ s a -> s{_cvecnrsConnectionNotification = a})
cvecnrsResponseStatus :: Lens' CreateVPCEndpointConnectionNotificationResponse Int
cvecnrsResponseStatus = lens _cvecnrsResponseStatus (\ s a -> s{_cvecnrsResponseStatus = a})
instance NFData
CreateVPCEndpointConnectionNotificationResponse
where