{-# 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.GetGeoMatchSet
(
getGeoMatchSet
, GetGeoMatchSet
, ggmsGeoMatchSetId
, getGeoMatchSetResponse
, GetGeoMatchSetResponse
, ggmsrsGeoMatchSet
, ggmsrsResponseStatus
) 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 GetGeoMatchSet = GetGeoMatchSet'
{ _ggmsGeoMatchSetId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getGeoMatchSet
:: Text
-> GetGeoMatchSet
getGeoMatchSet pGeoMatchSetId_ =
GetGeoMatchSet' {_ggmsGeoMatchSetId = pGeoMatchSetId_}
ggmsGeoMatchSetId :: Lens' GetGeoMatchSet Text
ggmsGeoMatchSetId = lens _ggmsGeoMatchSetId (\ s a -> s{_ggmsGeoMatchSetId = a})
instance AWSRequest GetGeoMatchSet where
type Rs GetGeoMatchSet = GetGeoMatchSetResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
GetGeoMatchSetResponse' <$>
(x .?> "GeoMatchSet") <*> (pure (fromEnum s)))
instance Hashable GetGeoMatchSet where
instance NFData GetGeoMatchSet where
instance ToHeaders GetGeoMatchSet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.GetGeoMatchSet" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetGeoMatchSet where
toJSON GetGeoMatchSet'{..}
= object
(catMaybes
[Just ("GeoMatchSetId" .= _ggmsGeoMatchSetId)])
instance ToPath GetGeoMatchSet where
toPath = const "/"
instance ToQuery GetGeoMatchSet where
toQuery = const mempty
data GetGeoMatchSetResponse = GetGeoMatchSetResponse'
{ _ggmsrsGeoMatchSet :: !(Maybe GeoMatchSet)
, _ggmsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getGeoMatchSetResponse
:: Int
-> GetGeoMatchSetResponse
getGeoMatchSetResponse pResponseStatus_ =
GetGeoMatchSetResponse'
{_ggmsrsGeoMatchSet = Nothing, _ggmsrsResponseStatus = pResponseStatus_}
ggmsrsGeoMatchSet :: Lens' GetGeoMatchSetResponse (Maybe GeoMatchSet)
ggmsrsGeoMatchSet = lens _ggmsrsGeoMatchSet (\ s a -> s{_ggmsrsGeoMatchSet = a})
ggmsrsResponseStatus :: Lens' GetGeoMatchSetResponse Int
ggmsrsResponseStatus = lens _ggmsrsResponseStatus (\ s a -> s{_ggmsrsResponseStatus = a})
instance NFData GetGeoMatchSetResponse where