{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.ListJournalKinesisStreamsForLedger
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns an array of all Amazon QLDB journal stream descriptors for a
-- given ledger. The output of each stream descriptor includes the same
-- details that are returned by @DescribeJournalKinesisStream@.
--
-- This action does not return any expired journal streams. For more
-- information, see
-- <https://docs.aws.amazon.com/qldb/latest/developerguide/streams.create.html#streams.create.states.expiration Expiration for terminal streams>
-- in the /Amazon QLDB Developer Guide/.
--
-- This action returns a maximum of @MaxResults@ items. It is paginated so
-- that you can retrieve all the items by calling
-- @ListJournalKinesisStreamsForLedger@ multiple times.
module Amazonka.QLDB.ListJournalKinesisStreamsForLedger
  ( -- * Creating a Request
    ListJournalKinesisStreamsForLedger (..),
    newListJournalKinesisStreamsForLedger,

    -- * Request Lenses
    listJournalKinesisStreamsForLedger_maxResults,
    listJournalKinesisStreamsForLedger_nextToken,
    listJournalKinesisStreamsForLedger_ledgerName,

    -- * Destructuring the Response
    ListJournalKinesisStreamsForLedgerResponse (..),
    newListJournalKinesisStreamsForLedgerResponse,

    -- * Response Lenses
    listJournalKinesisStreamsForLedgerResponse_nextToken,
    listJournalKinesisStreamsForLedgerResponse_streams,
    listJournalKinesisStreamsForLedgerResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.QLDB.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListJournalKinesisStreamsForLedger' smart constructor.
data ListJournalKinesisStreamsForLedger = ListJournalKinesisStreamsForLedger'
  { -- | The maximum number of results to return in a single
    -- @ListJournalKinesisStreamsForLedger@ request. (The actual number of
    -- results returned might be fewer.)
    ListJournalKinesisStreamsForLedger -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A pagination token, indicating that you want to retrieve the next page
    -- of results. If you received a value for @NextToken@ in the response from
    -- a previous @ListJournalKinesisStreamsForLedger@ call, you should use
    -- that value as input here.
    ListJournalKinesisStreamsForLedger -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the ledger.
    ListJournalKinesisStreamsForLedger -> Text
ledgerName :: Prelude.Text
  }
  deriving (ListJournalKinesisStreamsForLedger
-> ListJournalKinesisStreamsForLedger -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListJournalKinesisStreamsForLedger
-> ListJournalKinesisStreamsForLedger -> Bool
$c/= :: ListJournalKinesisStreamsForLedger
-> ListJournalKinesisStreamsForLedger -> Bool
== :: ListJournalKinesisStreamsForLedger
-> ListJournalKinesisStreamsForLedger -> Bool
$c== :: ListJournalKinesisStreamsForLedger
-> ListJournalKinesisStreamsForLedger -> Bool
Prelude.Eq, ReadPrec [ListJournalKinesisStreamsForLedger]
ReadPrec ListJournalKinesisStreamsForLedger
Int -> ReadS ListJournalKinesisStreamsForLedger
ReadS [ListJournalKinesisStreamsForLedger]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListJournalKinesisStreamsForLedger]
$creadListPrec :: ReadPrec [ListJournalKinesisStreamsForLedger]
readPrec :: ReadPrec ListJournalKinesisStreamsForLedger
$creadPrec :: ReadPrec ListJournalKinesisStreamsForLedger
readList :: ReadS [ListJournalKinesisStreamsForLedger]
$creadList :: ReadS [ListJournalKinesisStreamsForLedger]
readsPrec :: Int -> ReadS ListJournalKinesisStreamsForLedger
$creadsPrec :: Int -> ReadS ListJournalKinesisStreamsForLedger
Prelude.Read, Int -> ListJournalKinesisStreamsForLedger -> ShowS
[ListJournalKinesisStreamsForLedger] -> ShowS
ListJournalKinesisStreamsForLedger -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListJournalKinesisStreamsForLedger] -> ShowS
$cshowList :: [ListJournalKinesisStreamsForLedger] -> ShowS
show :: ListJournalKinesisStreamsForLedger -> String
$cshow :: ListJournalKinesisStreamsForLedger -> String
showsPrec :: Int -> ListJournalKinesisStreamsForLedger -> ShowS
$cshowsPrec :: Int -> ListJournalKinesisStreamsForLedger -> ShowS
Prelude.Show, forall x.
Rep ListJournalKinesisStreamsForLedger x
-> ListJournalKinesisStreamsForLedger
forall x.
ListJournalKinesisStreamsForLedger
-> Rep ListJournalKinesisStreamsForLedger x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListJournalKinesisStreamsForLedger x
-> ListJournalKinesisStreamsForLedger
$cfrom :: forall x.
ListJournalKinesisStreamsForLedger
-> Rep ListJournalKinesisStreamsForLedger x
Prelude.Generic)

-- |
-- Create a value of 'ListJournalKinesisStreamsForLedger' 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:
--
-- 'maxResults', 'listJournalKinesisStreamsForLedger_maxResults' - The maximum number of results to return in a single
-- @ListJournalKinesisStreamsForLedger@ request. (The actual number of
-- results returned might be fewer.)
--
-- 'nextToken', 'listJournalKinesisStreamsForLedger_nextToken' - A pagination token, indicating that you want to retrieve the next page
-- of results. If you received a value for @NextToken@ in the response from
-- a previous @ListJournalKinesisStreamsForLedger@ call, you should use
-- that value as input here.
--
-- 'ledgerName', 'listJournalKinesisStreamsForLedger_ledgerName' - The name of the ledger.
newListJournalKinesisStreamsForLedger ::
  -- | 'ledgerName'
  Prelude.Text ->
  ListJournalKinesisStreamsForLedger
newListJournalKinesisStreamsForLedger :: Text -> ListJournalKinesisStreamsForLedger
newListJournalKinesisStreamsForLedger Text
pLedgerName_ =
  ListJournalKinesisStreamsForLedger'
    { $sel:maxResults:ListJournalKinesisStreamsForLedger' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListJournalKinesisStreamsForLedger' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:ledgerName:ListJournalKinesisStreamsForLedger' :: Text
ledgerName = Text
pLedgerName_
    }

-- | The maximum number of results to return in a single
-- @ListJournalKinesisStreamsForLedger@ request. (The actual number of
-- results returned might be fewer.)
listJournalKinesisStreamsForLedger_maxResults :: Lens.Lens' ListJournalKinesisStreamsForLedger (Prelude.Maybe Prelude.Natural)
listJournalKinesisStreamsForLedger_maxResults :: Lens' ListJournalKinesisStreamsForLedger (Maybe Natural)
listJournalKinesisStreamsForLedger_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJournalKinesisStreamsForLedger' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListJournalKinesisStreamsForLedger' :: ListJournalKinesisStreamsForLedger -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListJournalKinesisStreamsForLedger
s@ListJournalKinesisStreamsForLedger' {} Maybe Natural
a -> ListJournalKinesisStreamsForLedger
s {$sel:maxResults:ListJournalKinesisStreamsForLedger' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListJournalKinesisStreamsForLedger)

-- | A pagination token, indicating that you want to retrieve the next page
-- of results. If you received a value for @NextToken@ in the response from
-- a previous @ListJournalKinesisStreamsForLedger@ call, you should use
-- that value as input here.
listJournalKinesisStreamsForLedger_nextToken :: Lens.Lens' ListJournalKinesisStreamsForLedger (Prelude.Maybe Prelude.Text)
listJournalKinesisStreamsForLedger_nextToken :: Lens' ListJournalKinesisStreamsForLedger (Maybe Text)
listJournalKinesisStreamsForLedger_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJournalKinesisStreamsForLedger' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListJournalKinesisStreamsForLedger' :: ListJournalKinesisStreamsForLedger -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListJournalKinesisStreamsForLedger
s@ListJournalKinesisStreamsForLedger' {} Maybe Text
a -> ListJournalKinesisStreamsForLedger
s {$sel:nextToken:ListJournalKinesisStreamsForLedger' :: Maybe Text
nextToken = Maybe Text
a} :: ListJournalKinesisStreamsForLedger)

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

instance
  Core.AWSRequest
    ListJournalKinesisStreamsForLedger
  where
  type
    AWSResponse ListJournalKinesisStreamsForLedger =
      ListJournalKinesisStreamsForLedgerResponse
  request :: (Service -> Service)
-> ListJournalKinesisStreamsForLedger
-> Request ListJournalKinesisStreamsForLedger
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListJournalKinesisStreamsForLedger
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListJournalKinesisStreamsForLedger)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [JournalKinesisStreamDescription]
-> Int
-> ListJournalKinesisStreamsForLedgerResponse
ListJournalKinesisStreamsForLedgerResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Streams" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ListJournalKinesisStreamsForLedger
  where
  hashWithSalt :: Int -> ListJournalKinesisStreamsForLedger -> Int
hashWithSalt
    Int
_salt
    ListJournalKinesisStreamsForLedger' {Maybe Natural
Maybe Text
Text
ledgerName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:ledgerName:ListJournalKinesisStreamsForLedger' :: ListJournalKinesisStreamsForLedger -> Text
$sel:nextToken:ListJournalKinesisStreamsForLedger' :: ListJournalKinesisStreamsForLedger -> Maybe Text
$sel:maxResults:ListJournalKinesisStreamsForLedger' :: ListJournalKinesisStreamsForLedger -> Maybe Natural
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ledgerName

instance
  Prelude.NFData
    ListJournalKinesisStreamsForLedger
  where
  rnf :: ListJournalKinesisStreamsForLedger -> ()
rnf ListJournalKinesisStreamsForLedger' {Maybe Natural
Maybe Text
Text
ledgerName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:ledgerName:ListJournalKinesisStreamsForLedger' :: ListJournalKinesisStreamsForLedger -> Text
$sel:nextToken:ListJournalKinesisStreamsForLedger' :: ListJournalKinesisStreamsForLedger -> Maybe Text
$sel:maxResults:ListJournalKinesisStreamsForLedger' :: ListJournalKinesisStreamsForLedger -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ledgerName

instance
  Data.ToHeaders
    ListJournalKinesisStreamsForLedger
  where
  toHeaders :: ListJournalKinesisStreamsForLedger -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Data.ToPath
    ListJournalKinesisStreamsForLedger
  where
  toPath :: ListJournalKinesisStreamsForLedger -> ByteString
toPath ListJournalKinesisStreamsForLedger' {Maybe Natural
Maybe Text
Text
ledgerName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:ledgerName:ListJournalKinesisStreamsForLedger' :: ListJournalKinesisStreamsForLedger -> Text
$sel:nextToken:ListJournalKinesisStreamsForLedger' :: ListJournalKinesisStreamsForLedger -> Maybe Text
$sel:maxResults:ListJournalKinesisStreamsForLedger' :: ListJournalKinesisStreamsForLedger -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/ledgers/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
ledgerName,
        ByteString
"/journal-kinesis-streams"
      ]

instance
  Data.ToQuery
    ListJournalKinesisStreamsForLedger
  where
  toQuery :: ListJournalKinesisStreamsForLedger -> QueryString
toQuery ListJournalKinesisStreamsForLedger' {Maybe Natural
Maybe Text
Text
ledgerName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:ledgerName:ListJournalKinesisStreamsForLedger' :: ListJournalKinesisStreamsForLedger -> Text
$sel:nextToken:ListJournalKinesisStreamsForLedger' :: ListJournalKinesisStreamsForLedger -> Maybe Text
$sel:maxResults:ListJournalKinesisStreamsForLedger' :: ListJournalKinesisStreamsForLedger -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"max_results" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"next_token" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | /See:/ 'newListJournalKinesisStreamsForLedgerResponse' smart constructor.
data ListJournalKinesisStreamsForLedgerResponse = ListJournalKinesisStreamsForLedgerResponse'
  { -- | -   If @NextToken@ is empty, the last page of results has been processed
    --     and there are no more results to be retrieved.
    --
    -- -   If @NextToken@ is /not/ empty, more results are available. To
    --     retrieve the next page of results, use the value of @NextToken@ in a
    --     subsequent @ListJournalKinesisStreamsForLedger@ call.
    ListJournalKinesisStreamsForLedgerResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The array of QLDB journal stream descriptors that are associated with
    -- the given ledger.
    ListJournalKinesisStreamsForLedgerResponse
-> Maybe [JournalKinesisStreamDescription]
streams :: Prelude.Maybe [JournalKinesisStreamDescription],
    -- | The response's http status code.
    ListJournalKinesisStreamsForLedgerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListJournalKinesisStreamsForLedgerResponse
-> ListJournalKinesisStreamsForLedgerResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListJournalKinesisStreamsForLedgerResponse
-> ListJournalKinesisStreamsForLedgerResponse -> Bool
$c/= :: ListJournalKinesisStreamsForLedgerResponse
-> ListJournalKinesisStreamsForLedgerResponse -> Bool
== :: ListJournalKinesisStreamsForLedgerResponse
-> ListJournalKinesisStreamsForLedgerResponse -> Bool
$c== :: ListJournalKinesisStreamsForLedgerResponse
-> ListJournalKinesisStreamsForLedgerResponse -> Bool
Prelude.Eq, ReadPrec [ListJournalKinesisStreamsForLedgerResponse]
ReadPrec ListJournalKinesisStreamsForLedgerResponse
Int -> ReadS ListJournalKinesisStreamsForLedgerResponse
ReadS [ListJournalKinesisStreamsForLedgerResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListJournalKinesisStreamsForLedgerResponse]
$creadListPrec :: ReadPrec [ListJournalKinesisStreamsForLedgerResponse]
readPrec :: ReadPrec ListJournalKinesisStreamsForLedgerResponse
$creadPrec :: ReadPrec ListJournalKinesisStreamsForLedgerResponse
readList :: ReadS [ListJournalKinesisStreamsForLedgerResponse]
$creadList :: ReadS [ListJournalKinesisStreamsForLedgerResponse]
readsPrec :: Int -> ReadS ListJournalKinesisStreamsForLedgerResponse
$creadsPrec :: Int -> ReadS ListJournalKinesisStreamsForLedgerResponse
Prelude.Read, Int -> ListJournalKinesisStreamsForLedgerResponse -> ShowS
[ListJournalKinesisStreamsForLedgerResponse] -> ShowS
ListJournalKinesisStreamsForLedgerResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListJournalKinesisStreamsForLedgerResponse] -> ShowS
$cshowList :: [ListJournalKinesisStreamsForLedgerResponse] -> ShowS
show :: ListJournalKinesisStreamsForLedgerResponse -> String
$cshow :: ListJournalKinesisStreamsForLedgerResponse -> String
showsPrec :: Int -> ListJournalKinesisStreamsForLedgerResponse -> ShowS
$cshowsPrec :: Int -> ListJournalKinesisStreamsForLedgerResponse -> ShowS
Prelude.Show, forall x.
Rep ListJournalKinesisStreamsForLedgerResponse x
-> ListJournalKinesisStreamsForLedgerResponse
forall x.
ListJournalKinesisStreamsForLedgerResponse
-> Rep ListJournalKinesisStreamsForLedgerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListJournalKinesisStreamsForLedgerResponse x
-> ListJournalKinesisStreamsForLedgerResponse
$cfrom :: forall x.
ListJournalKinesisStreamsForLedgerResponse
-> Rep ListJournalKinesisStreamsForLedgerResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListJournalKinesisStreamsForLedgerResponse' 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:
--
-- 'nextToken', 'listJournalKinesisStreamsForLedgerResponse_nextToken' - -   If @NextToken@ is empty, the last page of results has been processed
--     and there are no more results to be retrieved.
--
-- -   If @NextToken@ is /not/ empty, more results are available. To
--     retrieve the next page of results, use the value of @NextToken@ in a
--     subsequent @ListJournalKinesisStreamsForLedger@ call.
--
-- 'streams', 'listJournalKinesisStreamsForLedgerResponse_streams' - The array of QLDB journal stream descriptors that are associated with
-- the given ledger.
--
-- 'httpStatus', 'listJournalKinesisStreamsForLedgerResponse_httpStatus' - The response's http status code.
newListJournalKinesisStreamsForLedgerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListJournalKinesisStreamsForLedgerResponse
newListJournalKinesisStreamsForLedgerResponse :: Int -> ListJournalKinesisStreamsForLedgerResponse
newListJournalKinesisStreamsForLedgerResponse
  Int
pHttpStatus_ =
    ListJournalKinesisStreamsForLedgerResponse'
      { $sel:nextToken:ListJournalKinesisStreamsForLedgerResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:streams:ListJournalKinesisStreamsForLedgerResponse' :: Maybe [JournalKinesisStreamDescription]
streams = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListJournalKinesisStreamsForLedgerResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | -   If @NextToken@ is empty, the last page of results has been processed
--     and there are no more results to be retrieved.
--
-- -   If @NextToken@ is /not/ empty, more results are available. To
--     retrieve the next page of results, use the value of @NextToken@ in a
--     subsequent @ListJournalKinesisStreamsForLedger@ call.
listJournalKinesisStreamsForLedgerResponse_nextToken :: Lens.Lens' ListJournalKinesisStreamsForLedgerResponse (Prelude.Maybe Prelude.Text)
listJournalKinesisStreamsForLedgerResponse_nextToken :: Lens' ListJournalKinesisStreamsForLedgerResponse (Maybe Text)
listJournalKinesisStreamsForLedgerResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJournalKinesisStreamsForLedgerResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListJournalKinesisStreamsForLedgerResponse' :: ListJournalKinesisStreamsForLedgerResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListJournalKinesisStreamsForLedgerResponse
s@ListJournalKinesisStreamsForLedgerResponse' {} Maybe Text
a -> ListJournalKinesisStreamsForLedgerResponse
s {$sel:nextToken:ListJournalKinesisStreamsForLedgerResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListJournalKinesisStreamsForLedgerResponse)

-- | The array of QLDB journal stream descriptors that are associated with
-- the given ledger.
listJournalKinesisStreamsForLedgerResponse_streams :: Lens.Lens' ListJournalKinesisStreamsForLedgerResponse (Prelude.Maybe [JournalKinesisStreamDescription])
listJournalKinesisStreamsForLedgerResponse_streams :: Lens'
  ListJournalKinesisStreamsForLedgerResponse
  (Maybe [JournalKinesisStreamDescription])
listJournalKinesisStreamsForLedgerResponse_streams = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJournalKinesisStreamsForLedgerResponse' {Maybe [JournalKinesisStreamDescription]
streams :: Maybe [JournalKinesisStreamDescription]
$sel:streams:ListJournalKinesisStreamsForLedgerResponse' :: ListJournalKinesisStreamsForLedgerResponse
-> Maybe [JournalKinesisStreamDescription]
streams} -> Maybe [JournalKinesisStreamDescription]
streams) (\s :: ListJournalKinesisStreamsForLedgerResponse
s@ListJournalKinesisStreamsForLedgerResponse' {} Maybe [JournalKinesisStreamDescription]
a -> ListJournalKinesisStreamsForLedgerResponse
s {$sel:streams:ListJournalKinesisStreamsForLedgerResponse' :: Maybe [JournalKinesisStreamDescription]
streams = Maybe [JournalKinesisStreamDescription]
a} :: ListJournalKinesisStreamsForLedgerResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listJournalKinesisStreamsForLedgerResponse_httpStatus :: Lens.Lens' ListJournalKinesisStreamsForLedgerResponse Prelude.Int
listJournalKinesisStreamsForLedgerResponse_httpStatus :: Lens' ListJournalKinesisStreamsForLedgerResponse Int
listJournalKinesisStreamsForLedgerResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJournalKinesisStreamsForLedgerResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListJournalKinesisStreamsForLedgerResponse' :: ListJournalKinesisStreamsForLedgerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListJournalKinesisStreamsForLedgerResponse
s@ListJournalKinesisStreamsForLedgerResponse' {} Int
a -> ListJournalKinesisStreamsForLedgerResponse
s {$sel:httpStatus:ListJournalKinesisStreamsForLedgerResponse' :: Int
httpStatus = Int
a} :: ListJournalKinesisStreamsForLedgerResponse)

instance
  Prelude.NFData
    ListJournalKinesisStreamsForLedgerResponse
  where
  rnf :: ListJournalKinesisStreamsForLedgerResponse -> ()
rnf ListJournalKinesisStreamsForLedgerResponse' {Int
Maybe [JournalKinesisStreamDescription]
Maybe Text
httpStatus :: Int
streams :: Maybe [JournalKinesisStreamDescription]
nextToken :: Maybe Text
$sel:httpStatus:ListJournalKinesisStreamsForLedgerResponse' :: ListJournalKinesisStreamsForLedgerResponse -> Int
$sel:streams:ListJournalKinesisStreamsForLedgerResponse' :: ListJournalKinesisStreamsForLedgerResponse
-> Maybe [JournalKinesisStreamDescription]
$sel:nextToken:ListJournalKinesisStreamsForLedgerResponse' :: ListJournalKinesisStreamsForLedgerResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [JournalKinesisStreamDescription]
streams
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus