{-# 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.GetWebACL
(
getWebACL
, GetWebACL
, gwaWebACLId
, getWebACLResponse
, GetWebACLResponse
, gwarsWebACL
, gwarsResponseStatus
) 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
newtype GetWebACL = GetWebACL'
{ _gwaWebACLId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getWebACL
:: Text
-> GetWebACL
getWebACL pWebACLId_ = GetWebACL' {_gwaWebACLId = pWebACLId_}
gwaWebACLId :: Lens' GetWebACL Text
gwaWebACLId = lens _gwaWebACLId (\ s a -> s{_gwaWebACLId = a})
instance AWSRequest GetWebACL where
type Rs GetWebACL = GetWebACLResponse
request = postJSON wAFRegional
response
= receiveJSON
(\ s h x ->
GetWebACLResponse' <$>
(x .?> "WebACL") <*> (pure (fromEnum s)))
instance Hashable GetWebACL where
instance NFData GetWebACL where
instance ToHeaders GetWebACL where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_Regional_20161128.GetWebACL" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetWebACL where
toJSON GetWebACL'{..}
= object
(catMaybes [Just ("WebACLId" .= _gwaWebACLId)])
instance ToPath GetWebACL where
toPath = const "/"
instance ToQuery GetWebACL where
toQuery = const mempty
data GetWebACLResponse = GetWebACLResponse'
{ _gwarsWebACL :: !(Maybe WebACL)
, _gwarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getWebACLResponse
:: Int
-> GetWebACLResponse
getWebACLResponse pResponseStatus_ =
GetWebACLResponse'
{_gwarsWebACL = Nothing, _gwarsResponseStatus = pResponseStatus_}
gwarsWebACL :: Lens' GetWebACLResponse (Maybe WebACL)
gwarsWebACL = lens _gwarsWebACL (\ s a -> s{_gwarsWebACL = a})
gwarsResponseStatus :: Lens' GetWebACLResponse Int
gwarsResponseStatus = lens _gwarsResponseStatus (\ s a -> s{_gwarsResponseStatus = a})
instance NFData GetWebACLResponse where