{-# 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.QLDB.Types.JournalKinesisStreamDescription
-- 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.QLDB.Types.JournalKinesisStreamDescription where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QLDB.Types.ErrorCause
import Amazonka.QLDB.Types.KinesisConfiguration
import Amazonka.QLDB.Types.StreamStatus

-- | Information about an Amazon QLDB journal stream, including the Amazon
-- Resource Name (ARN), stream name, creation time, current status, and the
-- parameters of the original stream creation request.
--
-- /See:/ 'newJournalKinesisStreamDescription' smart constructor.
data JournalKinesisStreamDescription = JournalKinesisStreamDescription'
  { -- | The date and time, in epoch time format, when the QLDB journal stream
    -- was created. (Epoch time format is the number of seconds elapsed since
    -- 12:00:00 AM January 1, 1970 UTC.)
    JournalKinesisStreamDescription -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the QLDB journal stream.
    JournalKinesisStreamDescription -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The inclusive start date and time from which to start streaming journal
    -- data.
    JournalKinesisStreamDescription -> Maybe POSIX
inclusiveStartTime :: Prelude.Maybe Core.POSIX,
    -- | The error message that describes the reason that a stream has a status
    -- of @IMPAIRED@ or @FAILED@. This is not applicable to streams that have
    -- other status values.
    JournalKinesisStreamDescription -> Maybe ErrorCause
errorCause :: Prelude.Maybe ErrorCause,
    -- | The exclusive date and time that specifies when the stream ends. If this
    -- parameter is undefined, the stream runs indefinitely until you cancel
    -- it.
    JournalKinesisStreamDescription -> Maybe POSIX
exclusiveEndTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the ledger.
    JournalKinesisStreamDescription -> Text
ledgerName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the IAM role that grants QLDB
    -- permissions for a journal stream to write data records to a Kinesis Data
    -- Streams resource.
    JournalKinesisStreamDescription -> Text
roleArn :: Prelude.Text,
    -- | The UUID (represented in Base62-encoded text) of the QLDB journal
    -- stream.
    JournalKinesisStreamDescription -> Text
streamId :: Prelude.Text,
    -- | The current state of the QLDB journal stream.
    JournalKinesisStreamDescription -> StreamStatus
status :: StreamStatus,
    -- | The configuration settings of the Amazon Kinesis Data Streams
    -- destination for a QLDB journal stream.
    JournalKinesisStreamDescription -> KinesisConfiguration
kinesisConfiguration :: KinesisConfiguration,
    -- | The user-defined name of the QLDB journal stream.
    JournalKinesisStreamDescription -> Text
streamName :: Prelude.Text
  }
  deriving (JournalKinesisStreamDescription
-> JournalKinesisStreamDescription -> Bool
(JournalKinesisStreamDescription
 -> JournalKinesisStreamDescription -> Bool)
-> (JournalKinesisStreamDescription
    -> JournalKinesisStreamDescription -> Bool)
-> Eq JournalKinesisStreamDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JournalKinesisStreamDescription
-> JournalKinesisStreamDescription -> Bool
$c/= :: JournalKinesisStreamDescription
-> JournalKinesisStreamDescription -> Bool
== :: JournalKinesisStreamDescription
-> JournalKinesisStreamDescription -> Bool
$c== :: JournalKinesisStreamDescription
-> JournalKinesisStreamDescription -> Bool
Prelude.Eq, ReadPrec [JournalKinesisStreamDescription]
ReadPrec JournalKinesisStreamDescription
Int -> ReadS JournalKinesisStreamDescription
ReadS [JournalKinesisStreamDescription]
(Int -> ReadS JournalKinesisStreamDescription)
-> ReadS [JournalKinesisStreamDescription]
-> ReadPrec JournalKinesisStreamDescription
-> ReadPrec [JournalKinesisStreamDescription]
-> Read JournalKinesisStreamDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JournalKinesisStreamDescription]
$creadListPrec :: ReadPrec [JournalKinesisStreamDescription]
readPrec :: ReadPrec JournalKinesisStreamDescription
$creadPrec :: ReadPrec JournalKinesisStreamDescription
readList :: ReadS [JournalKinesisStreamDescription]
$creadList :: ReadS [JournalKinesisStreamDescription]
readsPrec :: Int -> ReadS JournalKinesisStreamDescription
$creadsPrec :: Int -> ReadS JournalKinesisStreamDescription
Prelude.Read, Int -> JournalKinesisStreamDescription -> ShowS
[JournalKinesisStreamDescription] -> ShowS
JournalKinesisStreamDescription -> String
(Int -> JournalKinesisStreamDescription -> ShowS)
-> (JournalKinesisStreamDescription -> String)
-> ([JournalKinesisStreamDescription] -> ShowS)
-> Show JournalKinesisStreamDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JournalKinesisStreamDescription] -> ShowS
$cshowList :: [JournalKinesisStreamDescription] -> ShowS
show :: JournalKinesisStreamDescription -> String
$cshow :: JournalKinesisStreamDescription -> String
showsPrec :: Int -> JournalKinesisStreamDescription -> ShowS
$cshowsPrec :: Int -> JournalKinesisStreamDescription -> ShowS
Prelude.Show, (forall x.
 JournalKinesisStreamDescription
 -> Rep JournalKinesisStreamDescription x)
-> (forall x.
    Rep JournalKinesisStreamDescription x
    -> JournalKinesisStreamDescription)
-> Generic JournalKinesisStreamDescription
forall x.
Rep JournalKinesisStreamDescription x
-> JournalKinesisStreamDescription
forall x.
JournalKinesisStreamDescription
-> Rep JournalKinesisStreamDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep JournalKinesisStreamDescription x
-> JournalKinesisStreamDescription
$cfrom :: forall x.
JournalKinesisStreamDescription
-> Rep JournalKinesisStreamDescription x
Prelude.Generic)

-- |
-- Create a value of 'JournalKinesisStreamDescription' 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:
--
-- 'creationTime', 'journalKinesisStreamDescription_creationTime' - The date and time, in epoch time format, when the QLDB journal stream
-- was created. (Epoch time format is the number of seconds elapsed since
-- 12:00:00 AM January 1, 1970 UTC.)
--
-- 'arn', 'journalKinesisStreamDescription_arn' - The Amazon Resource Name (ARN) of the QLDB journal stream.
--
-- 'inclusiveStartTime', 'journalKinesisStreamDescription_inclusiveStartTime' - The inclusive start date and time from which to start streaming journal
-- data.
--
-- 'errorCause', 'journalKinesisStreamDescription_errorCause' - The error message that describes the reason that a stream has a status
-- of @IMPAIRED@ or @FAILED@. This is not applicable to streams that have
-- other status values.
--
-- 'exclusiveEndTime', 'journalKinesisStreamDescription_exclusiveEndTime' - The exclusive date and time that specifies when the stream ends. If this
-- parameter is undefined, the stream runs indefinitely until you cancel
-- it.
--
-- 'ledgerName', 'journalKinesisStreamDescription_ledgerName' - The name of the ledger.
--
-- 'roleArn', 'journalKinesisStreamDescription_roleArn' - The Amazon Resource Name (ARN) of the IAM role that grants QLDB
-- permissions for a journal stream to write data records to a Kinesis Data
-- Streams resource.
--
-- 'streamId', 'journalKinesisStreamDescription_streamId' - The UUID (represented in Base62-encoded text) of the QLDB journal
-- stream.
--
-- 'status', 'journalKinesisStreamDescription_status' - The current state of the QLDB journal stream.
--
-- 'kinesisConfiguration', 'journalKinesisStreamDescription_kinesisConfiguration' - The configuration settings of the Amazon Kinesis Data Streams
-- destination for a QLDB journal stream.
--
-- 'streamName', 'journalKinesisStreamDescription_streamName' - The user-defined name of the QLDB journal stream.
newJournalKinesisStreamDescription ::
  -- | 'ledgerName'
  Prelude.Text ->
  -- | 'roleArn'
  Prelude.Text ->
  -- | 'streamId'
  Prelude.Text ->
  -- | 'status'
  StreamStatus ->
  -- | 'kinesisConfiguration'
  KinesisConfiguration ->
  -- | 'streamName'
  Prelude.Text ->
  JournalKinesisStreamDescription
newJournalKinesisStreamDescription :: Text
-> Text
-> Text
-> StreamStatus
-> KinesisConfiguration
-> Text
-> JournalKinesisStreamDescription
newJournalKinesisStreamDescription
  Text
pLedgerName_
  Text
pRoleArn_
  Text
pStreamId_
  StreamStatus
pStatus_
  KinesisConfiguration
pKinesisConfiguration_
  Text
pStreamName_ =
    JournalKinesisStreamDescription' :: Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe ErrorCause
-> Maybe POSIX
-> Text
-> Text
-> Text
-> StreamStatus
-> KinesisConfiguration
-> Text
-> JournalKinesisStreamDescription
JournalKinesisStreamDescription'
      { $sel:creationTime:JournalKinesisStreamDescription' :: Maybe POSIX
creationTime =
          Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:arn:JournalKinesisStreamDescription' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:inclusiveStartTime:JournalKinesisStreamDescription' :: Maybe POSIX
inclusiveStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:errorCause:JournalKinesisStreamDescription' :: Maybe ErrorCause
errorCause = Maybe ErrorCause
forall a. Maybe a
Prelude.Nothing,
        $sel:exclusiveEndTime:JournalKinesisStreamDescription' :: Maybe POSIX
exclusiveEndTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:ledgerName:JournalKinesisStreamDescription' :: Text
ledgerName = Text
pLedgerName_,
        $sel:roleArn:JournalKinesisStreamDescription' :: Text
roleArn = Text
pRoleArn_,
        $sel:streamId:JournalKinesisStreamDescription' :: Text
streamId = Text
pStreamId_,
        $sel:status:JournalKinesisStreamDescription' :: StreamStatus
status = StreamStatus
pStatus_,
        $sel:kinesisConfiguration:JournalKinesisStreamDescription' :: KinesisConfiguration
kinesisConfiguration =
          KinesisConfiguration
pKinesisConfiguration_,
        $sel:streamName:JournalKinesisStreamDescription' :: Text
streamName = Text
pStreamName_
      }

-- | The date and time, in epoch time format, when the QLDB journal stream
-- was created. (Epoch time format is the number of seconds elapsed since
-- 12:00:00 AM January 1, 1970 UTC.)
journalKinesisStreamDescription_creationTime :: Lens.Lens' JournalKinesisStreamDescription (Prelude.Maybe Prelude.UTCTime)
journalKinesisStreamDescription_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> JournalKinesisStreamDescription
-> f JournalKinesisStreamDescription
journalKinesisStreamDescription_creationTime = (JournalKinesisStreamDescription -> Maybe POSIX)
-> (JournalKinesisStreamDescription
    -> Maybe POSIX -> JournalKinesisStreamDescription)
-> Lens
     JournalKinesisStreamDescription
     JournalKinesisStreamDescription
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JournalKinesisStreamDescription' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:JournalKinesisStreamDescription' :: JournalKinesisStreamDescription -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: JournalKinesisStreamDescription
s@JournalKinesisStreamDescription' {} Maybe POSIX
a -> JournalKinesisStreamDescription
s {$sel:creationTime:JournalKinesisStreamDescription' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: JournalKinesisStreamDescription) ((Maybe POSIX -> f (Maybe POSIX))
 -> JournalKinesisStreamDescription
 -> f JournalKinesisStreamDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> JournalKinesisStreamDescription
-> f JournalKinesisStreamDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The Amazon Resource Name (ARN) of the QLDB journal stream.
journalKinesisStreamDescription_arn :: Lens.Lens' JournalKinesisStreamDescription (Prelude.Maybe Prelude.Text)
journalKinesisStreamDescription_arn :: (Maybe Text -> f (Maybe Text))
-> JournalKinesisStreamDescription
-> f JournalKinesisStreamDescription
journalKinesisStreamDescription_arn = (JournalKinesisStreamDescription -> Maybe Text)
-> (JournalKinesisStreamDescription
    -> Maybe Text -> JournalKinesisStreamDescription)
-> Lens
     JournalKinesisStreamDescription
     JournalKinesisStreamDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JournalKinesisStreamDescription' {Maybe Text
arn :: Maybe Text
$sel:arn:JournalKinesisStreamDescription' :: JournalKinesisStreamDescription -> Maybe Text
arn} -> Maybe Text
arn) (\s :: JournalKinesisStreamDescription
s@JournalKinesisStreamDescription' {} Maybe Text
a -> JournalKinesisStreamDescription
s {$sel:arn:JournalKinesisStreamDescription' :: Maybe Text
arn = Maybe Text
a} :: JournalKinesisStreamDescription)

-- | The inclusive start date and time from which to start streaming journal
-- data.
journalKinesisStreamDescription_inclusiveStartTime :: Lens.Lens' JournalKinesisStreamDescription (Prelude.Maybe Prelude.UTCTime)
journalKinesisStreamDescription_inclusiveStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> JournalKinesisStreamDescription
-> f JournalKinesisStreamDescription
journalKinesisStreamDescription_inclusiveStartTime = (JournalKinesisStreamDescription -> Maybe POSIX)
-> (JournalKinesisStreamDescription
    -> Maybe POSIX -> JournalKinesisStreamDescription)
-> Lens
     JournalKinesisStreamDescription
     JournalKinesisStreamDescription
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JournalKinesisStreamDescription' {Maybe POSIX
inclusiveStartTime :: Maybe POSIX
$sel:inclusiveStartTime:JournalKinesisStreamDescription' :: JournalKinesisStreamDescription -> Maybe POSIX
inclusiveStartTime} -> Maybe POSIX
inclusiveStartTime) (\s :: JournalKinesisStreamDescription
s@JournalKinesisStreamDescription' {} Maybe POSIX
a -> JournalKinesisStreamDescription
s {$sel:inclusiveStartTime:JournalKinesisStreamDescription' :: Maybe POSIX
inclusiveStartTime = Maybe POSIX
a} :: JournalKinesisStreamDescription) ((Maybe POSIX -> f (Maybe POSIX))
 -> JournalKinesisStreamDescription
 -> f JournalKinesisStreamDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> JournalKinesisStreamDescription
-> f JournalKinesisStreamDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The error message that describes the reason that a stream has a status
-- of @IMPAIRED@ or @FAILED@. This is not applicable to streams that have
-- other status values.
journalKinesisStreamDescription_errorCause :: Lens.Lens' JournalKinesisStreamDescription (Prelude.Maybe ErrorCause)
journalKinesisStreamDescription_errorCause :: (Maybe ErrorCause -> f (Maybe ErrorCause))
-> JournalKinesisStreamDescription
-> f JournalKinesisStreamDescription
journalKinesisStreamDescription_errorCause = (JournalKinesisStreamDescription -> Maybe ErrorCause)
-> (JournalKinesisStreamDescription
    -> Maybe ErrorCause -> JournalKinesisStreamDescription)
-> Lens
     JournalKinesisStreamDescription
     JournalKinesisStreamDescription
     (Maybe ErrorCause)
     (Maybe ErrorCause)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JournalKinesisStreamDescription' {Maybe ErrorCause
errorCause :: Maybe ErrorCause
$sel:errorCause:JournalKinesisStreamDescription' :: JournalKinesisStreamDescription -> Maybe ErrorCause
errorCause} -> Maybe ErrorCause
errorCause) (\s :: JournalKinesisStreamDescription
s@JournalKinesisStreamDescription' {} Maybe ErrorCause
a -> JournalKinesisStreamDescription
s {$sel:errorCause:JournalKinesisStreamDescription' :: Maybe ErrorCause
errorCause = Maybe ErrorCause
a} :: JournalKinesisStreamDescription)

-- | The exclusive date and time that specifies when the stream ends. If this
-- parameter is undefined, the stream runs indefinitely until you cancel
-- it.
journalKinesisStreamDescription_exclusiveEndTime :: Lens.Lens' JournalKinesisStreamDescription (Prelude.Maybe Prelude.UTCTime)
journalKinesisStreamDescription_exclusiveEndTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> JournalKinesisStreamDescription
-> f JournalKinesisStreamDescription
journalKinesisStreamDescription_exclusiveEndTime = (JournalKinesisStreamDescription -> Maybe POSIX)
-> (JournalKinesisStreamDescription
    -> Maybe POSIX -> JournalKinesisStreamDescription)
-> Lens
     JournalKinesisStreamDescription
     JournalKinesisStreamDescription
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JournalKinesisStreamDescription' {Maybe POSIX
exclusiveEndTime :: Maybe POSIX
$sel:exclusiveEndTime:JournalKinesisStreamDescription' :: JournalKinesisStreamDescription -> Maybe POSIX
exclusiveEndTime} -> Maybe POSIX
exclusiveEndTime) (\s :: JournalKinesisStreamDescription
s@JournalKinesisStreamDescription' {} Maybe POSIX
a -> JournalKinesisStreamDescription
s {$sel:exclusiveEndTime:JournalKinesisStreamDescription' :: Maybe POSIX
exclusiveEndTime = Maybe POSIX
a} :: JournalKinesisStreamDescription) ((Maybe POSIX -> f (Maybe POSIX))
 -> JournalKinesisStreamDescription
 -> f JournalKinesisStreamDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> JournalKinesisStreamDescription
-> f JournalKinesisStreamDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the ledger.
journalKinesisStreamDescription_ledgerName :: Lens.Lens' JournalKinesisStreamDescription Prelude.Text
journalKinesisStreamDescription_ledgerName :: (Text -> f Text)
-> JournalKinesisStreamDescription
-> f JournalKinesisStreamDescription
journalKinesisStreamDescription_ledgerName = (JournalKinesisStreamDescription -> Text)
-> (JournalKinesisStreamDescription
    -> Text -> JournalKinesisStreamDescription)
-> Lens
     JournalKinesisStreamDescription
     JournalKinesisStreamDescription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JournalKinesisStreamDescription' {Text
ledgerName :: Text
$sel:ledgerName:JournalKinesisStreamDescription' :: JournalKinesisStreamDescription -> Text
ledgerName} -> Text
ledgerName) (\s :: JournalKinesisStreamDescription
s@JournalKinesisStreamDescription' {} Text
a -> JournalKinesisStreamDescription
s {$sel:ledgerName:JournalKinesisStreamDescription' :: Text
ledgerName = Text
a} :: JournalKinesisStreamDescription)

-- | The Amazon Resource Name (ARN) of the IAM role that grants QLDB
-- permissions for a journal stream to write data records to a Kinesis Data
-- Streams resource.
journalKinesisStreamDescription_roleArn :: Lens.Lens' JournalKinesisStreamDescription Prelude.Text
journalKinesisStreamDescription_roleArn :: (Text -> f Text)
-> JournalKinesisStreamDescription
-> f JournalKinesisStreamDescription
journalKinesisStreamDescription_roleArn = (JournalKinesisStreamDescription -> Text)
-> (JournalKinesisStreamDescription
    -> Text -> JournalKinesisStreamDescription)
-> Lens
     JournalKinesisStreamDescription
     JournalKinesisStreamDescription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JournalKinesisStreamDescription' {Text
roleArn :: Text
$sel:roleArn:JournalKinesisStreamDescription' :: JournalKinesisStreamDescription -> Text
roleArn} -> Text
roleArn) (\s :: JournalKinesisStreamDescription
s@JournalKinesisStreamDescription' {} Text
a -> JournalKinesisStreamDescription
s {$sel:roleArn:JournalKinesisStreamDescription' :: Text
roleArn = Text
a} :: JournalKinesisStreamDescription)

-- | The UUID (represented in Base62-encoded text) of the QLDB journal
-- stream.
journalKinesisStreamDescription_streamId :: Lens.Lens' JournalKinesisStreamDescription Prelude.Text
journalKinesisStreamDescription_streamId :: (Text -> f Text)
-> JournalKinesisStreamDescription
-> f JournalKinesisStreamDescription
journalKinesisStreamDescription_streamId = (JournalKinesisStreamDescription -> Text)
-> (JournalKinesisStreamDescription
    -> Text -> JournalKinesisStreamDescription)
-> Lens
     JournalKinesisStreamDescription
     JournalKinesisStreamDescription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JournalKinesisStreamDescription' {Text
streamId :: Text
$sel:streamId:JournalKinesisStreamDescription' :: JournalKinesisStreamDescription -> Text
streamId} -> Text
streamId) (\s :: JournalKinesisStreamDescription
s@JournalKinesisStreamDescription' {} Text
a -> JournalKinesisStreamDescription
s {$sel:streamId:JournalKinesisStreamDescription' :: Text
streamId = Text
a} :: JournalKinesisStreamDescription)

-- | The current state of the QLDB journal stream.
journalKinesisStreamDescription_status :: Lens.Lens' JournalKinesisStreamDescription StreamStatus
journalKinesisStreamDescription_status :: (StreamStatus -> f StreamStatus)
-> JournalKinesisStreamDescription
-> f JournalKinesisStreamDescription
journalKinesisStreamDescription_status = (JournalKinesisStreamDescription -> StreamStatus)
-> (JournalKinesisStreamDescription
    -> StreamStatus -> JournalKinesisStreamDescription)
-> Lens
     JournalKinesisStreamDescription
     JournalKinesisStreamDescription
     StreamStatus
     StreamStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JournalKinesisStreamDescription' {StreamStatus
status :: StreamStatus
$sel:status:JournalKinesisStreamDescription' :: JournalKinesisStreamDescription -> StreamStatus
status} -> StreamStatus
status) (\s :: JournalKinesisStreamDescription
s@JournalKinesisStreamDescription' {} StreamStatus
a -> JournalKinesisStreamDescription
s {$sel:status:JournalKinesisStreamDescription' :: StreamStatus
status = StreamStatus
a} :: JournalKinesisStreamDescription)

-- | The configuration settings of the Amazon Kinesis Data Streams
-- destination for a QLDB journal stream.
journalKinesisStreamDescription_kinesisConfiguration :: Lens.Lens' JournalKinesisStreamDescription KinesisConfiguration
journalKinesisStreamDescription_kinesisConfiguration :: (KinesisConfiguration -> f KinesisConfiguration)
-> JournalKinesisStreamDescription
-> f JournalKinesisStreamDescription
journalKinesisStreamDescription_kinesisConfiguration = (JournalKinesisStreamDescription -> KinesisConfiguration)
-> (JournalKinesisStreamDescription
    -> KinesisConfiguration -> JournalKinesisStreamDescription)
-> Lens
     JournalKinesisStreamDescription
     JournalKinesisStreamDescription
     KinesisConfiguration
     KinesisConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JournalKinesisStreamDescription' {KinesisConfiguration
kinesisConfiguration :: KinesisConfiguration
$sel:kinesisConfiguration:JournalKinesisStreamDescription' :: JournalKinesisStreamDescription -> KinesisConfiguration
kinesisConfiguration} -> KinesisConfiguration
kinesisConfiguration) (\s :: JournalKinesisStreamDescription
s@JournalKinesisStreamDescription' {} KinesisConfiguration
a -> JournalKinesisStreamDescription
s {$sel:kinesisConfiguration:JournalKinesisStreamDescription' :: KinesisConfiguration
kinesisConfiguration = KinesisConfiguration
a} :: JournalKinesisStreamDescription)

-- | The user-defined name of the QLDB journal stream.
journalKinesisStreamDescription_streamName :: Lens.Lens' JournalKinesisStreamDescription Prelude.Text
journalKinesisStreamDescription_streamName :: (Text -> f Text)
-> JournalKinesisStreamDescription
-> f JournalKinesisStreamDescription
journalKinesisStreamDescription_streamName = (JournalKinesisStreamDescription -> Text)
-> (JournalKinesisStreamDescription
    -> Text -> JournalKinesisStreamDescription)
-> Lens
     JournalKinesisStreamDescription
     JournalKinesisStreamDescription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JournalKinesisStreamDescription' {Text
streamName :: Text
$sel:streamName:JournalKinesisStreamDescription' :: JournalKinesisStreamDescription -> Text
streamName} -> Text
streamName) (\s :: JournalKinesisStreamDescription
s@JournalKinesisStreamDescription' {} Text
a -> JournalKinesisStreamDescription
s {$sel:streamName:JournalKinesisStreamDescription' :: Text
streamName = Text
a} :: JournalKinesisStreamDescription)

instance
  Core.FromJSON
    JournalKinesisStreamDescription
  where
  parseJSON :: Value -> Parser JournalKinesisStreamDescription
parseJSON =
    String
-> (Object -> Parser JournalKinesisStreamDescription)
-> Value
-> Parser JournalKinesisStreamDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"JournalKinesisStreamDescription"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe ErrorCause
-> Maybe POSIX
-> Text
-> Text
-> Text
-> StreamStatus
-> KinesisConfiguration
-> Text
-> JournalKinesisStreamDescription
JournalKinesisStreamDescription'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe ErrorCause
 -> Maybe POSIX
 -> Text
 -> Text
 -> Text
 -> StreamStatus
 -> KinesisConfiguration
 -> Text
 -> JournalKinesisStreamDescription)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe ErrorCause
      -> Maybe POSIX
      -> Text
      -> Text
      -> Text
      -> StreamStatus
      -> KinesisConfiguration
      -> Text
      -> JournalKinesisStreamDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationTime")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe ErrorCause
   -> Maybe POSIX
   -> Text
   -> Text
   -> Text
   -> StreamStatus
   -> KinesisConfiguration
   -> Text
   -> JournalKinesisStreamDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe ErrorCause
      -> Maybe POSIX
      -> Text
      -> Text
      -> Text
      -> StreamStatus
      -> KinesisConfiguration
      -> Text
      -> JournalKinesisStreamDescription)
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
"Arn")
            Parser
  (Maybe POSIX
   -> Maybe ErrorCause
   -> Maybe POSIX
   -> Text
   -> Text
   -> Text
   -> StreamStatus
   -> KinesisConfiguration
   -> Text
   -> JournalKinesisStreamDescription)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe ErrorCause
      -> Maybe POSIX
      -> Text
      -> Text
      -> Text
      -> StreamStatus
      -> KinesisConfiguration
      -> Text
      -> JournalKinesisStreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InclusiveStartTime")
            Parser
  (Maybe ErrorCause
   -> Maybe POSIX
   -> Text
   -> Text
   -> Text
   -> StreamStatus
   -> KinesisConfiguration
   -> Text
   -> JournalKinesisStreamDescription)
-> Parser (Maybe ErrorCause)
-> Parser
     (Maybe POSIX
      -> Text
      -> Text
      -> Text
      -> StreamStatus
      -> KinesisConfiguration
      -> Text
      -> JournalKinesisStreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ErrorCause)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorCause")
            Parser
  (Maybe POSIX
   -> Text
   -> Text
   -> Text
   -> StreamStatus
   -> KinesisConfiguration
   -> Text
   -> JournalKinesisStreamDescription)
-> Parser (Maybe POSIX)
-> Parser
     (Text
      -> Text
      -> Text
      -> StreamStatus
      -> KinesisConfiguration
      -> Text
      -> JournalKinesisStreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExclusiveEndTime")
            Parser
  (Text
   -> Text
   -> Text
   -> StreamStatus
   -> KinesisConfiguration
   -> Text
   -> JournalKinesisStreamDescription)
-> Parser Text
-> Parser
     (Text
      -> Text
      -> StreamStatus
      -> KinesisConfiguration
      -> Text
      -> JournalKinesisStreamDescription)
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
"LedgerName")
            Parser
  (Text
   -> Text
   -> StreamStatus
   -> KinesisConfiguration
   -> Text
   -> JournalKinesisStreamDescription)
-> Parser Text
-> Parser
     (Text
      -> StreamStatus
      -> KinesisConfiguration
      -> Text
      -> JournalKinesisStreamDescription)
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
"RoleArn")
            Parser
  (Text
   -> StreamStatus
   -> KinesisConfiguration
   -> Text
   -> JournalKinesisStreamDescription)
-> Parser Text
-> Parser
     (StreamStatus
      -> KinesisConfiguration -> Text -> JournalKinesisStreamDescription)
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
"StreamId")
            Parser
  (StreamStatus
   -> KinesisConfiguration -> Text -> JournalKinesisStreamDescription)
-> Parser StreamStatus
-> Parser
     (KinesisConfiguration -> Text -> JournalKinesisStreamDescription)
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
"Status")
            Parser
  (KinesisConfiguration -> Text -> JournalKinesisStreamDescription)
-> Parser KinesisConfiguration
-> Parser (Text -> JournalKinesisStreamDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser KinesisConfiguration
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"KinesisConfiguration")
            Parser (Text -> JournalKinesisStreamDescription)
-> Parser Text -> Parser JournalKinesisStreamDescription
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")
      )

instance
  Prelude.Hashable
    JournalKinesisStreamDescription

instance
  Prelude.NFData
    JournalKinesisStreamDescription