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