{-# 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.DeactivateEventSource
(
DeactivateEventSource (..),
newDeactivateEventSource,
deactivateEventSource_name,
DeactivateEventSourceResponse (..),
newDeactivateEventSourceResponse,
)
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 DeactivateEventSource = DeactivateEventSource'
{
DeactivateEventSource -> Text
name :: Prelude.Text
}
deriving (DeactivateEventSource -> DeactivateEventSource -> Bool
(DeactivateEventSource -> DeactivateEventSource -> Bool)
-> (DeactivateEventSource -> DeactivateEventSource -> Bool)
-> Eq DeactivateEventSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeactivateEventSource -> DeactivateEventSource -> Bool
$c/= :: DeactivateEventSource -> DeactivateEventSource -> Bool
== :: DeactivateEventSource -> DeactivateEventSource -> Bool
$c== :: DeactivateEventSource -> DeactivateEventSource -> Bool
Prelude.Eq, ReadPrec [DeactivateEventSource]
ReadPrec DeactivateEventSource
Int -> ReadS DeactivateEventSource
ReadS [DeactivateEventSource]
(Int -> ReadS DeactivateEventSource)
-> ReadS [DeactivateEventSource]
-> ReadPrec DeactivateEventSource
-> ReadPrec [DeactivateEventSource]
-> Read DeactivateEventSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeactivateEventSource]
$creadListPrec :: ReadPrec [DeactivateEventSource]
readPrec :: ReadPrec DeactivateEventSource
$creadPrec :: ReadPrec DeactivateEventSource
readList :: ReadS [DeactivateEventSource]
$creadList :: ReadS [DeactivateEventSource]
readsPrec :: Int -> ReadS DeactivateEventSource
$creadsPrec :: Int -> ReadS DeactivateEventSource
Prelude.Read, Int -> DeactivateEventSource -> ShowS
[DeactivateEventSource] -> ShowS
DeactivateEventSource -> String
(Int -> DeactivateEventSource -> ShowS)
-> (DeactivateEventSource -> String)
-> ([DeactivateEventSource] -> ShowS)
-> Show DeactivateEventSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeactivateEventSource] -> ShowS
$cshowList :: [DeactivateEventSource] -> ShowS
show :: DeactivateEventSource -> String
$cshow :: DeactivateEventSource -> String
showsPrec :: Int -> DeactivateEventSource -> ShowS
$cshowsPrec :: Int -> DeactivateEventSource -> ShowS
Prelude.Show, (forall x. DeactivateEventSource -> Rep DeactivateEventSource x)
-> (forall x. Rep DeactivateEventSource x -> DeactivateEventSource)
-> Generic DeactivateEventSource
forall x. Rep DeactivateEventSource x -> DeactivateEventSource
forall x. DeactivateEventSource -> Rep DeactivateEventSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeactivateEventSource x -> DeactivateEventSource
$cfrom :: forall x. DeactivateEventSource -> Rep DeactivateEventSource x
Prelude.Generic)
newDeactivateEventSource ::
Prelude.Text ->
DeactivateEventSource
newDeactivateEventSource :: Text -> DeactivateEventSource
newDeactivateEventSource Text
pName_ =
DeactivateEventSource' :: Text -> DeactivateEventSource
DeactivateEventSource' {$sel:name:DeactivateEventSource' :: Text
name = Text
pName_}
deactivateEventSource_name :: Lens.Lens' DeactivateEventSource Prelude.Text
deactivateEventSource_name :: (Text -> f Text)
-> DeactivateEventSource -> f DeactivateEventSource
deactivateEventSource_name = (DeactivateEventSource -> Text)
-> (DeactivateEventSource -> Text -> DeactivateEventSource)
-> Lens DeactivateEventSource DeactivateEventSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeactivateEventSource' {Text
name :: Text
$sel:name:DeactivateEventSource' :: DeactivateEventSource -> Text
name} -> Text
name) (\s :: DeactivateEventSource
s@DeactivateEventSource' {} Text
a -> DeactivateEventSource
s {$sel:name:DeactivateEventSource' :: Text
name = Text
a} :: DeactivateEventSource)
instance Core.AWSRequest DeactivateEventSource where
type
AWSResponse DeactivateEventSource =
DeactivateEventSourceResponse
request :: DeactivateEventSource -> Request DeactivateEventSource
request = Service -> DeactivateEventSource -> Request DeactivateEventSource
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeactivateEventSource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeactivateEventSource)))
response =
AWSResponse DeactivateEventSource
-> Logger
-> Service
-> Proxy DeactivateEventSource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeactivateEventSource)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeactivateEventSource
DeactivateEventSourceResponse
DeactivateEventSourceResponse'
instance Prelude.Hashable DeactivateEventSource
instance Prelude.NFData DeactivateEventSource
instance Core.ToHeaders DeactivateEventSource where
toHeaders :: DeactivateEventSource -> [Header]
toHeaders =
[Header] -> DeactivateEventSource -> [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.DeactivateEventSource" ::
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 DeactivateEventSource where
toJSON :: DeactivateEventSource -> Value
toJSON DeactivateEventSource' {Text
name :: Text
$sel:name:DeactivateEventSource' :: DeactivateEventSource -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[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 DeactivateEventSource where
toPath :: DeactivateEventSource -> ByteString
toPath = ByteString -> DeactivateEventSource -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeactivateEventSource where
toQuery :: DeactivateEventSource -> QueryString
toQuery = QueryString -> DeactivateEventSource -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeactivateEventSourceResponse = DeactivateEventSourceResponse'
{
}
deriving (DeactivateEventSourceResponse
-> DeactivateEventSourceResponse -> Bool
(DeactivateEventSourceResponse
-> DeactivateEventSourceResponse -> Bool)
-> (DeactivateEventSourceResponse
-> DeactivateEventSourceResponse -> Bool)
-> Eq DeactivateEventSourceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeactivateEventSourceResponse
-> DeactivateEventSourceResponse -> Bool
$c/= :: DeactivateEventSourceResponse
-> DeactivateEventSourceResponse -> Bool
== :: DeactivateEventSourceResponse
-> DeactivateEventSourceResponse -> Bool
$c== :: DeactivateEventSourceResponse
-> DeactivateEventSourceResponse -> Bool
Prelude.Eq, ReadPrec [DeactivateEventSourceResponse]
ReadPrec DeactivateEventSourceResponse
Int -> ReadS DeactivateEventSourceResponse
ReadS [DeactivateEventSourceResponse]
(Int -> ReadS DeactivateEventSourceResponse)
-> ReadS [DeactivateEventSourceResponse]
-> ReadPrec DeactivateEventSourceResponse
-> ReadPrec [DeactivateEventSourceResponse]
-> Read DeactivateEventSourceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeactivateEventSourceResponse]
$creadListPrec :: ReadPrec [DeactivateEventSourceResponse]
readPrec :: ReadPrec DeactivateEventSourceResponse
$creadPrec :: ReadPrec DeactivateEventSourceResponse
readList :: ReadS [DeactivateEventSourceResponse]
$creadList :: ReadS [DeactivateEventSourceResponse]
readsPrec :: Int -> ReadS DeactivateEventSourceResponse
$creadsPrec :: Int -> ReadS DeactivateEventSourceResponse
Prelude.Read, Int -> DeactivateEventSourceResponse -> ShowS
[DeactivateEventSourceResponse] -> ShowS
DeactivateEventSourceResponse -> String
(Int -> DeactivateEventSourceResponse -> ShowS)
-> (DeactivateEventSourceResponse -> String)
-> ([DeactivateEventSourceResponse] -> ShowS)
-> Show DeactivateEventSourceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeactivateEventSourceResponse] -> ShowS
$cshowList :: [DeactivateEventSourceResponse] -> ShowS
show :: DeactivateEventSourceResponse -> String
$cshow :: DeactivateEventSourceResponse -> String
showsPrec :: Int -> DeactivateEventSourceResponse -> ShowS
$cshowsPrec :: Int -> DeactivateEventSourceResponse -> ShowS
Prelude.Show, (forall x.
DeactivateEventSourceResponse
-> Rep DeactivateEventSourceResponse x)
-> (forall x.
Rep DeactivateEventSourceResponse x
-> DeactivateEventSourceResponse)
-> Generic DeactivateEventSourceResponse
forall x.
Rep DeactivateEventSourceResponse x
-> DeactivateEventSourceResponse
forall x.
DeactivateEventSourceResponse
-> Rep DeactivateEventSourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeactivateEventSourceResponse x
-> DeactivateEventSourceResponse
$cfrom :: forall x.
DeactivateEventSourceResponse
-> Rep DeactivateEventSourceResponse x
Prelude.Generic)
newDeactivateEventSourceResponse ::
DeactivateEventSourceResponse
newDeactivateEventSourceResponse :: DeactivateEventSourceResponse
newDeactivateEventSourceResponse =
DeactivateEventSourceResponse
DeactivateEventSourceResponse'
instance Prelude.NFData DeactivateEventSourceResponse