{-# 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.DeleteRateBasedRule
(
deleteRateBasedRule
, DeleteRateBasedRule
, drbrRuleId
, drbrChangeToken
, deleteRateBasedRuleResponse
, DeleteRateBasedRuleResponse
, drbrrsChangeToken
, drbrrsResponseStatus
) 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 DeleteRateBasedRule = DeleteRateBasedRule'
{ _drbrRuleId :: !Text
, _drbrChangeToken :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteRateBasedRule
:: Text
-> Text
-> DeleteRateBasedRule
deleteRateBasedRule pRuleId_ pChangeToken_ =
DeleteRateBasedRule'
{_drbrRuleId = pRuleId_, _drbrChangeToken = pChangeToken_}
drbrRuleId :: Lens' DeleteRateBasedRule Text
drbrRuleId = lens _drbrRuleId (\ s a -> s{_drbrRuleId = a})
drbrChangeToken :: Lens' DeleteRateBasedRule Text
drbrChangeToken = lens _drbrChangeToken (\ s a -> s{_drbrChangeToken = a})
instance AWSRequest DeleteRateBasedRule where
type Rs DeleteRateBasedRule =
DeleteRateBasedRuleResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
DeleteRateBasedRuleResponse' <$>
(x .?> "ChangeToken") <*> (pure (fromEnum s)))
instance Hashable DeleteRateBasedRule where
instance NFData DeleteRateBasedRule where
instance ToHeaders DeleteRateBasedRule where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.DeleteRateBasedRule" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteRateBasedRule where
toJSON DeleteRateBasedRule'{..}
= object
(catMaybes
[Just ("RuleId" .= _drbrRuleId),
Just ("ChangeToken" .= _drbrChangeToken)])
instance ToPath DeleteRateBasedRule where
toPath = const "/"
instance ToQuery DeleteRateBasedRule where
toQuery = const mempty
data DeleteRateBasedRuleResponse = DeleteRateBasedRuleResponse'
{ _drbrrsChangeToken :: !(Maybe Text)
, _drbrrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteRateBasedRuleResponse
:: Int
-> DeleteRateBasedRuleResponse
deleteRateBasedRuleResponse pResponseStatus_ =
DeleteRateBasedRuleResponse'
{_drbrrsChangeToken = Nothing, _drbrrsResponseStatus = pResponseStatus_}
drbrrsChangeToken :: Lens' DeleteRateBasedRuleResponse (Maybe Text)
drbrrsChangeToken = lens _drbrrsChangeToken (\ s a -> s{_drbrrsChangeToken = a})
drbrrsResponseStatus :: Lens' DeleteRateBasedRuleResponse Int
drbrrsResponseStatus = lens _drbrrsResponseStatus (\ s a -> s{_drbrrsResponseStatus = a})
instance NFData DeleteRateBasedRuleResponse where