{-# 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.Consumer 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 Consumer = Consumer'
{
Consumer -> Text
consumerName :: Prelude.Text,
Consumer -> Text
consumerARN :: Prelude.Text,
Consumer -> ConsumerStatus
consumerStatus :: ConsumerStatus,
Consumer -> POSIX
consumerCreationTimestamp :: Core.POSIX
}
deriving (Consumer -> Consumer -> Bool
(Consumer -> Consumer -> Bool)
-> (Consumer -> Consumer -> Bool) -> Eq Consumer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Consumer -> Consumer -> Bool
$c/= :: Consumer -> Consumer -> Bool
== :: Consumer -> Consumer -> Bool
$c== :: Consumer -> Consumer -> Bool
Prelude.Eq, ReadPrec [Consumer]
ReadPrec Consumer
Int -> ReadS Consumer
ReadS [Consumer]
(Int -> ReadS Consumer)
-> ReadS [Consumer]
-> ReadPrec Consumer
-> ReadPrec [Consumer]
-> Read Consumer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Consumer]
$creadListPrec :: ReadPrec [Consumer]
readPrec :: ReadPrec Consumer
$creadPrec :: ReadPrec Consumer
readList :: ReadS [Consumer]
$creadList :: ReadS [Consumer]
readsPrec :: Int -> ReadS Consumer
$creadsPrec :: Int -> ReadS Consumer
Prelude.Read, Int -> Consumer -> ShowS
[Consumer] -> ShowS
Consumer -> String
(Int -> Consumer -> ShowS)
-> (Consumer -> String) -> ([Consumer] -> ShowS) -> Show Consumer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Consumer] -> ShowS
$cshowList :: [Consumer] -> ShowS
show :: Consumer -> String
$cshow :: Consumer -> String
showsPrec :: Int -> Consumer -> ShowS
$cshowsPrec :: Int -> Consumer -> ShowS
Prelude.Show, (forall x. Consumer -> Rep Consumer x)
-> (forall x. Rep Consumer x -> Consumer) -> Generic Consumer
forall x. Rep Consumer x -> Consumer
forall x. Consumer -> Rep Consumer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Consumer x -> Consumer
$cfrom :: forall x. Consumer -> Rep Consumer x
Prelude.Generic)
newConsumer ::
Prelude.Text ->
Prelude.Text ->
ConsumerStatus ->
Prelude.UTCTime ->
Consumer
newConsumer :: Text -> Text -> ConsumerStatus -> UTCTime -> Consumer
newConsumer
Text
pConsumerName_
Text
pConsumerARN_
ConsumerStatus
pConsumerStatus_
UTCTime
pConsumerCreationTimestamp_ =
Consumer' :: Text -> Text -> ConsumerStatus -> POSIX -> Consumer
Consumer'
{ $sel:consumerName:Consumer' :: Text
consumerName = Text
pConsumerName_,
$sel:consumerARN:Consumer' :: Text
consumerARN = Text
pConsumerARN_,
$sel:consumerStatus:Consumer' :: ConsumerStatus
consumerStatus = ConsumerStatus
pConsumerStatus_,
$sel:consumerCreationTimestamp:Consumer' :: 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_
}
consumer_consumerName :: Lens.Lens' Consumer Prelude.Text
consumer_consumerName :: (Text -> f Text) -> Consumer -> f Consumer
consumer_consumerName = (Consumer -> Text)
-> (Consumer -> Text -> Consumer)
-> Lens Consumer Consumer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Consumer' {Text
consumerName :: Text
$sel:consumerName:Consumer' :: Consumer -> Text
consumerName} -> Text
consumerName) (\s :: Consumer
s@Consumer' {} Text
a -> Consumer
s {$sel:consumerName:Consumer' :: Text
consumerName = Text
a} :: Consumer)
consumer_consumerARN :: Lens.Lens' Consumer Prelude.Text
consumer_consumerARN :: (Text -> f Text) -> Consumer -> f Consumer
consumer_consumerARN = (Consumer -> Text)
-> (Consumer -> Text -> Consumer)
-> Lens Consumer Consumer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Consumer' {Text
consumerARN :: Text
$sel:consumerARN:Consumer' :: Consumer -> Text
consumerARN} -> Text
consumerARN) (\s :: Consumer
s@Consumer' {} Text
a -> Consumer
s {$sel:consumerARN:Consumer' :: Text
consumerARN = Text
a} :: Consumer)
consumer_consumerStatus :: Lens.Lens' Consumer ConsumerStatus
consumer_consumerStatus :: (ConsumerStatus -> f ConsumerStatus) -> Consumer -> f Consumer
consumer_consumerStatus = (Consumer -> ConsumerStatus)
-> (Consumer -> ConsumerStatus -> Consumer)
-> Lens Consumer Consumer ConsumerStatus ConsumerStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Consumer' {ConsumerStatus
consumerStatus :: ConsumerStatus
$sel:consumerStatus:Consumer' :: Consumer -> ConsumerStatus
consumerStatus} -> ConsumerStatus
consumerStatus) (\s :: Consumer
s@Consumer' {} ConsumerStatus
a -> Consumer
s {$sel:consumerStatus:Consumer' :: ConsumerStatus
consumerStatus = ConsumerStatus
a} :: Consumer)
consumer_consumerCreationTimestamp :: Lens.Lens' Consumer Prelude.UTCTime
consumer_consumerCreationTimestamp :: (UTCTime -> f UTCTime) -> Consumer -> f Consumer
consumer_consumerCreationTimestamp = (Consumer -> POSIX)
-> (Consumer -> POSIX -> Consumer)
-> Lens Consumer Consumer POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Consumer' {POSIX
consumerCreationTimestamp :: POSIX
$sel:consumerCreationTimestamp:Consumer' :: Consumer -> POSIX
consumerCreationTimestamp} -> POSIX
consumerCreationTimestamp) (\s :: Consumer
s@Consumer' {} POSIX
a -> Consumer
s {$sel:consumerCreationTimestamp:Consumer' :: POSIX
consumerCreationTimestamp = POSIX
a} :: Consumer) ((POSIX -> f POSIX) -> Consumer -> f Consumer)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Consumer
-> f Consumer
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
instance Core.FromJSON Consumer where
parseJSON :: Value -> Parser Consumer
parseJSON =
String -> (Object -> Parser Consumer) -> Value -> Parser Consumer
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Consumer"
( \Object
x ->
Text -> Text -> ConsumerStatus -> POSIX -> Consumer
Consumer'
(Text -> Text -> ConsumerStatus -> POSIX -> Consumer)
-> Parser Text
-> Parser (Text -> ConsumerStatus -> POSIX -> Consumer)
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 -> Consumer)
-> Parser Text -> Parser (ConsumerStatus -> POSIX -> Consumer)
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 -> Consumer)
-> Parser ConsumerStatus -> Parser (POSIX -> Consumer)
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 -> Consumer) -> Parser POSIX -> Parser Consumer
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")
)
instance Prelude.Hashable Consumer
instance Prelude.NFData Consumer