{-# 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-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)
--
-- 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_nextToken,
    listJournalKinesisStreamsForLedger_maxResults,
    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.Lens as Lens
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'
  { -- | 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 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,
    -- | The name of the ledger.
    ListJournalKinesisStreamsForLedger -> Text
ledgerName :: Prelude.Text
  }
  deriving (ListJournalKinesisStreamsForLedger
-> ListJournalKinesisStreamsForLedger -> Bool
(ListJournalKinesisStreamsForLedger
 -> ListJournalKinesisStreamsForLedger -> Bool)
-> (ListJournalKinesisStreamsForLedger
    -> ListJournalKinesisStreamsForLedger -> Bool)
-> Eq ListJournalKinesisStreamsForLedger
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]
(Int -> ReadS ListJournalKinesisStreamsForLedger)
-> ReadS [ListJournalKinesisStreamsForLedger]
-> ReadPrec ListJournalKinesisStreamsForLedger
-> ReadPrec [ListJournalKinesisStreamsForLedger]
-> Read 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
(Int -> ListJournalKinesisStreamsForLedger -> ShowS)
-> (ListJournalKinesisStreamsForLedger -> String)
-> ([ListJournalKinesisStreamsForLedger] -> ShowS)
-> Show ListJournalKinesisStreamsForLedger
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.
 ListJournalKinesisStreamsForLedger
 -> Rep ListJournalKinesisStreamsForLedger x)
-> (forall x.
    Rep ListJournalKinesisStreamsForLedger x
    -> ListJournalKinesisStreamsForLedger)
-> Generic ListJournalKinesisStreamsForLedger
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:
--
-- '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.
--
-- 'maxResults', 'listJournalKinesisStreamsForLedger_maxResults' - The maximum number of results to return in a single
-- @ListJournalKinesisStreamsForLedger@ request. (The actual number of
-- results returned might be fewer.)
--
-- 'ledgerName', 'listJournalKinesisStreamsForLedger_ledgerName' - The name of the ledger.
newListJournalKinesisStreamsForLedger ::
  -- | 'ledgerName'
  Prelude.Text ->
  ListJournalKinesisStreamsForLedger
newListJournalKinesisStreamsForLedger :: Text -> ListJournalKinesisStreamsForLedger
newListJournalKinesisStreamsForLedger Text
pLedgerName_ =
  ListJournalKinesisStreamsForLedger' :: Maybe Text
-> Maybe Natural -> Text -> ListJournalKinesisStreamsForLedger
ListJournalKinesisStreamsForLedger'
    { $sel:nextToken:ListJournalKinesisStreamsForLedger' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListJournalKinesisStreamsForLedger' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:ledgerName:ListJournalKinesisStreamsForLedger' :: Text
ledgerName = Text
pLedgerName_
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ListJournalKinesisStreamsForLedger
-> f ListJournalKinesisStreamsForLedger
listJournalKinesisStreamsForLedger_nextToken = (ListJournalKinesisStreamsForLedger -> Maybe Text)
-> (ListJournalKinesisStreamsForLedger
    -> Maybe Text -> ListJournalKinesisStreamsForLedger)
-> Lens
     ListJournalKinesisStreamsForLedger
     ListJournalKinesisStreamsForLedger
     (Maybe Text)
     (Maybe Text)
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 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 :: (Maybe Natural -> f (Maybe Natural))
-> ListJournalKinesisStreamsForLedger
-> f ListJournalKinesisStreamsForLedger
listJournalKinesisStreamsForLedger_maxResults = (ListJournalKinesisStreamsForLedger -> Maybe Natural)
-> (ListJournalKinesisStreamsForLedger
    -> Maybe Natural -> ListJournalKinesisStreamsForLedger)
-> Lens
     ListJournalKinesisStreamsForLedger
     ListJournalKinesisStreamsForLedger
     (Maybe Natural)
     (Maybe Natural)
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)

-- | The name of the ledger.
listJournalKinesisStreamsForLedger_ledgerName :: Lens.Lens' ListJournalKinesisStreamsForLedger Prelude.Text
listJournalKinesisStreamsForLedger_ledgerName :: (Text -> f Text)
-> ListJournalKinesisStreamsForLedger
-> f ListJournalKinesisStreamsForLedger
listJournalKinesisStreamsForLedger_ledgerName = (ListJournalKinesisStreamsForLedger -> Text)
-> (ListJournalKinesisStreamsForLedger
    -> Text -> ListJournalKinesisStreamsForLedger)
-> Lens
     ListJournalKinesisStreamsForLedger
     ListJournalKinesisStreamsForLedger
     Text
     Text
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 :: ListJournalKinesisStreamsForLedger
-> Request ListJournalKinesisStreamsForLedger
request = Service
-> ListJournalKinesisStreamsForLedger
-> Request ListJournalKinesisStreamsForLedger
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListJournalKinesisStreamsForLedger
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListJournalKinesisStreamsForLedger)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListJournalKinesisStreamsForLedger))
-> Logger
-> Service
-> Proxy ListJournalKinesisStreamsForLedger
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListJournalKinesisStreamsForLedger)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> 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'
            (Maybe Text
 -> Maybe [JournalKinesisStreamDescription]
 -> Int
 -> ListJournalKinesisStreamsForLedgerResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [JournalKinesisStreamDescription]
      -> Int -> ListJournalKinesisStreamsForLedgerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
              Either
  String
  (Maybe [JournalKinesisStreamDescription]
   -> Int -> ListJournalKinesisStreamsForLedgerResponse)
-> Either String (Maybe [JournalKinesisStreamDescription])
-> Either
     String (Int -> ListJournalKinesisStreamsForLedgerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Either String (Maybe (Maybe [JournalKinesisStreamDescription]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Streams" Either String (Maybe (Maybe [JournalKinesisStreamDescription]))
-> Maybe [JournalKinesisStreamDescription]
-> Either String (Maybe [JournalKinesisStreamDescription])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [JournalKinesisStreamDescription]
forall a. Monoid a => a
Prelude.mempty)
              Either String (Int -> ListJournalKinesisStreamsForLedgerResponse)
-> Either String Int
-> Either String ListJournalKinesisStreamsForLedgerResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ListJournalKinesisStreamsForLedger

instance
  Prelude.NFData
    ListJournalKinesisStreamsForLedger

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

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

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

-- | /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
(ListJournalKinesisStreamsForLedgerResponse
 -> ListJournalKinesisStreamsForLedgerResponse -> Bool)
-> (ListJournalKinesisStreamsForLedgerResponse
    -> ListJournalKinesisStreamsForLedgerResponse -> Bool)
-> Eq ListJournalKinesisStreamsForLedgerResponse
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]
(Int -> ReadS ListJournalKinesisStreamsForLedgerResponse)
-> ReadS [ListJournalKinesisStreamsForLedgerResponse]
-> ReadPrec ListJournalKinesisStreamsForLedgerResponse
-> ReadPrec [ListJournalKinesisStreamsForLedgerResponse]
-> Read 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
(Int -> ListJournalKinesisStreamsForLedgerResponse -> ShowS)
-> (ListJournalKinesisStreamsForLedgerResponse -> String)
-> ([ListJournalKinesisStreamsForLedgerResponse] -> ShowS)
-> Show ListJournalKinesisStreamsForLedgerResponse
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.
 ListJournalKinesisStreamsForLedgerResponse
 -> Rep ListJournalKinesisStreamsForLedgerResponse x)
-> (forall x.
    Rep ListJournalKinesisStreamsForLedgerResponse x
    -> ListJournalKinesisStreamsForLedgerResponse)
-> Generic ListJournalKinesisStreamsForLedgerResponse
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' :: Maybe Text
-> Maybe [JournalKinesisStreamDescription]
-> Int
-> ListJournalKinesisStreamsForLedgerResponse
ListJournalKinesisStreamsForLedgerResponse'
      { $sel:nextToken:ListJournalKinesisStreamsForLedgerResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:streams:ListJournalKinesisStreamsForLedgerResponse' :: Maybe [JournalKinesisStreamDescription]
streams = Maybe [JournalKinesisStreamDescription]
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 :: (Maybe Text -> f (Maybe Text))
-> ListJournalKinesisStreamsForLedgerResponse
-> f ListJournalKinesisStreamsForLedgerResponse
listJournalKinesisStreamsForLedgerResponse_nextToken = (ListJournalKinesisStreamsForLedgerResponse -> Maybe Text)
-> (ListJournalKinesisStreamsForLedgerResponse
    -> Maybe Text -> ListJournalKinesisStreamsForLedgerResponse)
-> Lens
     ListJournalKinesisStreamsForLedgerResponse
     ListJournalKinesisStreamsForLedgerResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe [JournalKinesisStreamDescription]
 -> f (Maybe [JournalKinesisStreamDescription]))
-> ListJournalKinesisStreamsForLedgerResponse
-> f ListJournalKinesisStreamsForLedgerResponse
listJournalKinesisStreamsForLedgerResponse_streams = (ListJournalKinesisStreamsForLedgerResponse
 -> Maybe [JournalKinesisStreamDescription])
-> (ListJournalKinesisStreamsForLedgerResponse
    -> Maybe [JournalKinesisStreamDescription]
    -> ListJournalKinesisStreamsForLedgerResponse)
-> Lens
     ListJournalKinesisStreamsForLedgerResponse
     ListJournalKinesisStreamsForLedgerResponse
     (Maybe [JournalKinesisStreamDescription])
     (Maybe [JournalKinesisStreamDescription])
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) ((Maybe [JournalKinesisStreamDescription]
  -> f (Maybe [JournalKinesisStreamDescription]))
 -> ListJournalKinesisStreamsForLedgerResponse
 -> f ListJournalKinesisStreamsForLedgerResponse)
-> ((Maybe [JournalKinesisStreamDescription]
     -> f (Maybe [JournalKinesisStreamDescription]))
    -> Maybe [JournalKinesisStreamDescription]
    -> f (Maybe [JournalKinesisStreamDescription]))
-> (Maybe [JournalKinesisStreamDescription]
    -> f (Maybe [JournalKinesisStreamDescription]))
-> ListJournalKinesisStreamsForLedgerResponse
-> f ListJournalKinesisStreamsForLedgerResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [JournalKinesisStreamDescription]
  [JournalKinesisStreamDescription]
  [JournalKinesisStreamDescription]
  [JournalKinesisStreamDescription]
-> Iso
     (Maybe [JournalKinesisStreamDescription])
     (Maybe [JournalKinesisStreamDescription])
     (Maybe [JournalKinesisStreamDescription])
     (Maybe [JournalKinesisStreamDescription])
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
  [JournalKinesisStreamDescription]
  [JournalKinesisStreamDescription]
  [JournalKinesisStreamDescription]
  [JournalKinesisStreamDescription]
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 :: (Int -> f Int)
-> ListJournalKinesisStreamsForLedgerResponse
-> f ListJournalKinesisStreamsForLedgerResponse
listJournalKinesisStreamsForLedgerResponse_httpStatus = (ListJournalKinesisStreamsForLedgerResponse -> Int)
-> (ListJournalKinesisStreamsForLedgerResponse
    -> Int -> ListJournalKinesisStreamsForLedgerResponse)
-> Lens
     ListJournalKinesisStreamsForLedgerResponse
     ListJournalKinesisStreamsForLedgerResponse
     Int
     Int
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