{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CloudWatchEvents.DisableRule
(
DisableRule (..),
newDisableRule,
disableRule_eventBusName,
disableRule_name,
DisableRuleResponse (..),
newDisableRuleResponse,
)
where
import Amazonka.CloudWatchEvents.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DisableRule = DisableRule'
{
DisableRule -> Maybe Text
eventBusName :: Prelude.Maybe Prelude.Text,
DisableRule -> Text
name :: Prelude.Text
}
deriving (DisableRule -> DisableRule -> Bool
(DisableRule -> DisableRule -> Bool)
-> (DisableRule -> DisableRule -> Bool) -> Eq DisableRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableRule -> DisableRule -> Bool
$c/= :: DisableRule -> DisableRule -> Bool
== :: DisableRule -> DisableRule -> Bool
$c== :: DisableRule -> DisableRule -> Bool
Prelude.Eq, ReadPrec [DisableRule]
ReadPrec DisableRule
Int -> ReadS DisableRule
ReadS [DisableRule]
(Int -> ReadS DisableRule)
-> ReadS [DisableRule]
-> ReadPrec DisableRule
-> ReadPrec [DisableRule]
-> Read DisableRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableRule]
$creadListPrec :: ReadPrec [DisableRule]
readPrec :: ReadPrec DisableRule
$creadPrec :: ReadPrec DisableRule
readList :: ReadS [DisableRule]
$creadList :: ReadS [DisableRule]
readsPrec :: Int -> ReadS DisableRule
$creadsPrec :: Int -> ReadS DisableRule
Prelude.Read, Int -> DisableRule -> ShowS
[DisableRule] -> ShowS
DisableRule -> String
(Int -> DisableRule -> ShowS)
-> (DisableRule -> String)
-> ([DisableRule] -> ShowS)
-> Show DisableRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableRule] -> ShowS
$cshowList :: [DisableRule] -> ShowS
show :: DisableRule -> String
$cshow :: DisableRule -> String
showsPrec :: Int -> DisableRule -> ShowS
$cshowsPrec :: Int -> DisableRule -> ShowS
Prelude.Show, (forall x. DisableRule -> Rep DisableRule x)
-> (forall x. Rep DisableRule x -> DisableRule)
-> Generic DisableRule
forall x. Rep DisableRule x -> DisableRule
forall x. DisableRule -> Rep DisableRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisableRule x -> DisableRule
$cfrom :: forall x. DisableRule -> Rep DisableRule x
Prelude.Generic)
newDisableRule ::
Prelude.Text ->
DisableRule
newDisableRule :: Text -> DisableRule
newDisableRule Text
pName_ =
DisableRule' :: Maybe Text -> Text -> DisableRule
DisableRule'
{ $sel:eventBusName:DisableRule' :: Maybe Text
eventBusName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:DisableRule' :: Text
name = Text
pName_
}
disableRule_eventBusName :: Lens.Lens' DisableRule (Prelude.Maybe Prelude.Text)
disableRule_eventBusName :: (Maybe Text -> f (Maybe Text)) -> DisableRule -> f DisableRule
disableRule_eventBusName = (DisableRule -> Maybe Text)
-> (DisableRule -> Maybe Text -> DisableRule)
-> Lens DisableRule DisableRule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableRule' {Maybe Text
eventBusName :: Maybe Text
$sel:eventBusName:DisableRule' :: DisableRule -> Maybe Text
eventBusName} -> Maybe Text
eventBusName) (\s :: DisableRule
s@DisableRule' {} Maybe Text
a -> DisableRule
s {$sel:eventBusName:DisableRule' :: Maybe Text
eventBusName = Maybe Text
a} :: DisableRule)
disableRule_name :: Lens.Lens' DisableRule Prelude.Text
disableRule_name :: (Text -> f Text) -> DisableRule -> f DisableRule
disableRule_name = (DisableRule -> Text)
-> (DisableRule -> Text -> DisableRule)
-> Lens DisableRule DisableRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableRule' {Text
name :: Text
$sel:name:DisableRule' :: DisableRule -> Text
name} -> Text
name) (\s :: DisableRule
s@DisableRule' {} Text
a -> DisableRule
s {$sel:name:DisableRule' :: Text
name = Text
a} :: DisableRule)
instance Core.AWSRequest DisableRule where
type AWSResponse DisableRule = DisableRuleResponse
request :: DisableRule -> Request DisableRule
request = Service -> DisableRule -> Request DisableRule
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DisableRule
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DisableRule)))
response = AWSResponse DisableRule
-> Logger
-> Service
-> Proxy DisableRule
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DisableRule)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DisableRule
DisableRuleResponse
DisableRuleResponse'
instance Prelude.Hashable DisableRule
instance Prelude.NFData DisableRule
instance Core.ToHeaders DisableRule where
toHeaders :: DisableRule -> [Header]
toHeaders =
[Header] -> DisableRule -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# (ByteString
"AWSEvents.DisableRule" :: Prelude.ByteString),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DisableRule where
toJSON :: DisableRule -> Value
toJSON DisableRule' {Maybe Text
Text
name :: Text
eventBusName :: Maybe Text
$sel:name:DisableRule' :: DisableRule -> Text
$sel:eventBusName:DisableRule' :: DisableRule -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EventBusName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
eventBusName,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
]
)
instance Core.ToPath DisableRule where
toPath :: DisableRule -> ByteString
toPath = ByteString -> DisableRule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DisableRule where
toQuery :: DisableRule -> QueryString
toQuery = QueryString -> DisableRule -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DisableRuleResponse = DisableRuleResponse'
{
}
deriving (DisableRuleResponse -> DisableRuleResponse -> Bool
(DisableRuleResponse -> DisableRuleResponse -> Bool)
-> (DisableRuleResponse -> DisableRuleResponse -> Bool)
-> Eq DisableRuleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableRuleResponse -> DisableRuleResponse -> Bool
$c/= :: DisableRuleResponse -> DisableRuleResponse -> Bool
== :: DisableRuleResponse -> DisableRuleResponse -> Bool
$c== :: DisableRuleResponse -> DisableRuleResponse -> Bool
Prelude.Eq, ReadPrec [DisableRuleResponse]
ReadPrec DisableRuleResponse
Int -> ReadS DisableRuleResponse
ReadS [DisableRuleResponse]
(Int -> ReadS DisableRuleResponse)
-> ReadS [DisableRuleResponse]
-> ReadPrec DisableRuleResponse
-> ReadPrec [DisableRuleResponse]
-> Read DisableRuleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableRuleResponse]
$creadListPrec :: ReadPrec [DisableRuleResponse]
readPrec :: ReadPrec DisableRuleResponse
$creadPrec :: ReadPrec DisableRuleResponse
readList :: ReadS [DisableRuleResponse]
$creadList :: ReadS [DisableRuleResponse]
readsPrec :: Int -> ReadS DisableRuleResponse
$creadsPrec :: Int -> ReadS DisableRuleResponse
Prelude.Read, Int -> DisableRuleResponse -> ShowS
[DisableRuleResponse] -> ShowS
DisableRuleResponse -> String
(Int -> DisableRuleResponse -> ShowS)
-> (DisableRuleResponse -> String)
-> ([DisableRuleResponse] -> ShowS)
-> Show DisableRuleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableRuleResponse] -> ShowS
$cshowList :: [DisableRuleResponse] -> ShowS
show :: DisableRuleResponse -> String
$cshow :: DisableRuleResponse -> String
showsPrec :: Int -> DisableRuleResponse -> ShowS
$cshowsPrec :: Int -> DisableRuleResponse -> ShowS
Prelude.Show, (forall x. DisableRuleResponse -> Rep DisableRuleResponse x)
-> (forall x. Rep DisableRuleResponse x -> DisableRuleResponse)
-> Generic DisableRuleResponse
forall x. Rep DisableRuleResponse x -> DisableRuleResponse
forall x. DisableRuleResponse -> Rep DisableRuleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisableRuleResponse x -> DisableRuleResponse
$cfrom :: forall x. DisableRuleResponse -> Rep DisableRuleResponse x
Prelude.Generic)
newDisableRuleResponse ::
DisableRuleResponse
newDisableRuleResponse :: DisableRuleResponse
newDisableRuleResponse = DisableRuleResponse
DisableRuleResponse'
instance Prelude.NFData DisableRuleResponse