{-# 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.DeleteRegexMatchSet
(
deleteRegexMatchSet
, DeleteRegexMatchSet
, drmsRegexMatchSetId
, drmsChangeToken
, deleteRegexMatchSetResponse
, DeleteRegexMatchSetResponse
, drmsrsChangeToken
, drmsrsResponseStatus
) 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 DeleteRegexMatchSet = DeleteRegexMatchSet'
{ _drmsRegexMatchSetId :: !Text
, _drmsChangeToken :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteRegexMatchSet
:: Text
-> Text
-> DeleteRegexMatchSet
deleteRegexMatchSet pRegexMatchSetId_ pChangeToken_ =
DeleteRegexMatchSet'
{_drmsRegexMatchSetId = pRegexMatchSetId_, _drmsChangeToken = pChangeToken_}
drmsRegexMatchSetId :: Lens' DeleteRegexMatchSet Text
drmsRegexMatchSetId = lens _drmsRegexMatchSetId (\ s a -> s{_drmsRegexMatchSetId = a})
drmsChangeToken :: Lens' DeleteRegexMatchSet Text
drmsChangeToken = lens _drmsChangeToken (\ s a -> s{_drmsChangeToken = a})
instance AWSRequest DeleteRegexMatchSet where
type Rs DeleteRegexMatchSet =
DeleteRegexMatchSetResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
DeleteRegexMatchSetResponse' <$>
(x .?> "ChangeToken") <*> (pure (fromEnum s)))
instance Hashable DeleteRegexMatchSet where
instance NFData DeleteRegexMatchSet where
instance ToHeaders DeleteRegexMatchSet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.DeleteRegexMatchSet" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteRegexMatchSet where
toJSON DeleteRegexMatchSet'{..}
= object
(catMaybes
[Just ("RegexMatchSetId" .= _drmsRegexMatchSetId),
Just ("ChangeToken" .= _drmsChangeToken)])
instance ToPath DeleteRegexMatchSet where
toPath = const "/"
instance ToQuery DeleteRegexMatchSet where
toQuery = const mempty
data DeleteRegexMatchSetResponse = DeleteRegexMatchSetResponse'
{ _drmsrsChangeToken :: !(Maybe Text)
, _drmsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteRegexMatchSetResponse
:: Int
-> DeleteRegexMatchSetResponse
deleteRegexMatchSetResponse pResponseStatus_ =
DeleteRegexMatchSetResponse'
{_drmsrsChangeToken = Nothing, _drmsrsResponseStatus = pResponseStatus_}
drmsrsChangeToken :: Lens' DeleteRegexMatchSetResponse (Maybe Text)
drmsrsChangeToken = lens _drmsrsChangeToken (\ s a -> s{_drmsrsChangeToken = a})
drmsrsResponseStatus :: Lens' DeleteRegexMatchSetResponse Int
drmsrsResponseStatus = lens _drmsrsResponseStatus (\ s a -> s{_drmsrsResponseStatus = a})
instance NFData DeleteRegexMatchSetResponse where