{-# 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.DisableRule
(
disableRule
, DisableRule
, dName
, disableRuleResponse
, DisableRuleResponse
) 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 DisableRule = DisableRule'
{ _dName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
disableRule
:: Text
-> DisableRule
disableRule pName_ = DisableRule' {_dName = pName_}
dName :: Lens' DisableRule Text
dName = lens _dName (\ s a -> s{_dName = a})
instance AWSRequest DisableRule where
type Rs DisableRule = DisableRuleResponse
request = postJSON cloudWatchEvents
response = receiveNull DisableRuleResponse'
instance Hashable DisableRule where
instance NFData DisableRule where
instance ToHeaders DisableRule where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSEvents.DisableRule" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DisableRule where
toJSON DisableRule'{..}
= object (catMaybes [Just ("Name" .= _dName)])
instance ToPath DisableRule where
toPath = const "/"
instance ToQuery DisableRule where
toQuery = const mempty
data DisableRuleResponse =
DisableRuleResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
disableRuleResponse
:: DisableRuleResponse
disableRuleResponse = DisableRuleResponse'
instance NFData DisableRuleResponse where