{-# 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.StreamDescription
-- 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.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

-- | Represents the output for DescribeStream.
--
-- /See:/ 'newStreamDescription' smart constructor.
data StreamDescription = StreamDescription'
  { -- | The server-side encryption type used on the stream. This parameter can
    -- be one of the following values:
    --
    -- -   @NONE@: Do not encrypt the records in the stream.
    --
    -- -   @KMS@: Use server-side encryption on the records in the stream using
    --     a customer-managed AWS KMS key.
    StreamDescription -> 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@
    StreamDescription -> Maybe Text
keyId :: Prelude.Maybe Prelude.Text,
    -- | The name of the stream being described.
    StreamDescription -> Text
streamName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the stream being described.
    StreamDescription -> 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.
    StreamDescription -> StreamStatus
streamStatus :: StreamStatus,
    -- | The shards that comprise the stream.
    StreamDescription -> [Shard]
shards :: [Shard],
    -- | If set to @true@, more shards in the stream are available to describe.
    StreamDescription -> Bool
hasMoreShards :: Prelude.Bool,
    -- | The current retention period, in hours. Minimum value of 24. Maximum
    -- value of 168.
    StreamDescription -> Int
retentionPeriodHours :: Prelude.Int,
    -- | The approximate time that the stream was created.
    StreamDescription -> POSIX
streamCreationTimestamp :: Core.POSIX,
    -- | Represents the current enhanced monitoring settings of the stream.
    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)

-- |
-- Create a value of 'StreamDescription' 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', 'streamDescription_encryptionType' - The server-side encryption type used on the stream. This parameter can
-- be one of the following values:
--
-- -   @NONE@: Do not encrypt the records in the stream.
--
-- -   @KMS@: Use server-side encryption on the records in the stream using
--     a customer-managed AWS KMS key.
--
-- 'keyId', 'streamDescription_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@
--
-- 'streamName', 'streamDescription_streamName' - The name of the stream being described.
--
-- 'streamARN', 'streamDescription_streamARN' - The Amazon Resource Name (ARN) for the stream being described.
--
-- 'streamStatus', 'streamDescription_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.
--
-- 'shards', 'streamDescription_shards' - The shards that comprise the stream.
--
-- 'hasMoreShards', 'streamDescription_hasMoreShards' - If set to @true@, more shards in the stream are available to describe.
--
-- 'retentionPeriodHours', 'streamDescription_retentionPeriodHours' - The current retention period, in hours. Minimum value of 24. Maximum
-- value of 168.
--
-- 'streamCreationTimestamp', 'streamDescription_streamCreationTimestamp' - The approximate time that the stream was created.
--
-- 'enhancedMonitoring', 'streamDescription_enhancedMonitoring' - Represents the current enhanced monitoring settings of the stream.
newStreamDescription ::
  -- | 'streamName'
  Prelude.Text ->
  -- | 'streamARN'
  Prelude.Text ->
  -- | 'streamStatus'
  StreamStatus ->
  -- | 'hasMoreShards'
  Prelude.Bool ->
  -- | 'retentionPeriodHours'
  Prelude.Int ->
  -- | 'streamCreationTimestamp'
  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
      }

-- | The server-side encryption type used on the stream. This parameter can
-- be one of the following values:
--
-- -   @NONE@: Do not encrypt the records in the stream.
--
-- -   @KMS@: Use server-side encryption on the records in the stream using
--     a customer-managed AWS KMS key.
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)

-- | 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@
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)

-- | The name of the stream being described.
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)

-- | The Amazon Resource Name (ARN) for the stream being described.
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)

-- | 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.
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)

-- | The shards that comprise the stream.
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

-- | If set to @true@, more shards in the stream are available to describe.
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)

-- | The current retention period, in hours. Minimum value of 24. Maximum
-- value of 168.
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)

-- | The approximate time that the stream was created.
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

-- | Represents the current enhanced monitoring settings of the stream.
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