{-# 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.GetXSSMatchSet
(
getXSSMatchSet
, GetXSSMatchSet
, gxmsXSSMatchSetId
, getXSSMatchSetResponse
, GetXSSMatchSetResponse
, gxmsrsXSSMatchSet
, gxmsrsResponseStatus
) 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 GetXSSMatchSet = GetXSSMatchSet'
{ _gxmsXSSMatchSetId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getXSSMatchSet
:: Text
-> GetXSSMatchSet
getXSSMatchSet pXSSMatchSetId_ =
GetXSSMatchSet'
{ _gxmsXSSMatchSetId = pXSSMatchSetId_
}
gxmsXSSMatchSetId :: Lens' GetXSSMatchSet Text
gxmsXSSMatchSetId = lens _gxmsXSSMatchSetId (\ s a -> s{_gxmsXSSMatchSetId = a});
instance AWSRequest GetXSSMatchSet where
type Rs GetXSSMatchSet = GetXSSMatchSetResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
GetXSSMatchSetResponse' <$>
(x .?> "XssMatchSet") <*> (pure (fromEnum s)))
instance Hashable GetXSSMatchSet
instance NFData GetXSSMatchSet
instance ToHeaders GetXSSMatchSet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.GetXssMatchSet" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetXSSMatchSet where
toJSON GetXSSMatchSet'{..}
= object
(catMaybes
[Just ("XssMatchSetId" .= _gxmsXSSMatchSetId)])
instance ToPath GetXSSMatchSet where
toPath = const "/"
instance ToQuery GetXSSMatchSet where
toQuery = const mempty
data GetXSSMatchSetResponse = GetXSSMatchSetResponse'
{ _gxmsrsXSSMatchSet :: !(Maybe XSSMatchSet)
, _gxmsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getXSSMatchSetResponse
:: Int
-> GetXSSMatchSetResponse
getXSSMatchSetResponse pResponseStatus_ =
GetXSSMatchSetResponse'
{ _gxmsrsXSSMatchSet = Nothing
, _gxmsrsResponseStatus = pResponseStatus_
}
gxmsrsXSSMatchSet :: Lens' GetXSSMatchSetResponse (Maybe XSSMatchSet)
gxmsrsXSSMatchSet = lens _gxmsrsXSSMatchSet (\ s a -> s{_gxmsrsXSSMatchSet = a});
gxmsrsResponseStatus :: Lens' GetXSSMatchSetResponse Int
gxmsrsResponseStatus = lens _gxmsrsResponseStatus (\ s a -> s{_gxmsrsResponseStatus = a});
instance NFData GetXSSMatchSetResponse