{-# 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.ReplaceNetworkACLAssociation
(
replaceNetworkACLAssociation
, ReplaceNetworkACLAssociation
, rnaaDryRun
, rnaaAssociationId
, rnaaNetworkACLId
, replaceNetworkACLAssociationResponse
, ReplaceNetworkACLAssociationResponse
, rnaarsNewAssociationId
, rnaarsResponseStatus
) 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 ReplaceNetworkACLAssociation = ReplaceNetworkACLAssociation'
{ _rnaaDryRun :: !(Maybe Bool)
, _rnaaAssociationId :: !Text
, _rnaaNetworkACLId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
replaceNetworkACLAssociation
:: Text
-> Text
-> ReplaceNetworkACLAssociation
replaceNetworkACLAssociation pAssociationId_ pNetworkACLId_ =
ReplaceNetworkACLAssociation'
{ _rnaaDryRun = Nothing
, _rnaaAssociationId = pAssociationId_
, _rnaaNetworkACLId = pNetworkACLId_
}
rnaaDryRun :: Lens' ReplaceNetworkACLAssociation (Maybe Bool)
rnaaDryRun = lens _rnaaDryRun (\ s a -> s{_rnaaDryRun = a})
rnaaAssociationId :: Lens' ReplaceNetworkACLAssociation Text
rnaaAssociationId = lens _rnaaAssociationId (\ s a -> s{_rnaaAssociationId = a})
rnaaNetworkACLId :: Lens' ReplaceNetworkACLAssociation Text
rnaaNetworkACLId = lens _rnaaNetworkACLId (\ s a -> s{_rnaaNetworkACLId = a})
instance AWSRequest ReplaceNetworkACLAssociation
where
type Rs ReplaceNetworkACLAssociation =
ReplaceNetworkACLAssociationResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
ReplaceNetworkACLAssociationResponse' <$>
(x .@? "newAssociationId") <*> (pure (fromEnum s)))
instance Hashable ReplaceNetworkACLAssociation where
instance NFData ReplaceNetworkACLAssociation where
instance ToHeaders ReplaceNetworkACLAssociation where
toHeaders = const mempty
instance ToPath ReplaceNetworkACLAssociation where
toPath = const "/"
instance ToQuery ReplaceNetworkACLAssociation where
toQuery ReplaceNetworkACLAssociation'{..}
= mconcat
["Action" =:
("ReplaceNetworkAclAssociation" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"DryRun" =: _rnaaDryRun,
"AssociationId" =: _rnaaAssociationId,
"NetworkAclId" =: _rnaaNetworkACLId]
data ReplaceNetworkACLAssociationResponse = ReplaceNetworkACLAssociationResponse'
{ _rnaarsNewAssociationId :: !(Maybe Text)
, _rnaarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
replaceNetworkACLAssociationResponse
:: Int
-> ReplaceNetworkACLAssociationResponse
replaceNetworkACLAssociationResponse pResponseStatus_ =
ReplaceNetworkACLAssociationResponse'
{ _rnaarsNewAssociationId = Nothing
, _rnaarsResponseStatus = pResponseStatus_
}
rnaarsNewAssociationId :: Lens' ReplaceNetworkACLAssociationResponse (Maybe Text)
rnaarsNewAssociationId = lens _rnaarsNewAssociationId (\ s a -> s{_rnaarsNewAssociationId = a})
rnaarsResponseStatus :: Lens' ReplaceNetworkACLAssociationResponse Int
rnaarsResponseStatus = lens _rnaarsResponseStatus (\ s a -> s{_rnaarsResponseStatus = a})
instance NFData ReplaceNetworkACLAssociationResponse
where