{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Kinesis.Types.StreamDescriptionSummary
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Kinesis.Types.StreamDescriptionSummary where

import qualified Amazonka.Core as Core
import Amazonka.Kinesis.Types.EncryptionType
import Amazonka.Kinesis.Types.EnhancedMetrics
import Amazonka.Kinesis.Types.StreamStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents the output for DescribeStreamSummary
--
-- /See:/ 'newStreamDescriptionSummary' smart constructor.
data StreamDescriptionSummary = StreamDescriptionSummary'
  { -- | The encryption type used. This value is one of the following:
    --
    -- -   @KMS@
    --
    -- -   @NONE@
    StreamDescriptionSummary -> Maybe EncryptionType
encryptionType :: Prelude.Maybe EncryptionType,
    -- | The GUID for the customer-managed AWS KMS key to use for encryption.
    -- This value can be a globally unique identifier, a fully specified ARN to
    -- either an alias or a key, or an alias name prefixed by \"alias\/\".You
    -- can also use a master key owned by Kinesis Data Streams by specifying
    -- the alias @aws\/kinesis@.
    --
    -- -   Key ARN example:
    --     @arn:aws:kms:us-east-1:123456789012:key\/12345678-1234-1234-1234-123456789012@
    --
    -- -   Alias ARN example:
    --     @ arn:aws:kms:us-east-1:123456789012:alias\/MyAliasName@
    --
    -- -   Globally unique key ID example:
    --     @12345678-1234-1234-1234-123456789012@
    --
    -- -   Alias name example: @alias\/MyAliasName@
    --
    -- -   Master key owned by Kinesis Data Streams: @alias\/aws\/kinesis@
    StreamDescriptionSummary -> Maybe Text
keyId :: Prelude.Maybe Prelude.Text,
    -- | The number of enhanced fan-out consumers registered with the stream.
    StreamDescriptionSummary -> Maybe Natural
consumerCount :: Prelude.Maybe Prelude.Natural,
    -- | The name of the stream being described.
    StreamDescriptionSummary -> Text
streamName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the stream being described.
    StreamDescriptionSummary -> Text
streamARN :: Prelude.Text,
    -- | The current status of the stream being described. The stream status is
    -- one of the following states:
    --
    -- -   @CREATING@ - The stream is being created. Kinesis Data Streams
    --     immediately returns and sets @StreamStatus@ to @CREATING@.
    --
    -- -   @DELETING@ - The stream is being deleted. The specified stream is in
    --     the @DELETING@ state until Kinesis Data Streams completes the
    --     deletion.
    --
    -- -   @ACTIVE@ - The stream exists and is ready for read and write
    --     operations or deletion. You should perform read and write operations
    --     only on an @ACTIVE@ stream.
    --
    -- -   @UPDATING@ - Shards in the stream are being merged or split. Read
    --     and write operations continue to work while the stream is in the
    --     @UPDATING@ state.
    StreamDescriptionSummary -> StreamStatus
streamStatus :: StreamStatus,
    -- | The current retention period, in hours.
    StreamDescriptionSummary -> Int
retentionPeriodHours :: Prelude.Int,
    -- | The approximate time that the stream was created.
    StreamDescriptionSummary -> POSIX
streamCreationTimestamp :: Core.POSIX,
    -- | Represents the current enhanced monitoring settings of the stream.
    StreamDescriptionSummary -> [EnhancedMetrics]
enhancedMonitoring :: [EnhancedMetrics],
    -- | The number of open shards in the stream.
    StreamDescriptionSummary -> Natural
openShardCount :: Prelude.Natural
  }
  deriving (StreamDescriptionSummary -> StreamDescriptionSummary -> Bool
(StreamDescriptionSummary -> StreamDescriptionSummary -> Bool)
-> (StreamDescriptionSummary -> StreamDescriptionSummary -> Bool)
-> Eq StreamDescriptionSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamDescriptionSummary -> StreamDescriptionSummary -> Bool
$c/= :: StreamDescriptionSummary -> StreamDescriptionSummary -> Bool
== :: StreamDescriptionSummary -> StreamDescriptionSummary -> Bool
$c== :: StreamDescriptionSummary -> StreamDescriptionSummary -> Bool
Prelude.Eq, ReadPrec [StreamDescriptionSummary]
ReadPrec StreamDescriptionSummary
Int -> ReadS StreamDescriptionSummary
ReadS [StreamDescriptionSummary]
(Int -> ReadS StreamDescriptionSummary)
-> ReadS [StreamDescriptionSummary]
-> ReadPrec StreamDescriptionSummary
-> ReadPrec [StreamDescriptionSummary]
-> Read StreamDescriptionSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StreamDescriptionSummary]
$creadListPrec :: ReadPrec [StreamDescriptionSummary]
readPrec :: ReadPrec StreamDescriptionSummary
$creadPrec :: ReadPrec StreamDescriptionSummary
readList :: ReadS [StreamDescriptionSummary]
$creadList :: ReadS [StreamDescriptionSummary]
readsPrec :: Int -> ReadS StreamDescriptionSummary
$creadsPrec :: Int -> ReadS StreamDescriptionSummary
Prelude.Read, Int -> StreamDescriptionSummary -> ShowS
[StreamDescriptionSummary] -> ShowS
StreamDescriptionSummary -> String
(Int -> StreamDescriptionSummary -> ShowS)
-> (StreamDescriptionSummary -> String)
-> ([StreamDescriptionSummary] -> ShowS)
-> Show StreamDescriptionSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamDescriptionSummary] -> ShowS
$cshowList :: [StreamDescriptionSummary] -> ShowS
show :: StreamDescriptionSummary -> String
$cshow :: StreamDescriptionSummary -> String
showsPrec :: Int -> StreamDescriptionSummary -> ShowS
$cshowsPrec :: Int -> StreamDescriptionSummary -> ShowS
Prelude.Show, (forall x.
 StreamDescriptionSummary -> Rep StreamDescriptionSummary x)
-> (forall x.
    Rep StreamDescriptionSummary x -> StreamDescriptionSummary)
-> Generic StreamDescriptionSummary
forall x.
Rep StreamDescriptionSummary x -> StreamDescriptionSummary
forall x.
StreamDescriptionSummary -> Rep StreamDescriptionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StreamDescriptionSummary x -> StreamDescriptionSummary
$cfrom :: forall x.
StreamDescriptionSummary -> Rep StreamDescriptionSummary x
Prelude.Generic)

-- |
-- Create a value of 'StreamDescriptionSummary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'encryptionType', 'streamDescriptionSummary_encryptionType' - The encryption type used. This value is one of the following:
--
-- -   @KMS@
--
-- -   @NONE@
--
-- 'keyId', 'streamDescriptionSummary_keyId' - The GUID for the customer-managed AWS KMS key to use for encryption.
-- This value can be a globally unique identifier, a fully specified ARN to
-- either an alias or a key, or an alias name prefixed by \"alias\/\".You
-- can also use a master key owned by Kinesis Data Streams by specifying
-- the alias @aws\/kinesis@.
--
-- -   Key ARN example:
--     @arn:aws:kms:us-east-1:123456789012:key\/12345678-1234-1234-1234-123456789012@
--
-- -   Alias ARN example:
--     @ arn:aws:kms:us-east-1:123456789012:alias\/MyAliasName@
--
-- -   Globally unique key ID example:
--     @12345678-1234-1234-1234-123456789012@
--
-- -   Alias name example: @alias\/MyAliasName@
--
-- -   Master key owned by Kinesis Data Streams: @alias\/aws\/kinesis@
--
-- 'consumerCount', 'streamDescriptionSummary_consumerCount' - The number of enhanced fan-out consumers registered with the stream.
--
-- 'streamName', 'streamDescriptionSummary_streamName' - The name of the stream being described.
--
-- 'streamARN', 'streamDescriptionSummary_streamARN' - The Amazon Resource Name (ARN) for the stream being described.
--
-- 'streamStatus', 'streamDescriptionSummary_streamStatus' - The current status of the stream being described. The stream status is
-- one of the following states:
--
-- -   @CREATING@ - The stream is being created. Kinesis Data Streams
--     immediately returns and sets @StreamStatus@ to @CREATING@.
--
-- -   @DELETING@ - The stream is being deleted. The specified stream is in
--     the @DELETING@ state until Kinesis Data Streams completes the
--     deletion.
--
-- -   @ACTIVE@ - The stream exists and is ready for read and write
--     operations or deletion. You should perform read and write operations
--     only on an @ACTIVE@ stream.
--
-- -   @UPDATING@ - Shards in the stream are being merged or split. Read
--     and write operations continue to work while the stream is in the
--     @UPDATING@ state.
--
-- 'retentionPeriodHours', 'streamDescriptionSummary_retentionPeriodHours' - The current retention period, in hours.
--
-- 'streamCreationTimestamp', 'streamDescriptionSummary_streamCreationTimestamp' - The approximate time that the stream was created.
--
-- 'enhancedMonitoring', 'streamDescriptionSummary_enhancedMonitoring' - Represents the current enhanced monitoring settings of the stream.
--
-- 'openShardCount', 'streamDescriptionSummary_openShardCount' - The number of open shards in the stream.
newStreamDescriptionSummary ::
  -- | 'streamName'
  Prelude.Text ->
  -- | 'streamARN'
  Prelude.Text ->
  -- | 'streamStatus'
  StreamStatus ->
  -- | 'retentionPeriodHours'
  Prelude.Int ->
  -- | 'streamCreationTimestamp'
  Prelude.UTCTime ->
  -- | 'openShardCount'
  Prelude.Natural ->
  StreamDescriptionSummary
newStreamDescriptionSummary :: Text
-> Text
-> StreamStatus
-> Int
-> UTCTime
-> Natural
-> StreamDescriptionSummary
newStreamDescriptionSummary
  Text
pStreamName_
  Text
pStreamARN_
  StreamStatus
pStreamStatus_
  Int
pRetentionPeriodHours_
  UTCTime
pStreamCreationTimestamp_
  Natural
pOpenShardCount_ =
    StreamDescriptionSummary' :: Maybe EncryptionType
-> Maybe Text
-> Maybe Natural
-> Text
-> Text
-> StreamStatus
-> Int
-> POSIX
-> [EnhancedMetrics]
-> Natural
-> StreamDescriptionSummary
StreamDescriptionSummary'
      { $sel:encryptionType:StreamDescriptionSummary' :: Maybe EncryptionType
encryptionType =
          Maybe EncryptionType
forall a. Maybe a
Prelude.Nothing,
        $sel:keyId:StreamDescriptionSummary' :: Maybe Text
keyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:consumerCount:StreamDescriptionSummary' :: Maybe Natural
consumerCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:streamName:StreamDescriptionSummary' :: Text
streamName = Text
pStreamName_,
        $sel:streamARN:StreamDescriptionSummary' :: Text
streamARN = Text
pStreamARN_,
        $sel:streamStatus:StreamDescriptionSummary' :: StreamStatus
streamStatus = StreamStatus
pStreamStatus_,
        $sel:retentionPeriodHours:StreamDescriptionSummary' :: Int
retentionPeriodHours = Int
pRetentionPeriodHours_,
        $sel:streamCreationTimestamp:StreamDescriptionSummary' :: 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:StreamDescriptionSummary' :: [EnhancedMetrics]
enhancedMonitoring = [EnhancedMetrics]
forall a. Monoid a => a
Prelude.mempty,
        $sel:openShardCount:StreamDescriptionSummary' :: Natural
openShardCount = Natural
pOpenShardCount_
      }

-- | The encryption type used. This value is one of the following:
--
-- -   @KMS@
--
-- -   @NONE@
streamDescriptionSummary_encryptionType :: Lens.Lens' StreamDescriptionSummary (Prelude.Maybe EncryptionType)
streamDescriptionSummary_encryptionType :: (Maybe EncryptionType -> f (Maybe EncryptionType))
-> StreamDescriptionSummary -> f StreamDescriptionSummary
streamDescriptionSummary_encryptionType = (StreamDescriptionSummary -> Maybe EncryptionType)
-> (StreamDescriptionSummary
    -> Maybe EncryptionType -> StreamDescriptionSummary)
-> Lens
     StreamDescriptionSummary
     StreamDescriptionSummary
     (Maybe EncryptionType)
     (Maybe EncryptionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescriptionSummary' {Maybe EncryptionType
encryptionType :: Maybe EncryptionType
$sel:encryptionType:StreamDescriptionSummary' :: StreamDescriptionSummary -> Maybe EncryptionType
encryptionType} -> Maybe EncryptionType
encryptionType) (\s :: StreamDescriptionSummary
s@StreamDescriptionSummary' {} Maybe EncryptionType
a -> StreamDescriptionSummary
s {$sel:encryptionType:StreamDescriptionSummary' :: Maybe EncryptionType
encryptionType = Maybe EncryptionType
a} :: StreamDescriptionSummary)

-- | The GUID for the customer-managed AWS KMS key to use for encryption.
-- This value can be a globally unique identifier, a fully specified ARN to
-- either an alias or a key, or an alias name prefixed by \"alias\/\".You
-- can also use a master key owned by Kinesis Data Streams by specifying
-- the alias @aws\/kinesis@.
--
-- -   Key ARN example:
--     @arn:aws:kms:us-east-1:123456789012:key\/12345678-1234-1234-1234-123456789012@
--
-- -   Alias ARN example:
--     @ arn:aws:kms:us-east-1:123456789012:alias\/MyAliasName@
--
-- -   Globally unique key ID example:
--     @12345678-1234-1234-1234-123456789012@
--
-- -   Alias name example: @alias\/MyAliasName@
--
-- -   Master key owned by Kinesis Data Streams: @alias\/aws\/kinesis@
streamDescriptionSummary_keyId :: Lens.Lens' StreamDescriptionSummary (Prelude.Maybe Prelude.Text)
streamDescriptionSummary_keyId :: (Maybe Text -> f (Maybe Text))
-> StreamDescriptionSummary -> f StreamDescriptionSummary
streamDescriptionSummary_keyId = (StreamDescriptionSummary -> Maybe Text)
-> (StreamDescriptionSummary
    -> Maybe Text -> StreamDescriptionSummary)
-> Lens
     StreamDescriptionSummary
     StreamDescriptionSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescriptionSummary' {Maybe Text
keyId :: Maybe Text
$sel:keyId:StreamDescriptionSummary' :: StreamDescriptionSummary -> Maybe Text
keyId} -> Maybe Text
keyId) (\s :: StreamDescriptionSummary
s@StreamDescriptionSummary' {} Maybe Text
a -> StreamDescriptionSummary
s {$sel:keyId:StreamDescriptionSummary' :: Maybe Text
keyId = Maybe Text
a} :: StreamDescriptionSummary)

-- | The number of enhanced fan-out consumers registered with the stream.
streamDescriptionSummary_consumerCount :: Lens.Lens' StreamDescriptionSummary (Prelude.Maybe Prelude.Natural)
streamDescriptionSummary_consumerCount :: (Maybe Natural -> f (Maybe Natural))
-> StreamDescriptionSummary -> f StreamDescriptionSummary
streamDescriptionSummary_consumerCount = (StreamDescriptionSummary -> Maybe Natural)
-> (StreamDescriptionSummary
    -> Maybe Natural -> StreamDescriptionSummary)
-> Lens
     StreamDescriptionSummary
     StreamDescriptionSummary
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescriptionSummary' {Maybe Natural
consumerCount :: Maybe Natural
$sel:consumerCount:StreamDescriptionSummary' :: StreamDescriptionSummary -> Maybe Natural
consumerCount} -> Maybe Natural
consumerCount) (\s :: StreamDescriptionSummary
s@StreamDescriptionSummary' {} Maybe Natural
a -> StreamDescriptionSummary
s {$sel:consumerCount:StreamDescriptionSummary' :: Maybe Natural
consumerCount = Maybe Natural
a} :: StreamDescriptionSummary)

-- | The name of the stream being described.
streamDescriptionSummary_streamName :: Lens.Lens' StreamDescriptionSummary Prelude.Text
streamDescriptionSummary_streamName :: (Text -> f Text)
-> StreamDescriptionSummary -> f StreamDescriptionSummary
streamDescriptionSummary_streamName = (StreamDescriptionSummary -> Text)
-> (StreamDescriptionSummary -> Text -> StreamDescriptionSummary)
-> Lens StreamDescriptionSummary StreamDescriptionSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescriptionSummary' {Text
streamName :: Text
$sel:streamName:StreamDescriptionSummary' :: StreamDescriptionSummary -> Text
streamName} -> Text
streamName) (\s :: StreamDescriptionSummary
s@StreamDescriptionSummary' {} Text
a -> StreamDescriptionSummary
s {$sel:streamName:StreamDescriptionSummary' :: Text
streamName = Text
a} :: StreamDescriptionSummary)

-- | The Amazon Resource Name (ARN) for the stream being described.
streamDescriptionSummary_streamARN :: Lens.Lens' StreamDescriptionSummary Prelude.Text
streamDescriptionSummary_streamARN :: (Text -> f Text)
-> StreamDescriptionSummary -> f StreamDescriptionSummary
streamDescriptionSummary_streamARN = (StreamDescriptionSummary -> Text)
-> (StreamDescriptionSummary -> Text -> StreamDescriptionSummary)
-> Lens StreamDescriptionSummary StreamDescriptionSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescriptionSummary' {Text
streamARN :: Text
$sel:streamARN:StreamDescriptionSummary' :: StreamDescriptionSummary -> Text
streamARN} -> Text
streamARN) (\s :: StreamDescriptionSummary
s@StreamDescriptionSummary' {} Text
a -> StreamDescriptionSummary
s {$sel:streamARN:StreamDescriptionSummary' :: Text
streamARN = Text
a} :: StreamDescriptionSummary)

-- | The current status of the stream being described. The stream status is
-- one of the following states:
--
-- -   @CREATING@ - The stream is being created. Kinesis Data Streams
--     immediately returns and sets @StreamStatus@ to @CREATING@.
--
-- -   @DELETING@ - The stream is being deleted. The specified stream is in
--     the @DELETING@ state until Kinesis Data Streams completes the
--     deletion.
--
-- -   @ACTIVE@ - The stream exists and is ready for read and write
--     operations or deletion. You should perform read and write operations
--     only on an @ACTIVE@ stream.
--
-- -   @UPDATING@ - Shards in the stream are being merged or split. Read
--     and write operations continue to work while the stream is in the
--     @UPDATING@ state.
streamDescriptionSummary_streamStatus :: Lens.Lens' StreamDescriptionSummary StreamStatus
streamDescriptionSummary_streamStatus :: (StreamStatus -> f StreamStatus)
-> StreamDescriptionSummary -> f StreamDescriptionSummary
streamDescriptionSummary_streamStatus = (StreamDescriptionSummary -> StreamStatus)
-> (StreamDescriptionSummary
    -> StreamStatus -> StreamDescriptionSummary)
-> Lens
     StreamDescriptionSummary
     StreamDescriptionSummary
     StreamStatus
     StreamStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescriptionSummary' {StreamStatus
streamStatus :: StreamStatus
$sel:streamStatus:StreamDescriptionSummary' :: StreamDescriptionSummary -> StreamStatus
streamStatus} -> StreamStatus
streamStatus) (\s :: StreamDescriptionSummary
s@StreamDescriptionSummary' {} StreamStatus
a -> StreamDescriptionSummary
s {$sel:streamStatus:StreamDescriptionSummary' :: StreamStatus
streamStatus = StreamStatus
a} :: StreamDescriptionSummary)

-- | The current retention period, in hours.
streamDescriptionSummary_retentionPeriodHours :: Lens.Lens' StreamDescriptionSummary Prelude.Int
streamDescriptionSummary_retentionPeriodHours :: (Int -> f Int)
-> StreamDescriptionSummary -> f StreamDescriptionSummary
streamDescriptionSummary_retentionPeriodHours = (StreamDescriptionSummary -> Int)
-> (StreamDescriptionSummary -> Int -> StreamDescriptionSummary)
-> Lens StreamDescriptionSummary StreamDescriptionSummary Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescriptionSummary' {Int
retentionPeriodHours :: Int
$sel:retentionPeriodHours:StreamDescriptionSummary' :: StreamDescriptionSummary -> Int
retentionPeriodHours} -> Int
retentionPeriodHours) (\s :: StreamDescriptionSummary
s@StreamDescriptionSummary' {} Int
a -> StreamDescriptionSummary
s {$sel:retentionPeriodHours:StreamDescriptionSummary' :: Int
retentionPeriodHours = Int
a} :: StreamDescriptionSummary)

-- | The approximate time that the stream was created.
streamDescriptionSummary_streamCreationTimestamp :: Lens.Lens' StreamDescriptionSummary Prelude.UTCTime
streamDescriptionSummary_streamCreationTimestamp :: (UTCTime -> f UTCTime)
-> StreamDescriptionSummary -> f StreamDescriptionSummary
streamDescriptionSummary_streamCreationTimestamp = (StreamDescriptionSummary -> POSIX)
-> (StreamDescriptionSummary -> POSIX -> StreamDescriptionSummary)
-> Lens
     StreamDescriptionSummary StreamDescriptionSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescriptionSummary' {POSIX
streamCreationTimestamp :: POSIX
$sel:streamCreationTimestamp:StreamDescriptionSummary' :: StreamDescriptionSummary -> POSIX
streamCreationTimestamp} -> POSIX
streamCreationTimestamp) (\s :: StreamDescriptionSummary
s@StreamDescriptionSummary' {} POSIX
a -> StreamDescriptionSummary
s {$sel:streamCreationTimestamp:StreamDescriptionSummary' :: POSIX
streamCreationTimestamp = POSIX
a} :: StreamDescriptionSummary) ((POSIX -> f POSIX)
 -> StreamDescriptionSummary -> f StreamDescriptionSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> StreamDescriptionSummary
-> f StreamDescriptionSummary
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

-- | Represents the current enhanced monitoring settings of the stream.
streamDescriptionSummary_enhancedMonitoring :: Lens.Lens' StreamDescriptionSummary [EnhancedMetrics]
streamDescriptionSummary_enhancedMonitoring :: ([EnhancedMetrics] -> f [EnhancedMetrics])
-> StreamDescriptionSummary -> f StreamDescriptionSummary
streamDescriptionSummary_enhancedMonitoring = (StreamDescriptionSummary -> [EnhancedMetrics])
-> (StreamDescriptionSummary
    -> [EnhancedMetrics] -> StreamDescriptionSummary)
-> Lens
     StreamDescriptionSummary
     StreamDescriptionSummary
     [EnhancedMetrics]
     [EnhancedMetrics]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescriptionSummary' {[EnhancedMetrics]
enhancedMonitoring :: [EnhancedMetrics]
$sel:enhancedMonitoring:StreamDescriptionSummary' :: StreamDescriptionSummary -> [EnhancedMetrics]
enhancedMonitoring} -> [EnhancedMetrics]
enhancedMonitoring) (\s :: StreamDescriptionSummary
s@StreamDescriptionSummary' {} [EnhancedMetrics]
a -> StreamDescriptionSummary
s {$sel:enhancedMonitoring:StreamDescriptionSummary' :: [EnhancedMetrics]
enhancedMonitoring = [EnhancedMetrics]
a} :: StreamDescriptionSummary) (([EnhancedMetrics] -> f [EnhancedMetrics])
 -> StreamDescriptionSummary -> f StreamDescriptionSummary)
-> (([EnhancedMetrics] -> f [EnhancedMetrics])
    -> [EnhancedMetrics] -> f [EnhancedMetrics])
-> ([EnhancedMetrics] -> f [EnhancedMetrics])
-> StreamDescriptionSummary
-> f StreamDescriptionSummary
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

-- | The number of open shards in the stream.
streamDescriptionSummary_openShardCount :: Lens.Lens' StreamDescriptionSummary Prelude.Natural
streamDescriptionSummary_openShardCount :: (Natural -> f Natural)
-> StreamDescriptionSummary -> f StreamDescriptionSummary
streamDescriptionSummary_openShardCount = (StreamDescriptionSummary -> Natural)
-> (StreamDescriptionSummary
    -> Natural -> StreamDescriptionSummary)
-> Lens
     StreamDescriptionSummary StreamDescriptionSummary Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamDescriptionSummary' {Natural
openShardCount :: Natural
$sel:openShardCount:StreamDescriptionSummary' :: StreamDescriptionSummary -> Natural
openShardCount} -> Natural
openShardCount) (\s :: StreamDescriptionSummary
s@StreamDescriptionSummary' {} Natural
a -> StreamDescriptionSummary
s {$sel:openShardCount:StreamDescriptionSummary' :: Natural
openShardCount = Natural
a} :: StreamDescriptionSummary)

instance Core.FromJSON StreamDescriptionSummary where
  parseJSON :: Value -> Parser StreamDescriptionSummary
parseJSON =
    String
-> (Object -> Parser StreamDescriptionSummary)
-> Value
-> Parser StreamDescriptionSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"StreamDescriptionSummary"
      ( \Object
x ->
          Maybe EncryptionType
-> Maybe Text
-> Maybe Natural
-> Text
-> Text
-> StreamStatus
-> Int
-> POSIX
-> [EnhancedMetrics]
-> Natural
-> StreamDescriptionSummary
StreamDescriptionSummary'
            (Maybe EncryptionType
 -> Maybe Text
 -> Maybe Natural
 -> Text
 -> Text
 -> StreamStatus
 -> Int
 -> POSIX
 -> [EnhancedMetrics]
 -> Natural
 -> StreamDescriptionSummary)
-> Parser (Maybe EncryptionType)
-> Parser
     (Maybe Text
      -> Maybe Natural
      -> Text
      -> Text
      -> StreamStatus
      -> Int
      -> POSIX
      -> [EnhancedMetrics]
      -> Natural
      -> StreamDescriptionSummary)
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
   -> Maybe Natural
   -> Text
   -> Text
   -> StreamStatus
   -> Int
   -> POSIX
   -> [EnhancedMetrics]
   -> Natural
   -> StreamDescriptionSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Natural
      -> Text
      -> Text
      -> StreamStatus
      -> Int
      -> POSIX
      -> [EnhancedMetrics]
      -> Natural
      -> StreamDescriptionSummary)
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
  (Maybe Natural
   -> Text
   -> Text
   -> StreamStatus
   -> Int
   -> POSIX
   -> [EnhancedMetrics]
   -> Natural
   -> StreamDescriptionSummary)
-> Parser (Maybe Natural)
-> Parser
     (Text
      -> Text
      -> StreamStatus
      -> Int
      -> POSIX
      -> [EnhancedMetrics]
      -> Natural
      -> StreamDescriptionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ConsumerCount")
            Parser
  (Text
   -> Text
   -> StreamStatus
   -> Int
   -> POSIX
   -> [EnhancedMetrics]
   -> Natural
   -> StreamDescriptionSummary)
-> Parser Text
-> Parser
     (Text
      -> StreamStatus
      -> Int
      -> POSIX
      -> [EnhancedMetrics]
      -> Natural
      -> StreamDescriptionSummary)
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
   -> Int
   -> POSIX
   -> [EnhancedMetrics]
   -> Natural
   -> StreamDescriptionSummary)
-> Parser Text
-> Parser
     (StreamStatus
      -> Int
      -> POSIX
      -> [EnhancedMetrics]
      -> Natural
      -> StreamDescriptionSummary)
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
   -> Int
   -> POSIX
   -> [EnhancedMetrics]
   -> Natural
   -> StreamDescriptionSummary)
-> Parser StreamStatus
-> Parser
     (Int
      -> POSIX
      -> [EnhancedMetrics]
      -> Natural
      -> StreamDescriptionSummary)
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
  (Int
   -> POSIX
   -> [EnhancedMetrics]
   -> Natural
   -> StreamDescriptionSummary)
-> Parser Int
-> Parser
     (POSIX -> [EnhancedMetrics] -> Natural -> StreamDescriptionSummary)
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] -> Natural -> StreamDescriptionSummary)
-> Parser POSIX
-> Parser
     ([EnhancedMetrics] -> Natural -> StreamDescriptionSummary)
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] -> Natural -> StreamDescriptionSummary)
-> Parser [EnhancedMetrics]
-> Parser (Natural -> StreamDescriptionSummary)
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
                        )
            Parser (Natural -> StreamDescriptionSummary)
-> Parser Natural -> Parser StreamDescriptionSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"OpenShardCount")
      )

instance Prelude.Hashable StreamDescriptionSummary

instance Prelude.NFData StreamDescriptionSummary