{-# 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.DeleteRuleGroup
(
deleteRuleGroup
, DeleteRuleGroup
, drgRuleGroupId
, drgChangeToken
, deleteRuleGroupResponse
, DeleteRuleGroupResponse
, drgrsChangeToken
, drgrsResponseStatus
) 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 DeleteRuleGroup = DeleteRuleGroup'
{ _drgRuleGroupId :: !Text
, _drgChangeToken :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteRuleGroup
:: Text
-> Text
-> DeleteRuleGroup
deleteRuleGroup pRuleGroupId_ pChangeToken_ =
DeleteRuleGroup'
{_drgRuleGroupId = pRuleGroupId_, _drgChangeToken = pChangeToken_}
drgRuleGroupId :: Lens' DeleteRuleGroup Text
drgRuleGroupId = lens _drgRuleGroupId (\ s a -> s{_drgRuleGroupId = a})
drgChangeToken :: Lens' DeleteRuleGroup Text
drgChangeToken = lens _drgChangeToken (\ s a -> s{_drgChangeToken = a})
instance AWSRequest DeleteRuleGroup where
type Rs DeleteRuleGroup = DeleteRuleGroupResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
DeleteRuleGroupResponse' <$>
(x .?> "ChangeToken") <*> (pure (fromEnum s)))
instance Hashable DeleteRuleGroup where
instance NFData DeleteRuleGroup where
instance ToHeaders DeleteRuleGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.DeleteRuleGroup" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteRuleGroup where
toJSON DeleteRuleGroup'{..}
= object
(catMaybes
[Just ("RuleGroupId" .= _drgRuleGroupId),
Just ("ChangeToken" .= _drgChangeToken)])
instance ToPath DeleteRuleGroup where
toPath = const "/"
instance ToQuery DeleteRuleGroup where
toQuery = const mempty
data DeleteRuleGroupResponse = DeleteRuleGroupResponse'
{ _drgrsChangeToken :: !(Maybe Text)
, _drgrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteRuleGroupResponse
:: Int
-> DeleteRuleGroupResponse
deleteRuleGroupResponse pResponseStatus_ =
DeleteRuleGroupResponse'
{_drgrsChangeToken = Nothing, _drgrsResponseStatus = pResponseStatus_}
drgrsChangeToken :: Lens' DeleteRuleGroupResponse (Maybe Text)
drgrsChangeToken = lens _drgrsChangeToken (\ s a -> s{_drgrsChangeToken = a})
drgrsResponseStatus :: Lens' DeleteRuleGroupResponse Int
drgrsResponseStatus = lens _drgrsResponseStatus (\ s a -> s{_drgrsResponseStatus = a})
instance NFData DeleteRuleGroupResponse where