{-# 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.StreamDescription where
import qualified Amazonka.Core as Core
import Amazonka.Kinesis.Types.EncryptionType
import Amazonka.Kinesis.Types.EnhancedMetrics
import Amazonka.Kinesis.Types.Shard
import Amazonka.Kinesis.Types.StreamStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StreamDescription = StreamDescription'
{
StreamDescription -> Maybe EncryptionType
encryptionType :: Prelude.Maybe EncryptionType,
StreamDescription -> Maybe Text
keyId :: Prelude.Maybe Prelude.Text,
StreamDescription -> Text
streamName :: Prelude.Text,
StreamDescription -> Text
streamARN :: Prelude.Text,
StreamDescription -> StreamStatus
streamStatus :: StreamStatus,
StreamDescription -> [Shard]
shards :: [Shard],
StreamDescription -> Bool
hasMoreShards :: Prelude.Bool,
StreamDescription -> Int
retentionPeriodHours :: Prelude.Int,
StreamDescription -> POSIX
streamCreationTimestamp :: Core.POSIX,
StreamDescription -> [EnhancedMetrics]
enhancedMonitoring :: [EnhancedMetrics]
}
deriving (StreamDescription -> StreamDescription -> Bool
(StreamDescription -> StreamDescription -> Bool)
-> (StreamDescription -> StreamDescription -> Bool)
-> Eq StreamDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamDescription -> StreamDescription -> Bool
$c/= :: StreamDescription -> StreamDescription -> Bool
== :: StreamDescription -> StreamDescription -> Bool
$c== :: StreamDescription -> StreamDescription -> Bool
Prelude.Eq, ReadPrec [StreamDescription]
ReadPrec StreamDescription
Int -> ReadS StreamDescription
ReadS [StreamDescription]
(Int -> ReadS StreamDescription)
-> ReadS [StreamDescription]
-> ReadPrec StreamDescription
-> ReadPrec [StreamDescription]
-> Read StreamDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StreamDescription]
$creadListPrec :: ReadPrec [StreamDescription]
readPrec :: ReadPrec StreamDescription
$creadPrec :: ReadPrec StreamDescription
readList :: ReadS [StreamDescription]
$creadList :: ReadS [StreamDescription]
readsPrec :: Int -> ReadS StreamDescription
$creadsPrec :: Int -> ReadS StreamDescription
Prelude.Read, Int -> StreamDescription -> ShowS
[StreamDescription] -> ShowS
StreamDescription -> String
(Int -> StreamDescription -> ShowS)
-> (StreamDescription -> String)
-> ([StreamDescription] -> ShowS)
-> Show StreamDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamDescription] -> ShowS
$cshowList :: [StreamDescription] -> ShowS
show :: StreamDescription -> String
$cshow :: StreamDescription -> String
showsPrec :: Int -> StreamDescription -> ShowS
$cshowsPrec :: Int -> StreamDescription -> ShowS
Prelude.Show, (forall x. StreamDescription -> Rep StreamDescription x)
-> (forall x. Rep StreamDescription x -> StreamDescription)
-> Generic StreamDescription
forall x. Rep StreamDescription x -> StreamDescription
forall x. StreamDescription -> Rep StreamDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StreamDescription x -> StreamDescription
$cfrom :: forall x. StreamDescription -> Rep StreamDescription x
Prelude.Generic)
newStreamDescription ::
Prelude.Text ->
Prelude.Text ->
StreamStatus ->
Prelude.Bool ->
Prelude.Int ->
Prelude.UTCTime ->
StreamDescription
newStreamDescription :: Text
-> Text
-> StreamStatus
-> Bool
-> Int
-> UTCTime
-> StreamDescription
newStreamDescription
Text
pStreamName_
Text
pStreamARN_
StreamStatus
pStreamStatus_
Bool
pHasMoreShards_
Int
pRetentionPeriodHours_
UTCTime
pStreamCreationTimestamp_ =
StreamDescription' :: Maybe EncryptionType
-> Maybe Text
-> Text
-> Text
-> StreamStatus
-> [Shard]
-> Bool
-> Int
-> POSIX
-> [EnhancedMetrics]
-> StreamDescription
StreamDescription'
{ $sel:encryptionType:StreamDescription' :: Maybe EncryptionType
encryptionType =
Maybe EncryptionType
forall a. Maybe a
Prelude.Nothing,
$sel:keyId:StreamDescription' :: Maybe Text
keyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:streamName:StreamDescription' :: Text
streamName = Text
pStreamName_,
$sel:streamARN:StreamDescription' :: Text
streamARN = Text
pStreamARN_,
$sel:streamStatus:StreamDescription' :: StreamStatus
streamStatus = StreamStatus
pStreamStatus_,
$sel:shards:StreamDescription' :: [Shard]
shards = [Shard]
forall a. Monoid a => a
Prelude.mempty,
$sel:hasMoreShards:StreamDescription' :: Bool
hasMoreShards = Bool
pHasMoreShards_,
$sel:retentionPeriodHours:StreamDescription' :: Int
retentionPeriodHours = Int
pRetentionPeriodHours_,
$sel:streamCreationTimestamp:StreamDescription' :: POSIX
streamCreationTimestamp =
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
pStreamCreationTimestamp_,
$sel:enhancedMonitoring:StreamDescription' :: [EnhancedMetrics]
enhancedMonitoring = [EnhancedMetrics]
forall a. Monoid a => a
Prelude.mempty
}
streamDescription_encryptionType :: Lens.Lens' StreamDescription (Prelude.Maybe EncryptionType)
streamDescription_encryptionType :: (Maybe EncryptionType -> f (Maybe EncryptionType))
-> StreamDescription -> f StreamDescription
streamDescription_encryptionType = (StreamDescription -> Maybe EncryptionType)
-> (StreamDescription -> Maybe EncryptionType -> StreamDescription)
-> Lens
StreamDescription
StreamDescription
(Maybe EncryptionType)
(Maybe EncryptionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescription' {Maybe EncryptionType
encryptionType :: Maybe EncryptionType
$sel:encryptionType:StreamDescription' :: StreamDescription -> Maybe EncryptionType
encryptionType} -> Maybe EncryptionType
encryptionType) (\s :: StreamDescription
s@StreamDescription' {} Maybe EncryptionType
a -> StreamDescription
s {$sel:encryptionType:StreamDescription' :: Maybe EncryptionType
encryptionType = Maybe EncryptionType
a} :: StreamDescription)
streamDescription_keyId :: Lens.Lens' StreamDescription (Prelude.Maybe Prelude.Text)
streamDescription_keyId :: (Maybe Text -> f (Maybe Text))
-> StreamDescription -> f StreamDescription
streamDescription_keyId = (StreamDescription -> Maybe Text)
-> (StreamDescription -> Maybe Text -> StreamDescription)
-> Lens
StreamDescription StreamDescription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescription' {Maybe Text
keyId :: Maybe Text
$sel:keyId:StreamDescription' :: StreamDescription -> Maybe Text
keyId} -> Maybe Text
keyId) (\s :: StreamDescription
s@StreamDescription' {} Maybe Text
a -> StreamDescription
s {$sel:keyId:StreamDescription' :: Maybe Text
keyId = Maybe Text
a} :: StreamDescription)
streamDescription_streamName :: Lens.Lens' StreamDescription Prelude.Text
streamDescription_streamName :: (Text -> f Text) -> StreamDescription -> f StreamDescription
streamDescription_streamName = (StreamDescription -> Text)
-> (StreamDescription -> Text -> StreamDescription)
-> Lens StreamDescription StreamDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescription' {Text
streamName :: Text
$sel:streamName:StreamDescription' :: StreamDescription -> Text
streamName} -> Text
streamName) (\s :: StreamDescription
s@StreamDescription' {} Text
a -> StreamDescription
s {$sel:streamName:StreamDescription' :: Text
streamName = Text
a} :: StreamDescription)
streamDescription_streamARN :: Lens.Lens' StreamDescription Prelude.Text
streamDescription_streamARN :: (Text -> f Text) -> StreamDescription -> f StreamDescription
streamDescription_streamARN = (StreamDescription -> Text)
-> (StreamDescription -> Text -> StreamDescription)
-> Lens StreamDescription StreamDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescription' {Text
streamARN :: Text
$sel:streamARN:StreamDescription' :: StreamDescription -> Text
streamARN} -> Text
streamARN) (\s :: StreamDescription
s@StreamDescription' {} Text
a -> StreamDescription
s {$sel:streamARN:StreamDescription' :: Text
streamARN = Text
a} :: StreamDescription)
streamDescription_streamStatus :: Lens.Lens' StreamDescription StreamStatus
streamDescription_streamStatus :: (StreamStatus -> f StreamStatus)
-> StreamDescription -> f StreamDescription
streamDescription_streamStatus = (StreamDescription -> StreamStatus)
-> (StreamDescription -> StreamStatus -> StreamDescription)
-> Lens
StreamDescription StreamDescription StreamStatus StreamStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescription' {StreamStatus
streamStatus :: StreamStatus
$sel:streamStatus:StreamDescription' :: StreamDescription -> StreamStatus
streamStatus} -> StreamStatus
streamStatus) (\s :: StreamDescription
s@StreamDescription' {} StreamStatus
a -> StreamDescription
s {$sel:streamStatus:StreamDescription' :: StreamStatus
streamStatus = StreamStatus
a} :: StreamDescription)
streamDescription_shards :: Lens.Lens' StreamDescription [Shard]
streamDescription_shards :: ([Shard] -> f [Shard]) -> StreamDescription -> f StreamDescription
streamDescription_shards = (StreamDescription -> [Shard])
-> (StreamDescription -> [Shard] -> StreamDescription)
-> Lens StreamDescription StreamDescription [Shard] [Shard]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescription' {[Shard]
shards :: [Shard]
$sel:shards:StreamDescription' :: StreamDescription -> [Shard]
shards} -> [Shard]
shards) (\s :: StreamDescription
s@StreamDescription' {} [Shard]
a -> StreamDescription
s {$sel:shards:StreamDescription' :: [Shard]
shards = [Shard]
a} :: StreamDescription) (([Shard] -> f [Shard])
-> StreamDescription -> f StreamDescription)
-> (([Shard] -> f [Shard]) -> [Shard] -> f [Shard])
-> ([Shard] -> f [Shard])
-> StreamDescription
-> f StreamDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Shard] -> f [Shard]) -> [Shard] -> f [Shard]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
streamDescription_hasMoreShards :: Lens.Lens' StreamDescription Prelude.Bool
streamDescription_hasMoreShards :: (Bool -> f Bool) -> StreamDescription -> f StreamDescription
streamDescription_hasMoreShards = (StreamDescription -> Bool)
-> (StreamDescription -> Bool -> StreamDescription)
-> Lens StreamDescription StreamDescription Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescription' {Bool
hasMoreShards :: Bool
$sel:hasMoreShards:StreamDescription' :: StreamDescription -> Bool
hasMoreShards} -> Bool
hasMoreShards) (\s :: StreamDescription
s@StreamDescription' {} Bool
a -> StreamDescription
s {$sel:hasMoreShards:StreamDescription' :: Bool
hasMoreShards = Bool
a} :: StreamDescription)
streamDescription_retentionPeriodHours :: Lens.Lens' StreamDescription Prelude.Int
streamDescription_retentionPeriodHours :: (Int -> f Int) -> StreamDescription -> f StreamDescription
streamDescription_retentionPeriodHours = (StreamDescription -> Int)
-> (StreamDescription -> Int -> StreamDescription)
-> Lens StreamDescription StreamDescription Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescription' {Int
retentionPeriodHours :: Int
$sel:retentionPeriodHours:StreamDescription' :: StreamDescription -> Int
retentionPeriodHours} -> Int
retentionPeriodHours) (\s :: StreamDescription
s@StreamDescription' {} Int
a -> StreamDescription
s {$sel:retentionPeriodHours:StreamDescription' :: Int
retentionPeriodHours = Int
a} :: StreamDescription)
streamDescription_streamCreationTimestamp :: Lens.Lens' StreamDescription Prelude.UTCTime
streamDescription_streamCreationTimestamp :: (UTCTime -> f UTCTime) -> StreamDescription -> f StreamDescription
streamDescription_streamCreationTimestamp = (StreamDescription -> POSIX)
-> (StreamDescription -> POSIX -> StreamDescription)
-> Lens StreamDescription StreamDescription POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescription' {POSIX
streamCreationTimestamp :: POSIX
$sel:streamCreationTimestamp:StreamDescription' :: StreamDescription -> POSIX
streamCreationTimestamp} -> POSIX
streamCreationTimestamp) (\s :: StreamDescription
s@StreamDescription' {} POSIX
a -> StreamDescription
s {$sel:streamCreationTimestamp:StreamDescription' :: POSIX
streamCreationTimestamp = POSIX
a} :: StreamDescription) ((POSIX -> f POSIX) -> StreamDescription -> f StreamDescription)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> StreamDescription
-> f StreamDescription
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
streamDescription_enhancedMonitoring :: Lens.Lens' StreamDescription [EnhancedMetrics]
streamDescription_enhancedMonitoring :: ([EnhancedMetrics] -> f [EnhancedMetrics])
-> StreamDescription -> f StreamDescription
streamDescription_enhancedMonitoring = (StreamDescription -> [EnhancedMetrics])
-> (StreamDescription -> [EnhancedMetrics] -> StreamDescription)
-> Lens
StreamDescription
StreamDescription
[EnhancedMetrics]
[EnhancedMetrics]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescription' {[EnhancedMetrics]
enhancedMonitoring :: [EnhancedMetrics]
$sel:enhancedMonitoring:StreamDescription' :: StreamDescription -> [EnhancedMetrics]
enhancedMonitoring} -> [EnhancedMetrics]
enhancedMonitoring) (\s :: StreamDescription
s@StreamDescription' {} [EnhancedMetrics]
a -> StreamDescription
s {$sel:enhancedMonitoring:StreamDescription' :: [EnhancedMetrics]
enhancedMonitoring = [EnhancedMetrics]
a} :: StreamDescription) (([EnhancedMetrics] -> f [EnhancedMetrics])
-> StreamDescription -> f StreamDescription)
-> (([EnhancedMetrics] -> f [EnhancedMetrics])
-> [EnhancedMetrics] -> f [EnhancedMetrics])
-> ([EnhancedMetrics] -> f [EnhancedMetrics])
-> StreamDescription
-> f StreamDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([EnhancedMetrics] -> f [EnhancedMetrics])
-> [EnhancedMetrics] -> f [EnhancedMetrics]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON StreamDescription where
parseJSON :: Value -> Parser StreamDescription
parseJSON =
String
-> (Object -> Parser StreamDescription)
-> Value
-> Parser StreamDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StreamDescription"
( \Object
x ->
Maybe EncryptionType
-> Maybe Text
-> Text
-> Text
-> StreamStatus
-> [Shard]
-> Bool
-> Int
-> POSIX
-> [EnhancedMetrics]
-> StreamDescription
StreamDescription'
(Maybe EncryptionType
-> Maybe Text
-> Text
-> Text
-> StreamStatus
-> [Shard]
-> Bool
-> Int
-> POSIX
-> [EnhancedMetrics]
-> StreamDescription)
-> Parser (Maybe EncryptionType)
-> Parser
(Maybe Text
-> Text
-> Text
-> StreamStatus
-> [Shard]
-> Bool
-> Int
-> POSIX
-> [EnhancedMetrics]
-> StreamDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe EncryptionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EncryptionType")
Parser
(Maybe Text
-> Text
-> Text
-> StreamStatus
-> [Shard]
-> Bool
-> Int
-> POSIX
-> [EnhancedMetrics]
-> StreamDescription)
-> Parser (Maybe Text)
-> Parser
(Text
-> Text
-> StreamStatus
-> [Shard]
-> Bool
-> Int
-> POSIX
-> [EnhancedMetrics]
-> StreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KeyId")
Parser
(Text
-> Text
-> StreamStatus
-> [Shard]
-> Bool
-> Int
-> POSIX
-> [EnhancedMetrics]
-> StreamDescription)
-> Parser Text
-> Parser
(Text
-> StreamStatus
-> [Shard]
-> Bool
-> Int
-> POSIX
-> [EnhancedMetrics]
-> StreamDescription)
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
"StreamName")
Parser
(Text
-> StreamStatus
-> [Shard]
-> Bool
-> Int
-> POSIX
-> [EnhancedMetrics]
-> StreamDescription)
-> Parser Text
-> Parser
(StreamStatus
-> [Shard]
-> Bool
-> Int
-> POSIX
-> [EnhancedMetrics]
-> StreamDescription)
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")
Parser
(StreamStatus
-> [Shard]
-> Bool
-> Int
-> POSIX
-> [EnhancedMetrics]
-> StreamDescription)
-> Parser StreamStatus
-> Parser
([Shard]
-> Bool -> Int -> POSIX -> [EnhancedMetrics] -> StreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser StreamStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"StreamStatus")
Parser
([Shard]
-> Bool -> Int -> POSIX -> [EnhancedMetrics] -> StreamDescription)
-> Parser [Shard]
-> Parser
(Bool -> Int -> POSIX -> [EnhancedMetrics] -> StreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [Shard])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Shards" Parser (Maybe [Shard]) -> [Shard] -> Parser [Shard]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Shard]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Bool -> Int -> POSIX -> [EnhancedMetrics] -> StreamDescription)
-> Parser Bool
-> Parser (Int -> POSIX -> [EnhancedMetrics] -> StreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"HasMoreShards")
Parser (Int -> POSIX -> [EnhancedMetrics] -> StreamDescription)
-> Parser Int
-> Parser (POSIX -> [EnhancedMetrics] -> StreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RetentionPeriodHours")
Parser (POSIX -> [EnhancedMetrics] -> StreamDescription)
-> Parser POSIX -> Parser ([EnhancedMetrics] -> StreamDescription)
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
"StreamCreationTimestamp")
Parser ([EnhancedMetrics] -> StreamDescription)
-> Parser [EnhancedMetrics] -> Parser StreamDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe [EnhancedMetrics])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EnhancedMonitoring"
Parser (Maybe [EnhancedMetrics])
-> [EnhancedMetrics] -> Parser [EnhancedMetrics]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [EnhancedMetrics]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable StreamDescription
instance Prelude.NFData StreamDescription