{-# 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.DeleteRegexPatternSet
(
deleteRegexPatternSet
, DeleteRegexPatternSet
, drpsRegexPatternSetId
, drpsChangeToken
, deleteRegexPatternSetResponse
, DeleteRegexPatternSetResponse
, drpsrsChangeToken
, drpsrsResponseStatus
) 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 DeleteRegexPatternSet = DeleteRegexPatternSet'
{ _drpsRegexPatternSetId :: !Text
, _drpsChangeToken :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteRegexPatternSet
:: Text
-> Text
-> DeleteRegexPatternSet
deleteRegexPatternSet pRegexPatternSetId_ pChangeToken_ =
DeleteRegexPatternSet'
{ _drpsRegexPatternSetId = pRegexPatternSetId_
, _drpsChangeToken = pChangeToken_
}
drpsRegexPatternSetId :: Lens' DeleteRegexPatternSet Text
drpsRegexPatternSetId = lens _drpsRegexPatternSetId (\ s a -> s{_drpsRegexPatternSetId = a})
drpsChangeToken :: Lens' DeleteRegexPatternSet Text
drpsChangeToken = lens _drpsChangeToken (\ s a -> s{_drpsChangeToken = a})
instance AWSRequest DeleteRegexPatternSet where
type Rs DeleteRegexPatternSet =
DeleteRegexPatternSetResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
DeleteRegexPatternSetResponse' <$>
(x .?> "ChangeToken") <*> (pure (fromEnum s)))
instance Hashable DeleteRegexPatternSet where
instance NFData DeleteRegexPatternSet where
instance ToHeaders DeleteRegexPatternSet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.DeleteRegexPatternSet" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteRegexPatternSet where
toJSON DeleteRegexPatternSet'{..}
= object
(catMaybes
[Just
("RegexPatternSetId" .= _drpsRegexPatternSetId),
Just ("ChangeToken" .= _drpsChangeToken)])
instance ToPath DeleteRegexPatternSet where
toPath = const "/"
instance ToQuery DeleteRegexPatternSet where
toQuery = const mempty
data DeleteRegexPatternSetResponse = DeleteRegexPatternSetResponse'
{ _drpsrsChangeToken :: !(Maybe Text)
, _drpsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteRegexPatternSetResponse
:: Int
-> DeleteRegexPatternSetResponse
deleteRegexPatternSetResponse pResponseStatus_ =
DeleteRegexPatternSetResponse'
{_drpsrsChangeToken = Nothing, _drpsrsResponseStatus = pResponseStatus_}
drpsrsChangeToken :: Lens' DeleteRegexPatternSetResponse (Maybe Text)
drpsrsChangeToken = lens _drpsrsChangeToken (\ s a -> s{_drpsrsChangeToken = a})
drpsrsResponseStatus :: Lens' DeleteRegexPatternSetResponse Int
drpsrsResponseStatus = lens _drpsrsResponseStatus (\ s a -> s{_drpsrsResponseStatus = a})
instance NFData DeleteRegexPatternSetResponse where