{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kinesis.Types.ConsumerStatus
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 :: Data.POSIX
}
deriving (Consumer -> Consumer -> Bool
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]
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
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. 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'
{ $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 =
forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pConsumerCreationTimestamp_
}
consumer_consumerName :: Lens.Lens' Consumer Prelude.Text
consumer_consumerName :: Lens' Consumer Text
consumer_consumerName = 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 :: Lens' Consumer Text
consumer_consumerARN = 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 :: Lens' Consumer ConsumerStatus
consumer_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 :: Lens' Consumer UTCTime
consumer_consumerCreationTimestamp = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON Consumer where
parseJSON :: Value -> Parser Consumer
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Consumer"
( \Object
x ->
Text -> Text -> ConsumerStatus -> POSIX -> Consumer
Consumer'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ConsumerName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ConsumerARN")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ConsumerStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ConsumerCreationTimestamp")
)
instance Prelude.Hashable Consumer where
hashWithSalt :: Int -> Consumer -> Int
hashWithSalt Int
_salt Consumer' {Text
POSIX
ConsumerStatus
consumerCreationTimestamp :: POSIX
consumerStatus :: ConsumerStatus
consumerARN :: Text
consumerName :: Text
$sel:consumerCreationTimestamp:Consumer' :: Consumer -> POSIX
$sel:consumerStatus:Consumer' :: Consumer -> ConsumerStatus
$sel:consumerARN:Consumer' :: Consumer -> Text
$sel:consumerName:Consumer' :: Consumer -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
consumerName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
consumerARN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ConsumerStatus
consumerStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
consumerCreationTimestamp
instance Prelude.NFData Consumer where
rnf :: Consumer -> ()
rnf Consumer' {Text
POSIX
ConsumerStatus
consumerCreationTimestamp :: POSIX
consumerStatus :: ConsumerStatus
consumerARN :: Text
consumerName :: Text
$sel:consumerCreationTimestamp:Consumer' :: Consumer -> POSIX
$sel:consumerStatus:Consumer' :: Consumer -> ConsumerStatus
$sel:consumerARN:Consumer' :: Consumer -> Text
$sel:consumerName:Consumer' :: Consumer -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
consumerName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
consumerARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ConsumerStatus
consumerStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
consumerCreationTimestamp