{-# 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.DeleteWebACL
(
deleteWebACL
, DeleteWebACL
, dwaWebACLId
, dwaChangeToken
, deleteWebACLResponse
, DeleteWebACLResponse
, dwarsChangeToken
, dwarsResponseStatus
) 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 DeleteWebACL = DeleteWebACL'
{ _dwaWebACLId :: !Text
, _dwaChangeToken :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteWebACL
:: Text
-> Text
-> DeleteWebACL
deleteWebACL pWebACLId_ pChangeToken_ =
DeleteWebACL' {_dwaWebACLId = pWebACLId_, _dwaChangeToken = pChangeToken_}
dwaWebACLId :: Lens' DeleteWebACL Text
dwaWebACLId = lens _dwaWebACLId (\ s a -> s{_dwaWebACLId = a})
dwaChangeToken :: Lens' DeleteWebACL Text
dwaChangeToken = lens _dwaChangeToken (\ s a -> s{_dwaChangeToken = a})
instance AWSRequest DeleteWebACL where
type Rs DeleteWebACL = DeleteWebACLResponse
request = postJSON waf
response
= receiveJSON
(\ s h x ->
DeleteWebACLResponse' <$>
(x .?> "ChangeToken") <*> (pure (fromEnum s)))
instance Hashable DeleteWebACL where
instance NFData DeleteWebACL where
instance ToHeaders DeleteWebACL where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSWAF_20150824.DeleteWebACL" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteWebACL where
toJSON DeleteWebACL'{..}
= object
(catMaybes
[Just ("WebACLId" .= _dwaWebACLId),
Just ("ChangeToken" .= _dwaChangeToken)])
instance ToPath DeleteWebACL where
toPath = const "/"
instance ToQuery DeleteWebACL where
toQuery = const mempty
data DeleteWebACLResponse = DeleteWebACLResponse'
{ _dwarsChangeToken :: !(Maybe Text)
, _dwarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteWebACLResponse
:: Int
-> DeleteWebACLResponse
deleteWebACLResponse pResponseStatus_ =
DeleteWebACLResponse'
{_dwarsChangeToken = Nothing, _dwarsResponseStatus = pResponseStatus_}
dwarsChangeToken :: Lens' DeleteWebACLResponse (Maybe Text)
dwarsChangeToken = lens _dwarsChangeToken (\ s a -> s{_dwarsChangeToken = a})
dwarsResponseStatus :: Lens' DeleteWebACLResponse Int
dwarsResponseStatus = lens _dwarsResponseStatus (\ s a -> s{_dwarsResponseStatus = a})
instance NFData DeleteWebACLResponse where