{-# 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.Kinesis.DeregisterStreamConsumer
(
DeregisterStreamConsumer (..),
newDeregisterStreamConsumer,
deregisterStreamConsumer_consumerARN,
deregisterStreamConsumer_streamARN,
deregisterStreamConsumer_consumerName,
DeregisterStreamConsumerResponse (..),
newDeregisterStreamConsumerResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Kinesis.Types
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 DeregisterStreamConsumer = DeregisterStreamConsumer'
{
DeregisterStreamConsumer -> Maybe Text
consumerARN :: Prelude.Maybe Prelude.Text,
DeregisterStreamConsumer -> Maybe Text
streamARN :: Prelude.Maybe Prelude.Text,
DeregisterStreamConsumer -> Maybe Text
consumerName :: Prelude.Maybe Prelude.Text
}
deriving (DeregisterStreamConsumer -> DeregisterStreamConsumer -> Bool
(DeregisterStreamConsumer -> DeregisterStreamConsumer -> Bool)
-> (DeregisterStreamConsumer -> DeregisterStreamConsumer -> Bool)
-> Eq DeregisterStreamConsumer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterStreamConsumer -> DeregisterStreamConsumer -> Bool
$c/= :: DeregisterStreamConsumer -> DeregisterStreamConsumer -> Bool
== :: DeregisterStreamConsumer -> DeregisterStreamConsumer -> Bool
$c== :: DeregisterStreamConsumer -> DeregisterStreamConsumer -> Bool
Prelude.Eq, ReadPrec [DeregisterStreamConsumer]
ReadPrec DeregisterStreamConsumer
Int -> ReadS DeregisterStreamConsumer
ReadS [DeregisterStreamConsumer]
(Int -> ReadS DeregisterStreamConsumer)
-> ReadS [DeregisterStreamConsumer]
-> ReadPrec DeregisterStreamConsumer
-> ReadPrec [DeregisterStreamConsumer]
-> Read DeregisterStreamConsumer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterStreamConsumer]
$creadListPrec :: ReadPrec [DeregisterStreamConsumer]
readPrec :: ReadPrec DeregisterStreamConsumer
$creadPrec :: ReadPrec DeregisterStreamConsumer
readList :: ReadS [DeregisterStreamConsumer]
$creadList :: ReadS [DeregisterStreamConsumer]
readsPrec :: Int -> ReadS DeregisterStreamConsumer
$creadsPrec :: Int -> ReadS DeregisterStreamConsumer
Prelude.Read, Int -> DeregisterStreamConsumer -> ShowS
[DeregisterStreamConsumer] -> ShowS
DeregisterStreamConsumer -> String
(Int -> DeregisterStreamConsumer -> ShowS)
-> (DeregisterStreamConsumer -> String)
-> ([DeregisterStreamConsumer] -> ShowS)
-> Show DeregisterStreamConsumer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterStreamConsumer] -> ShowS
$cshowList :: [DeregisterStreamConsumer] -> ShowS
show :: DeregisterStreamConsumer -> String
$cshow :: DeregisterStreamConsumer -> String
showsPrec :: Int -> DeregisterStreamConsumer -> ShowS
$cshowsPrec :: Int -> DeregisterStreamConsumer -> ShowS
Prelude.Show, (forall x.
DeregisterStreamConsumer -> Rep DeregisterStreamConsumer x)
-> (forall x.
Rep DeregisterStreamConsumer x -> DeregisterStreamConsumer)
-> Generic DeregisterStreamConsumer
forall x.
Rep DeregisterStreamConsumer x -> DeregisterStreamConsumer
forall x.
DeregisterStreamConsumer -> Rep DeregisterStreamConsumer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterStreamConsumer x -> DeregisterStreamConsumer
$cfrom :: forall x.
DeregisterStreamConsumer -> Rep DeregisterStreamConsumer x
Prelude.Generic)
newDeregisterStreamConsumer ::
DeregisterStreamConsumer
newDeregisterStreamConsumer :: DeregisterStreamConsumer
newDeregisterStreamConsumer =
DeregisterStreamConsumer' :: Maybe Text -> Maybe Text -> Maybe Text -> DeregisterStreamConsumer
DeregisterStreamConsumer'
{ $sel:consumerARN:DeregisterStreamConsumer' :: Maybe Text
consumerARN =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:streamARN:DeregisterStreamConsumer' :: Maybe Text
streamARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:consumerName:DeregisterStreamConsumer' :: Maybe Text
consumerName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
deregisterStreamConsumer_consumerARN :: Lens.Lens' DeregisterStreamConsumer (Prelude.Maybe Prelude.Text)
deregisterStreamConsumer_consumerARN :: (Maybe Text -> f (Maybe Text))
-> DeregisterStreamConsumer -> f DeregisterStreamConsumer
deregisterStreamConsumer_consumerARN = (DeregisterStreamConsumer -> Maybe Text)
-> (DeregisterStreamConsumer
-> Maybe Text -> DeregisterStreamConsumer)
-> Lens
DeregisterStreamConsumer
DeregisterStreamConsumer
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterStreamConsumer' {Maybe Text
consumerARN :: Maybe Text
$sel:consumerARN:DeregisterStreamConsumer' :: DeregisterStreamConsumer -> Maybe Text
consumerARN} -> Maybe Text
consumerARN) (\s :: DeregisterStreamConsumer
s@DeregisterStreamConsumer' {} Maybe Text
a -> DeregisterStreamConsumer
s {$sel:consumerARN:DeregisterStreamConsumer' :: Maybe Text
consumerARN = Maybe Text
a} :: DeregisterStreamConsumer)
deregisterStreamConsumer_streamARN :: Lens.Lens' DeregisterStreamConsumer (Prelude.Maybe Prelude.Text)
deregisterStreamConsumer_streamARN :: (Maybe Text -> f (Maybe Text))
-> DeregisterStreamConsumer -> f DeregisterStreamConsumer
deregisterStreamConsumer_streamARN = (DeregisterStreamConsumer -> Maybe Text)
-> (DeregisterStreamConsumer
-> Maybe Text -> DeregisterStreamConsumer)
-> Lens
DeregisterStreamConsumer
DeregisterStreamConsumer
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterStreamConsumer' {Maybe Text
streamARN :: Maybe Text
$sel:streamARN:DeregisterStreamConsumer' :: DeregisterStreamConsumer -> Maybe Text
streamARN} -> Maybe Text
streamARN) (\s :: DeregisterStreamConsumer
s@DeregisterStreamConsumer' {} Maybe Text
a -> DeregisterStreamConsumer
s {$sel:streamARN:DeregisterStreamConsumer' :: Maybe Text
streamARN = Maybe Text
a} :: DeregisterStreamConsumer)
deregisterStreamConsumer_consumerName :: Lens.Lens' DeregisterStreamConsumer (Prelude.Maybe Prelude.Text)
deregisterStreamConsumer_consumerName :: (Maybe Text -> f (Maybe Text))
-> DeregisterStreamConsumer -> f DeregisterStreamConsumer
deregisterStreamConsumer_consumerName = (DeregisterStreamConsumer -> Maybe Text)
-> (DeregisterStreamConsumer
-> Maybe Text -> DeregisterStreamConsumer)
-> Lens
DeregisterStreamConsumer
DeregisterStreamConsumer
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterStreamConsumer' {Maybe Text
consumerName :: Maybe Text
$sel:consumerName:DeregisterStreamConsumer' :: DeregisterStreamConsumer -> Maybe Text
consumerName} -> Maybe Text
consumerName) (\s :: DeregisterStreamConsumer
s@DeregisterStreamConsumer' {} Maybe Text
a -> DeregisterStreamConsumer
s {$sel:consumerName:DeregisterStreamConsumer' :: Maybe Text
consumerName = Maybe Text
a} :: DeregisterStreamConsumer)
instance Core.AWSRequest DeregisterStreamConsumer where
type
AWSResponse DeregisterStreamConsumer =
DeregisterStreamConsumerResponse
request :: DeregisterStreamConsumer -> Request DeregisterStreamConsumer
request = Service
-> DeregisterStreamConsumer -> Request DeregisterStreamConsumer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeregisterStreamConsumer
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeregisterStreamConsumer)))
response =
AWSResponse DeregisterStreamConsumer
-> Logger
-> Service
-> Proxy DeregisterStreamConsumer
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeregisterStreamConsumer)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse DeregisterStreamConsumer
DeregisterStreamConsumerResponse
DeregisterStreamConsumerResponse'
instance Prelude.Hashable DeregisterStreamConsumer
instance Prelude.NFData DeregisterStreamConsumer
instance Core.ToHeaders DeregisterStreamConsumer where
toHeaders :: DeregisterStreamConsumer -> [Header]
toHeaders =
[Header] -> DeregisterStreamConsumer -> [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
"Kinesis_20131202.DeregisterStreamConsumer" ::
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 DeregisterStreamConsumer where
toJSON :: DeregisterStreamConsumer -> Value
toJSON DeregisterStreamConsumer' {Maybe Text
consumerName :: Maybe Text
streamARN :: Maybe Text
consumerARN :: Maybe Text
$sel:consumerName:DeregisterStreamConsumer' :: DeregisterStreamConsumer -> Maybe Text
$sel:streamARN:DeregisterStreamConsumer' :: DeregisterStreamConsumer -> Maybe Text
$sel:consumerARN:DeregisterStreamConsumer' :: DeregisterStreamConsumer -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ConsumerARN" 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
consumerARN,
(Text
"StreamARN" 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
streamARN,
(Text
"ConsumerName" 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
consumerName
]
)
instance Core.ToPath DeregisterStreamConsumer where
toPath :: DeregisterStreamConsumer -> ByteString
toPath = ByteString -> DeregisterStreamConsumer -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeregisterStreamConsumer where
toQuery :: DeregisterStreamConsumer -> QueryString
toQuery = QueryString -> DeregisterStreamConsumer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeregisterStreamConsumerResponse = DeregisterStreamConsumerResponse'
{
}
deriving (DeregisterStreamConsumerResponse
-> DeregisterStreamConsumerResponse -> Bool
(DeregisterStreamConsumerResponse
-> DeregisterStreamConsumerResponse -> Bool)
-> (DeregisterStreamConsumerResponse
-> DeregisterStreamConsumerResponse -> Bool)
-> Eq DeregisterStreamConsumerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterStreamConsumerResponse
-> DeregisterStreamConsumerResponse -> Bool
$c/= :: DeregisterStreamConsumerResponse
-> DeregisterStreamConsumerResponse -> Bool
== :: DeregisterStreamConsumerResponse
-> DeregisterStreamConsumerResponse -> Bool
$c== :: DeregisterStreamConsumerResponse
-> DeregisterStreamConsumerResponse -> Bool
Prelude.Eq, ReadPrec [DeregisterStreamConsumerResponse]
ReadPrec DeregisterStreamConsumerResponse
Int -> ReadS DeregisterStreamConsumerResponse
ReadS [DeregisterStreamConsumerResponse]
(Int -> ReadS DeregisterStreamConsumerResponse)
-> ReadS [DeregisterStreamConsumerResponse]
-> ReadPrec DeregisterStreamConsumerResponse
-> ReadPrec [DeregisterStreamConsumerResponse]
-> Read DeregisterStreamConsumerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterStreamConsumerResponse]
$creadListPrec :: ReadPrec [DeregisterStreamConsumerResponse]
readPrec :: ReadPrec DeregisterStreamConsumerResponse
$creadPrec :: ReadPrec DeregisterStreamConsumerResponse
readList :: ReadS [DeregisterStreamConsumerResponse]
$creadList :: ReadS [DeregisterStreamConsumerResponse]
readsPrec :: Int -> ReadS DeregisterStreamConsumerResponse
$creadsPrec :: Int -> ReadS DeregisterStreamConsumerResponse
Prelude.Read, Int -> DeregisterStreamConsumerResponse -> ShowS
[DeregisterStreamConsumerResponse] -> ShowS
DeregisterStreamConsumerResponse -> String
(Int -> DeregisterStreamConsumerResponse -> ShowS)
-> (DeregisterStreamConsumerResponse -> String)
-> ([DeregisterStreamConsumerResponse] -> ShowS)
-> Show DeregisterStreamConsumerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterStreamConsumerResponse] -> ShowS
$cshowList :: [DeregisterStreamConsumerResponse] -> ShowS
show :: DeregisterStreamConsumerResponse -> String
$cshow :: DeregisterStreamConsumerResponse -> String
showsPrec :: Int -> DeregisterStreamConsumerResponse -> ShowS
$cshowsPrec :: Int -> DeregisterStreamConsumerResponse -> ShowS
Prelude.Show, (forall x.
DeregisterStreamConsumerResponse
-> Rep DeregisterStreamConsumerResponse x)
-> (forall x.
Rep DeregisterStreamConsumerResponse x
-> DeregisterStreamConsumerResponse)
-> Generic DeregisterStreamConsumerResponse
forall x.
Rep DeregisterStreamConsumerResponse x
-> DeregisterStreamConsumerResponse
forall x.
DeregisterStreamConsumerResponse
-> Rep DeregisterStreamConsumerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterStreamConsumerResponse x
-> DeregisterStreamConsumerResponse
$cfrom :: forall x.
DeregisterStreamConsumerResponse
-> Rep DeregisterStreamConsumerResponse x
Prelude.Generic)
newDeregisterStreamConsumerResponse ::
DeregisterStreamConsumerResponse
newDeregisterStreamConsumerResponse :: DeregisterStreamConsumerResponse
newDeregisterStreamConsumerResponse =
DeregisterStreamConsumerResponse
DeregisterStreamConsumerResponse'
instance
Prelude.NFData
DeregisterStreamConsumerResponse