{-# 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.CreateNetworkACL
(
createNetworkACL
, CreateNetworkACL
, cnaDryRun
, cnaVPCId
, createNetworkACLResponse
, CreateNetworkACLResponse
, cnarsNetworkACL
, cnarsResponseStatus
) 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 CreateNetworkACL = CreateNetworkACL'
{ _cnaDryRun :: !(Maybe Bool)
, _cnaVPCId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createNetworkACL
:: Text
-> CreateNetworkACL
createNetworkACL pVPCId_ =
CreateNetworkACL' {_cnaDryRun = Nothing, _cnaVPCId = pVPCId_}
cnaDryRun :: Lens' CreateNetworkACL (Maybe Bool)
cnaDryRun = lens _cnaDryRun (\ s a -> s{_cnaDryRun = a})
cnaVPCId :: Lens' CreateNetworkACL Text
cnaVPCId = lens _cnaVPCId (\ s a -> s{_cnaVPCId = a})
instance AWSRequest CreateNetworkACL where
type Rs CreateNetworkACL = CreateNetworkACLResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
CreateNetworkACLResponse' <$>
(x .@? "networkAcl") <*> (pure (fromEnum s)))
instance Hashable CreateNetworkACL where
instance NFData CreateNetworkACL where
instance ToHeaders CreateNetworkACL where
toHeaders = const mempty
instance ToPath CreateNetworkACL where
toPath = const "/"
instance ToQuery CreateNetworkACL where
toQuery CreateNetworkACL'{..}
= mconcat
["Action" =: ("CreateNetworkAcl" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"DryRun" =: _cnaDryRun, "VpcId" =: _cnaVPCId]
data CreateNetworkACLResponse = CreateNetworkACLResponse'
{ _cnarsNetworkACL :: !(Maybe NetworkACL)
, _cnarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createNetworkACLResponse
:: Int
-> CreateNetworkACLResponse
createNetworkACLResponse pResponseStatus_ =
CreateNetworkACLResponse'
{_cnarsNetworkACL = Nothing, _cnarsResponseStatus = pResponseStatus_}
cnarsNetworkACL :: Lens' CreateNetworkACLResponse (Maybe NetworkACL)
cnarsNetworkACL = lens _cnarsNetworkACL (\ s a -> s{_cnarsNetworkACL = a})
cnarsResponseStatus :: Lens' CreateNetworkACLResponse Int
cnarsResponseStatus = lens _cnarsResponseStatus (\ s a -> s{_cnarsResponseStatus = a})
instance NFData CreateNetworkACLResponse where