{-# 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.DeleteGeoMatchSet
(
deleteGeoMatchSet
, DeleteGeoMatchSet
, dgmsGeoMatchSetId
, dgmsChangeToken
, deleteGeoMatchSetResponse
, DeleteGeoMatchSetResponse
, dgmsrsChangeToken
, dgmsrsResponseStatus
) 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
data DeleteGeoMatchSet = DeleteGeoMatchSet'
{ _dgmsGeoMatchSetId :: !Text
, _dgmsChangeToken :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteGeoMatchSet
:: Text
-> Text
-> DeleteGeoMatchSet
deleteGeoMatchSet pGeoMatchSetId_ pChangeToken_ =
DeleteGeoMatchSet'
{_dgmsGeoMatchSetId = pGeoMatchSetId_, _dgmsChangeToken = pChangeToken_}
dgmsGeoMatchSetId :: Lens' DeleteGeoMatchSet Text
dgmsGeoMatchSetId = lens _dgmsGeoMatchSetId (\ s a -> s{_dgmsGeoMatchSetId = a})
dgmsChangeToken :: Lens' DeleteGeoMatchSet Text
dgmsChangeToken = lens _dgmsChangeToken (\ s a -> s{_dgmsChangeToken = a})
instance AWSRequest DeleteGeoMatchSet where
type Rs DeleteGeoMatchSet = DeleteGeoMatchSetResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
DeleteGeoMatchSetResponse' <$>
(x .?> "ChangeToken") <*> (pure (fromEnum s)))
instance Hashable DeleteGeoMatchSet where
instance NFData DeleteGeoMatchSet where
instance ToHeaders DeleteGeoMatchSet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.DeleteGeoMatchSet" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteGeoMatchSet where
toJSON DeleteGeoMatchSet'{..}
= object
(catMaybes
[Just ("GeoMatchSetId" .= _dgmsGeoMatchSetId),
Just ("ChangeToken" .= _dgmsChangeToken)])
instance ToPath DeleteGeoMatchSet where
toPath = const "/"
instance ToQuery DeleteGeoMatchSet where
toQuery = const mempty
data DeleteGeoMatchSetResponse = DeleteGeoMatchSetResponse'
{ _dgmsrsChangeToken :: !(Maybe Text)
, _dgmsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteGeoMatchSetResponse
:: Int
-> DeleteGeoMatchSetResponse
deleteGeoMatchSetResponse pResponseStatus_ =
DeleteGeoMatchSetResponse'
{_dgmsrsChangeToken = Nothing, _dgmsrsResponseStatus = pResponseStatus_}
dgmsrsChangeToken :: Lens' DeleteGeoMatchSetResponse (Maybe Text)
dgmsrsChangeToken = lens _dgmsrsChangeToken (\ s a -> s{_dgmsrsChangeToken = a})
dgmsrsResponseStatus :: Lens' DeleteGeoMatchSetResponse Int
dgmsrsResponseStatus = lens _dgmsrsResponseStatus (\ s a -> s{_dgmsrsResponseStatus = a})
instance NFData DeleteGeoMatchSetResponse where