{-# 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.CloudWatchEvents.DeleteRule
(
deleteRule
, DeleteRule
, drName
, deleteRuleResponse
, DeleteRuleResponse
) where
import Network.AWS.CloudWatchEvents.Types
import Network.AWS.CloudWatchEvents.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteRule = DeleteRule'
{ _drName :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteRule
:: Text
-> DeleteRule
deleteRule pName_ =
DeleteRule'
{ _drName = pName_
}
drName :: Lens' DeleteRule Text
drName = lens _drName (\ s a -> s{_drName = a});
instance AWSRequest DeleteRule where
type Rs DeleteRule = DeleteRuleResponse
request = postJSON cloudWatchEvents
response = receiveNull DeleteRuleResponse'
instance Hashable DeleteRule
instance NFData DeleteRule
instance ToHeaders DeleteRule where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSEvents.DeleteRule" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteRule where
toJSON DeleteRule'{..}
= object (catMaybes [Just ("Name" .= _drName)])
instance ToPath DeleteRule where
toPath = const "/"
instance ToQuery DeleteRule where
toQuery = const mempty
data DeleteRuleResponse =
DeleteRuleResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteRuleResponse
:: DeleteRuleResponse
deleteRuleResponse = DeleteRuleResponse'
instance NFData DeleteRuleResponse