{-# 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.WAF.GetSizeConstraintSet
(
getSizeConstraintSet
, GetSizeConstraintSet
, gscsSizeConstraintSetId
, getSizeConstraintSetResponse
, GetSizeConstraintSetResponse
, gscsrsSizeConstraintSet
, gscsrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.WAF.Types
import Network.AWS.WAF.Types.Product
newtype GetSizeConstraintSet = GetSizeConstraintSet'
{ _gscsSizeConstraintSetId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getSizeConstraintSet
:: Text
-> GetSizeConstraintSet
getSizeConstraintSet pSizeConstraintSetId_ =
GetSizeConstraintSet' {_gscsSizeConstraintSetId = pSizeConstraintSetId_}
gscsSizeConstraintSetId :: Lens' GetSizeConstraintSet Text
gscsSizeConstraintSetId = lens _gscsSizeConstraintSetId (\ s a -> s{_gscsSizeConstraintSetId = a})
instance AWSRequest GetSizeConstraintSet where
type Rs GetSizeConstraintSet =
GetSizeConstraintSetResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
GetSizeConstraintSetResponse' <$>
(x .?> "SizeConstraintSet") <*> (pure (fromEnum s)))
instance Hashable GetSizeConstraintSet where
instance NFData GetSizeConstraintSet where
instance ToHeaders GetSizeConstraintSet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.GetSizeConstraintSet" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetSizeConstraintSet where
toJSON GetSizeConstraintSet'{..}
= object
(catMaybes
[Just
("SizeConstraintSetId" .= _gscsSizeConstraintSetId)])
instance ToPath GetSizeConstraintSet where
toPath = const "/"
instance ToQuery GetSizeConstraintSet where
toQuery = const mempty
data GetSizeConstraintSetResponse = GetSizeConstraintSetResponse'
{ _gscsrsSizeConstraintSet :: !(Maybe SizeConstraintSet)
, _gscsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getSizeConstraintSetResponse
:: Int
-> GetSizeConstraintSetResponse
getSizeConstraintSetResponse pResponseStatus_ =
GetSizeConstraintSetResponse'
{ _gscsrsSizeConstraintSet = Nothing
, _gscsrsResponseStatus = pResponseStatus_
}
gscsrsSizeConstraintSet :: Lens' GetSizeConstraintSetResponse (Maybe SizeConstraintSet)
gscsrsSizeConstraintSet = lens _gscsrsSizeConstraintSet (\ s a -> s{_gscsrsSizeConstraintSet = a})
gscsrsResponseStatus :: Lens' GetSizeConstraintSetResponse Int
gscsrsResponseStatus = lens _gscsrsResponseStatus (\ s a -> s{_gscsrsResponseStatus = a})
instance NFData GetSizeConstraintSetResponse where