{-# 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.WAFRegional.AssociateWebACL
(
associateWebACL
, AssociateWebACL
, awaWebACLId
, awaResourceARN
, associateWebACLResponse
, AssociateWebACLResponse
, awarsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.WAFRegional.Types
import Network.AWS.WAFRegional.Types.Product
data AssociateWebACL = AssociateWebACL'
{ _awaWebACLId :: !Text
, _awaResourceARN :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateWebACL
:: Text
-> Text
-> AssociateWebACL
associateWebACL pWebACLId_ pResourceARN_ =
AssociateWebACL' {_awaWebACLId = pWebACLId_, _awaResourceARN = pResourceARN_}
awaWebACLId :: Lens' AssociateWebACL Text
awaWebACLId = lens _awaWebACLId (\ s a -> s{_awaWebACLId = a})
awaResourceARN :: Lens' AssociateWebACL Text
awaResourceARN = lens _awaResourceARN (\ s a -> s{_awaResourceARN = a})
instance AWSRequest AssociateWebACL where
type Rs AssociateWebACL = AssociateWebACLResponse
request = postJSON wAFRegional
response
= receiveEmpty
(\ s h x ->
AssociateWebACLResponse' <$> (pure (fromEnum s)))
instance Hashable AssociateWebACL where
instance NFData AssociateWebACL where
instance ToHeaders AssociateWebACL where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_Regional_20161128.AssociateWebACL" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AssociateWebACL where
toJSON AssociateWebACL'{..}
= object
(catMaybes
[Just ("WebACLId" .= _awaWebACLId),
Just ("ResourceArn" .= _awaResourceARN)])
instance ToPath AssociateWebACL where
toPath = const "/"
instance ToQuery AssociateWebACL where
toQuery = const mempty
newtype AssociateWebACLResponse = AssociateWebACLResponse'
{ _awarsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateWebACLResponse
:: Int
-> AssociateWebACLResponse
associateWebACLResponse pResponseStatus_ =
AssociateWebACLResponse' {_awarsResponseStatus = pResponseStatus_}
awarsResponseStatus :: Lens' AssociateWebACLResponse Int
awarsResponseStatus = lens _awarsResponseStatus (\ s a -> s{_awarsResponseStatus = a})
instance NFData AssociateWebACLResponse where