{-# 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.DeleteByteMatchSet
(
deleteByteMatchSet
, DeleteByteMatchSet
, dbmsByteMatchSetId
, dbmsChangeToken
, deleteByteMatchSetResponse
, DeleteByteMatchSetResponse
, dbmsrsChangeToken
, dbmsrsResponseStatus
) 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 DeleteByteMatchSet = DeleteByteMatchSet'
{ _dbmsByteMatchSetId :: !Text
, _dbmsChangeToken :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteByteMatchSet
:: Text
-> Text
-> DeleteByteMatchSet
deleteByteMatchSet pByteMatchSetId_ pChangeToken_ =
DeleteByteMatchSet'
{ _dbmsByteMatchSetId = pByteMatchSetId_
, _dbmsChangeToken = pChangeToken_
}
dbmsByteMatchSetId :: Lens' DeleteByteMatchSet Text
dbmsByteMatchSetId = lens _dbmsByteMatchSetId (\ s a -> s{_dbmsByteMatchSetId = a});
dbmsChangeToken :: Lens' DeleteByteMatchSet Text
dbmsChangeToken = lens _dbmsChangeToken (\ s a -> s{_dbmsChangeToken = a});
instance AWSRequest DeleteByteMatchSet where
type Rs DeleteByteMatchSet =
DeleteByteMatchSetResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
DeleteByteMatchSetResponse' <$>
(x .?> "ChangeToken") <*> (pure (fromEnum s)))
instance Hashable DeleteByteMatchSet
instance NFData DeleteByteMatchSet
instance ToHeaders DeleteByteMatchSet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.DeleteByteMatchSet" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteByteMatchSet where
toJSON DeleteByteMatchSet'{..}
= object
(catMaybes
[Just ("ByteMatchSetId" .= _dbmsByteMatchSetId),
Just ("ChangeToken" .= _dbmsChangeToken)])
instance ToPath DeleteByteMatchSet where
toPath = const "/"
instance ToQuery DeleteByteMatchSet where
toQuery = const mempty
data DeleteByteMatchSetResponse = DeleteByteMatchSetResponse'
{ _dbmsrsChangeToken :: !(Maybe Text)
, _dbmsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteByteMatchSetResponse
:: Int
-> DeleteByteMatchSetResponse
deleteByteMatchSetResponse pResponseStatus_ =
DeleteByteMatchSetResponse'
{ _dbmsrsChangeToken = Nothing
, _dbmsrsResponseStatus = pResponseStatus_
}
dbmsrsChangeToken :: Lens' DeleteByteMatchSetResponse (Maybe Text)
dbmsrsChangeToken = lens _dbmsrsChangeToken (\ s a -> s{_dbmsrsChangeToken = a});
dbmsrsResponseStatus :: Lens' DeleteByteMatchSetResponse Int
dbmsrsResponseStatus = lens _dbmsrsResponseStatus (\ s a -> s{_dbmsrsResponseStatus = a});
instance NFData DeleteByteMatchSetResponse