{-# 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.DeleteIPSet
(
deleteIPSet
, DeleteIPSet
, disIPSetId
, disChangeToken
, deleteIPSetResponse
, DeleteIPSetResponse
, disrsChangeToken
, disrsResponseStatus
) 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 DeleteIPSet = DeleteIPSet'
{ _disIPSetId :: !Text
, _disChangeToken :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteIPSet
:: Text
-> Text
-> DeleteIPSet
deleteIPSet pIPSetId_ pChangeToken_ =
DeleteIPSet'
{ _disIPSetId = pIPSetId_
, _disChangeToken = pChangeToken_
}
disIPSetId :: Lens' DeleteIPSet Text
disIPSetId = lens _disIPSetId (\ s a -> s{_disIPSetId = a});
disChangeToken :: Lens' DeleteIPSet Text
disChangeToken = lens _disChangeToken (\ s a -> s{_disChangeToken = a});
instance AWSRequest DeleteIPSet where
type Rs DeleteIPSet = DeleteIPSetResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
DeleteIPSetResponse' <$>
(x .?> "ChangeToken") <*> (pure (fromEnum s)))
instance Hashable DeleteIPSet
instance NFData DeleteIPSet
instance ToHeaders DeleteIPSet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.DeleteIPSet" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteIPSet where
toJSON DeleteIPSet'{..}
= object
(catMaybes
[Just ("IPSetId" .= _disIPSetId),
Just ("ChangeToken" .= _disChangeToken)])
instance ToPath DeleteIPSet where
toPath = const "/"
instance ToQuery DeleteIPSet where
toQuery = const mempty
data DeleteIPSetResponse = DeleteIPSetResponse'
{ _disrsChangeToken :: !(Maybe Text)
, _disrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteIPSetResponse
:: Int
-> DeleteIPSetResponse
deleteIPSetResponse pResponseStatus_ =
DeleteIPSetResponse'
{ _disrsChangeToken = Nothing
, _disrsResponseStatus = pResponseStatus_
}
disrsChangeToken :: Lens' DeleteIPSetResponse (Maybe Text)
disrsChangeToken = lens _disrsChangeToken (\ s a -> s{_disrsChangeToken = a});
disrsResponseStatus :: Lens' DeleteIPSetResponse Int
disrsResponseStatus = lens _disrsResponseStatus (\ s a -> s{_disrsResponseStatus = a});
instance NFData DeleteIPSetResponse