{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Kinesis.Types.ConsumerDescription where
import qualified Amazonka.Core as Core
import Amazonka.Kinesis.Types.ConsumerStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ConsumerDescription = ConsumerDescription'
{
ConsumerDescription -> Text
consumerName :: Prelude.Text,
ConsumerDescription -> Text
consumerARN :: Prelude.Text,
ConsumerDescription -> ConsumerStatus
consumerStatus :: ConsumerStatus,
ConsumerDescription -> POSIX
consumerCreationTimestamp :: Core.POSIX,
ConsumerDescription -> Text
streamARN :: Prelude.Text
}
deriving (ConsumerDescription -> ConsumerDescription -> Bool
(ConsumerDescription -> ConsumerDescription -> Bool)
-> (ConsumerDescription -> ConsumerDescription -> Bool)
-> Eq ConsumerDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConsumerDescription -> ConsumerDescription -> Bool
$c/= :: ConsumerDescription -> ConsumerDescription -> Bool
== :: ConsumerDescription -> ConsumerDescription -> Bool
$c== :: ConsumerDescription -> ConsumerDescription -> Bool
Prelude.Eq, ReadPrec [ConsumerDescription]
ReadPrec ConsumerDescription
Int -> ReadS ConsumerDescription
ReadS [ConsumerDescription]
(Int -> ReadS ConsumerDescription)
-> ReadS [ConsumerDescription]
-> ReadPrec ConsumerDescription
-> ReadPrec [ConsumerDescription]
-> Read ConsumerDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConsumerDescription]
$creadListPrec :: ReadPrec [ConsumerDescription]
readPrec :: ReadPrec ConsumerDescription
$creadPrec :: ReadPrec ConsumerDescription
readList :: ReadS [ConsumerDescription]
$creadList :: ReadS [ConsumerDescription]
readsPrec :: Int -> ReadS ConsumerDescription
$creadsPrec :: Int -> ReadS ConsumerDescription
Prelude.Read, Int -> ConsumerDescription -> ShowS
[ConsumerDescription] -> ShowS
ConsumerDescription -> String
(Int -> ConsumerDescription -> ShowS)
-> (ConsumerDescription -> String)
-> ([ConsumerDescription] -> ShowS)
-> Show ConsumerDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConsumerDescription] -> ShowS
$cshowList :: [ConsumerDescription] -> ShowS
show :: ConsumerDescription -> String
$cshow :: ConsumerDescription -> String
showsPrec :: Int -> ConsumerDescription -> ShowS
$cshowsPrec :: Int -> ConsumerDescription -> ShowS
Prelude.Show, (forall x. ConsumerDescription -> Rep ConsumerDescription x)
-> (forall x. Rep ConsumerDescription x -> ConsumerDescription)
-> Generic ConsumerDescription
forall x. Rep ConsumerDescription x -> ConsumerDescription
forall x. ConsumerDescription -> Rep ConsumerDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConsumerDescription x -> ConsumerDescription
$cfrom :: forall x. ConsumerDescription -> Rep ConsumerDescription x
Prelude.Generic)
newConsumerDescription ::
Prelude.Text ->
Prelude.Text ->
ConsumerStatus ->
Prelude.UTCTime ->
Prelude.Text ->
ConsumerDescription
newConsumerDescription :: Text
-> Text -> ConsumerStatus -> UTCTime -> Text -> ConsumerDescription
newConsumerDescription
Text
pConsumerName_
Text
pConsumerARN_
ConsumerStatus
pConsumerStatus_
UTCTime
pConsumerCreationTimestamp_
Text
pStreamARN_ =
ConsumerDescription' :: Text
-> Text -> ConsumerStatus -> POSIX -> Text -> ConsumerDescription
ConsumerDescription'
{ $sel:consumerName:ConsumerDescription' :: Text
consumerName = Text
pConsumerName_,
$sel:consumerARN:ConsumerDescription' :: Text
consumerARN = Text
pConsumerARN_,
$sel:consumerStatus:ConsumerDescription' :: ConsumerStatus
consumerStatus = ConsumerStatus
pConsumerStatus_,
$sel:consumerCreationTimestamp:ConsumerDescription' :: POSIX
consumerCreationTimestamp =
Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pConsumerCreationTimestamp_,
$sel:streamARN:ConsumerDescription' :: Text
streamARN = Text
pStreamARN_
}
consumerDescription_consumerName :: Lens.Lens' ConsumerDescription Prelude.Text
consumerDescription_consumerName :: (Text -> f Text) -> ConsumerDescription -> f ConsumerDescription
consumerDescription_consumerName = (ConsumerDescription -> Text)
-> (ConsumerDescription -> Text -> ConsumerDescription)
-> Lens ConsumerDescription ConsumerDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConsumerDescription' {Text
consumerName :: Text
$sel:consumerName:ConsumerDescription' :: ConsumerDescription -> Text
consumerName} -> Text
consumerName) (\s :: ConsumerDescription
s@ConsumerDescription' {} Text
a -> ConsumerDescription
s {$sel:consumerName:ConsumerDescription' :: Text
consumerName = Text
a} :: ConsumerDescription)
consumerDescription_consumerARN :: Lens.Lens' ConsumerDescription Prelude.Text
consumerDescription_consumerARN :: (Text -> f Text) -> ConsumerDescription -> f ConsumerDescription
consumerDescription_consumerARN = (ConsumerDescription -> Text)
-> (ConsumerDescription -> Text -> ConsumerDescription)
-> Lens ConsumerDescription ConsumerDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConsumerDescription' {Text
consumerARN :: Text
$sel:consumerARN:ConsumerDescription' :: ConsumerDescription -> Text
consumerARN} -> Text
consumerARN) (\s :: ConsumerDescription
s@ConsumerDescription' {} Text
a -> ConsumerDescription
s {$sel:consumerARN:ConsumerDescription' :: Text
consumerARN = Text
a} :: ConsumerDescription)
consumerDescription_consumerStatus :: Lens.Lens' ConsumerDescription ConsumerStatus
consumerDescription_consumerStatus :: (ConsumerStatus -> f ConsumerStatus)
-> ConsumerDescription -> f ConsumerDescription
consumerDescription_consumerStatus = (ConsumerDescription -> ConsumerStatus)
-> (ConsumerDescription -> ConsumerStatus -> ConsumerDescription)
-> Lens
ConsumerDescription
ConsumerDescription
ConsumerStatus
ConsumerStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConsumerDescription' {ConsumerStatus
consumerStatus :: ConsumerStatus
$sel:consumerStatus:ConsumerDescription' :: ConsumerDescription -> ConsumerStatus
consumerStatus} -> ConsumerStatus
consumerStatus) (\s :: ConsumerDescription
s@ConsumerDescription' {} ConsumerStatus
a -> ConsumerDescription
s {$sel:consumerStatus:ConsumerDescription' :: ConsumerStatus
consumerStatus = ConsumerStatus
a} :: ConsumerDescription)
consumerDescription_consumerCreationTimestamp :: Lens.Lens' ConsumerDescription Prelude.UTCTime
consumerDescription_consumerCreationTimestamp :: (UTCTime -> f UTCTime)
-> ConsumerDescription -> f ConsumerDescription
consumerDescription_consumerCreationTimestamp = (ConsumerDescription -> POSIX)
-> (ConsumerDescription -> POSIX -> ConsumerDescription)
-> Lens ConsumerDescription ConsumerDescription POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConsumerDescription' {POSIX
consumerCreationTimestamp :: POSIX
$sel:consumerCreationTimestamp:ConsumerDescription' :: ConsumerDescription -> POSIX
consumerCreationTimestamp} -> POSIX
consumerCreationTimestamp) (\s :: ConsumerDescription
s@ConsumerDescription' {} POSIX
a -> ConsumerDescription
s {$sel:consumerCreationTimestamp:ConsumerDescription' :: POSIX
consumerCreationTimestamp = POSIX
a} :: ConsumerDescription) ((POSIX -> f POSIX)
-> ConsumerDescription -> f ConsumerDescription)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ConsumerDescription
-> f ConsumerDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
consumerDescription_streamARN :: Lens.Lens' ConsumerDescription Prelude.Text
consumerDescription_streamARN :: (Text -> f Text) -> ConsumerDescription -> f ConsumerDescription
consumerDescription_streamARN = (ConsumerDescription -> Text)
-> (ConsumerDescription -> Text -> ConsumerDescription)
-> Lens ConsumerDescription ConsumerDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConsumerDescription' {Text
streamARN :: Text
$sel:streamARN:ConsumerDescription' :: ConsumerDescription -> Text
streamARN} -> Text
streamARN) (\s :: ConsumerDescription
s@ConsumerDescription' {} Text
a -> ConsumerDescription
s {$sel:streamARN:ConsumerDescription' :: Text
streamARN = Text
a} :: ConsumerDescription)
instance Core.FromJSON ConsumerDescription where
parseJSON :: Value -> Parser ConsumerDescription
parseJSON =
String
-> (Object -> Parser ConsumerDescription)
-> Value
-> Parser ConsumerDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ConsumerDescription"
( \Object
x ->
Text
-> Text -> ConsumerStatus -> POSIX -> Text -> ConsumerDescription
ConsumerDescription'
(Text
-> Text -> ConsumerStatus -> POSIX -> Text -> ConsumerDescription)
-> Parser Text
-> Parser
(Text -> ConsumerStatus -> POSIX -> Text -> ConsumerDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ConsumerName")
Parser
(Text -> ConsumerStatus -> POSIX -> Text -> ConsumerDescription)
-> Parser Text
-> Parser (ConsumerStatus -> POSIX -> Text -> ConsumerDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ConsumerARN")
Parser (ConsumerStatus -> POSIX -> Text -> ConsumerDescription)
-> Parser ConsumerStatus
-> Parser (POSIX -> Text -> ConsumerDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ConsumerStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ConsumerStatus")
Parser (POSIX -> Text -> ConsumerDescription)
-> Parser POSIX -> Parser (Text -> ConsumerDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ConsumerCreationTimestamp")
Parser (Text -> ConsumerDescription)
-> Parser Text -> Parser ConsumerDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"StreamARN")
)
instance Prelude.Hashable ConsumerDescription
instance Prelude.NFData ConsumerDescription