{-# 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 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 ConsumerDescription = ConsumerDescription'
{
ConsumerDescription -> Text
consumerName :: Prelude.Text,
ConsumerDescription -> Text
consumerARN :: Prelude.Text,
ConsumerDescription -> ConsumerStatus
consumerStatus :: ConsumerStatus,
ConsumerDescription -> POSIX
consumerCreationTimestamp :: Data.POSIX,
ConsumerDescription -> Text
streamARN :: Prelude.Text
}
deriving (ConsumerDescription -> ConsumerDescription -> Bool
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]
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
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. 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'
{ $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 =
forall (a :: Format). Iso' (Time a) UTCTime
Data._Time 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 :: Lens' ConsumerDescription Text
consumerDescription_consumerName = 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 :: Lens' ConsumerDescription Text
consumerDescription_consumerARN = 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 :: Lens' ConsumerDescription ConsumerStatus
consumerDescription_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 :: Lens' ConsumerDescription UTCTime
consumerDescription_consumerCreationTimestamp = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
consumerDescription_streamARN :: Lens.Lens' ConsumerDescription Prelude.Text
consumerDescription_streamARN :: Lens' ConsumerDescription Text
consumerDescription_streamARN = 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 Data.FromJSON ConsumerDescription where
parseJSON :: Value -> Parser ConsumerDescription
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ConsumerDescription"
( \Object
x ->
Text
-> Text -> ConsumerStatus -> POSIX -> Text -> ConsumerDescription
ConsumerDescription'
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")
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
"StreamARN")
)
instance Prelude.Hashable ConsumerDescription where
hashWithSalt :: Int -> ConsumerDescription -> Int
hashWithSalt Int
_salt ConsumerDescription' {Text
POSIX
ConsumerStatus
streamARN :: Text
consumerCreationTimestamp :: POSIX
consumerStatus :: ConsumerStatus
consumerARN :: Text
consumerName :: Text
$sel:streamARN:ConsumerDescription' :: ConsumerDescription -> Text
$sel:consumerCreationTimestamp:ConsumerDescription' :: ConsumerDescription -> POSIX
$sel:consumerStatus:ConsumerDescription' :: ConsumerDescription -> ConsumerStatus
$sel:consumerARN:ConsumerDescription' :: ConsumerDescription -> Text
$sel:consumerName:ConsumerDescription' :: ConsumerDescription -> 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
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
streamARN
instance Prelude.NFData ConsumerDescription where
rnf :: ConsumerDescription -> ()
rnf ConsumerDescription' {Text
POSIX
ConsumerStatus
streamARN :: Text
consumerCreationTimestamp :: POSIX
consumerStatus :: ConsumerStatus
consumerARN :: Text
consumerName :: Text
$sel:streamARN:ConsumerDescription' :: ConsumerDescription -> Text
$sel:consumerCreationTimestamp:ConsumerDescription' :: ConsumerDescription -> POSIX
$sel:consumerStatus:ConsumerDescription' :: ConsumerDescription -> ConsumerStatus
$sel:consumerARN:ConsumerDescription' :: ConsumerDescription -> Text
$sel:consumerName:ConsumerDescription' :: ConsumerDescription -> 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
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
streamARN