{-# 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.GetRegexMatchSet
(
getRegexMatchSet
, GetRegexMatchSet
, grmsRegexMatchSetId
, getRegexMatchSetResponse
, GetRegexMatchSetResponse
, grmsrsRegexMatchSet
, grmsrsResponseStatus
) 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 GetRegexMatchSet = GetRegexMatchSet'
{ _grmsRegexMatchSetId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getRegexMatchSet
:: Text
-> GetRegexMatchSet
getRegexMatchSet pRegexMatchSetId_ =
GetRegexMatchSet' {_grmsRegexMatchSetId = pRegexMatchSetId_}
grmsRegexMatchSetId :: Lens' GetRegexMatchSet Text
grmsRegexMatchSetId = lens _grmsRegexMatchSetId (\ s a -> s{_grmsRegexMatchSetId = a})
instance AWSRequest GetRegexMatchSet where
type Rs GetRegexMatchSet = GetRegexMatchSetResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
GetRegexMatchSetResponse' <$>
(x .?> "RegexMatchSet") <*> (pure (fromEnum s)))
instance Hashable GetRegexMatchSet where
instance NFData GetRegexMatchSet where
instance ToHeaders GetRegexMatchSet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.GetRegexMatchSet" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetRegexMatchSet where
toJSON GetRegexMatchSet'{..}
= object
(catMaybes
[Just ("RegexMatchSetId" .= _grmsRegexMatchSetId)])
instance ToPath GetRegexMatchSet where
toPath = const "/"
instance ToQuery GetRegexMatchSet where
toQuery = const mempty
data GetRegexMatchSetResponse = GetRegexMatchSetResponse'
{ _grmsrsRegexMatchSet :: !(Maybe RegexMatchSet)
, _grmsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getRegexMatchSetResponse
:: Int
-> GetRegexMatchSetResponse
getRegexMatchSetResponse pResponseStatus_ =
GetRegexMatchSetResponse'
{_grmsrsRegexMatchSet = Nothing, _grmsrsResponseStatus = pResponseStatus_}
grmsrsRegexMatchSet :: Lens' GetRegexMatchSetResponse (Maybe RegexMatchSet)
grmsrsRegexMatchSet = lens _grmsrsRegexMatchSet (\ s a -> s{_grmsrsRegexMatchSet = a})
grmsrsResponseStatus :: Lens' GetRegexMatchSetResponse Int
grmsrsResponseStatus = lens _grmsrsResponseStatus (\ s a -> s{_grmsrsResponseStatus = a})
instance NFData GetRegexMatchSetResponse where