{-# 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.GetRegexPatternSet
(
getRegexPatternSet
, GetRegexPatternSet
, grpsRegexPatternSetId
, getRegexPatternSetResponse
, GetRegexPatternSetResponse
, grpsrsRegexPatternSet
, grpsrsResponseStatus
) 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 GetRegexPatternSet = GetRegexPatternSet'
{ _grpsRegexPatternSetId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getRegexPatternSet
:: Text
-> GetRegexPatternSet
getRegexPatternSet pRegexPatternSetId_ =
GetRegexPatternSet' {_grpsRegexPatternSetId = pRegexPatternSetId_}
grpsRegexPatternSetId :: Lens' GetRegexPatternSet Text
grpsRegexPatternSetId = lens _grpsRegexPatternSetId (\ s a -> s{_grpsRegexPatternSetId = a})
instance AWSRequest GetRegexPatternSet where
type Rs GetRegexPatternSet =
GetRegexPatternSetResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
GetRegexPatternSetResponse' <$>
(x .?> "RegexPatternSet") <*> (pure (fromEnum s)))
instance Hashable GetRegexPatternSet where
instance NFData GetRegexPatternSet where
instance ToHeaders GetRegexPatternSet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.GetRegexPatternSet" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetRegexPatternSet where
toJSON GetRegexPatternSet'{..}
= object
(catMaybes
[Just
("RegexPatternSetId" .= _grpsRegexPatternSetId)])
instance ToPath GetRegexPatternSet where
toPath = const "/"
instance ToQuery GetRegexPatternSet where
toQuery = const mempty
data GetRegexPatternSetResponse = GetRegexPatternSetResponse'
{ _grpsrsRegexPatternSet :: !(Maybe RegexPatternSet)
, _grpsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getRegexPatternSetResponse
:: Int
-> GetRegexPatternSetResponse
getRegexPatternSetResponse pResponseStatus_ =
GetRegexPatternSetResponse'
{_grpsrsRegexPatternSet = Nothing, _grpsrsResponseStatus = pResponseStatus_}
grpsrsRegexPatternSet :: Lens' GetRegexPatternSetResponse (Maybe RegexPatternSet)
grpsrsRegexPatternSet = lens _grpsrsRegexPatternSet (\ s a -> s{_grpsrsRegexPatternSet = a})
grpsrsResponseStatus :: Lens' GetRegexPatternSetResponse Int
grpsrsResponseStatus = lens _grpsrsResponseStatus (\ s a -> s{_grpsrsResponseStatus = a})
instance NFData GetRegexPatternSetResponse where