{-# 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.ListJournalS3ExportsForLedger
-- 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 journal export job descriptions for a specified
-- ledger.
--
-- This action returns a maximum of @MaxResults@ items, and is paginated so
-- that you can retrieve all the items by calling
-- @ListJournalS3ExportsForLedger@ multiple times.
--
-- This action does not return any expired export jobs. For more
-- information, see
-- <https://docs.aws.amazon.com/qldb/latest/developerguide/export-journal.request.html#export-journal.request.expiration Export job expiration>
-- in the /Amazon QLDB Developer Guide/.
module Amazonka.QLDB.ListJournalS3ExportsForLedger
  ( -- * Creating a Request
    ListJournalS3ExportsForLedger (..),
    newListJournalS3ExportsForLedger,

    -- * Request Lenses
    listJournalS3ExportsForLedger_nextToken,
    listJournalS3ExportsForLedger_maxResults,
    listJournalS3ExportsForLedger_name,

    -- * Destructuring the Response
    ListJournalS3ExportsForLedgerResponse (..),
    newListJournalS3ExportsForLedgerResponse,

    -- * Response Lenses
    listJournalS3ExportsForLedgerResponse_journalS3Exports,
    listJournalS3ExportsForLedgerResponse_nextToken,
    listJournalS3ExportsForLedgerResponse_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:/ 'newListJournalS3ExportsForLedger' smart constructor.
data ListJournalS3ExportsForLedger = ListJournalS3ExportsForLedger'
  { -- | 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 @ListJournalS3ExportsForLedger@ call, then you should use
    -- that value as input here.
    ListJournalS3ExportsForLedger -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in a single
    -- @ListJournalS3ExportsForLedger@ request. (The actual number of results
    -- returned might be fewer.)
    ListJournalS3ExportsForLedger -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the ledger.
    ListJournalS3ExportsForLedger -> Text
name :: Prelude.Text
  }
  deriving (ListJournalS3ExportsForLedger
-> ListJournalS3ExportsForLedger -> Bool
(ListJournalS3ExportsForLedger
 -> ListJournalS3ExportsForLedger -> Bool)
-> (ListJournalS3ExportsForLedger
    -> ListJournalS3ExportsForLedger -> Bool)
-> Eq ListJournalS3ExportsForLedger
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListJournalS3ExportsForLedger
-> ListJournalS3ExportsForLedger -> Bool
$c/= :: ListJournalS3ExportsForLedger
-> ListJournalS3ExportsForLedger -> Bool
== :: ListJournalS3ExportsForLedger
-> ListJournalS3ExportsForLedger -> Bool
$c== :: ListJournalS3ExportsForLedger
-> ListJournalS3ExportsForLedger -> Bool
Prelude.Eq, ReadPrec [ListJournalS3ExportsForLedger]
ReadPrec ListJournalS3ExportsForLedger
Int -> ReadS ListJournalS3ExportsForLedger
ReadS [ListJournalS3ExportsForLedger]
(Int -> ReadS ListJournalS3ExportsForLedger)
-> ReadS [ListJournalS3ExportsForLedger]
-> ReadPrec ListJournalS3ExportsForLedger
-> ReadPrec [ListJournalS3ExportsForLedger]
-> Read ListJournalS3ExportsForLedger
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListJournalS3ExportsForLedger]
$creadListPrec :: ReadPrec [ListJournalS3ExportsForLedger]
readPrec :: ReadPrec ListJournalS3ExportsForLedger
$creadPrec :: ReadPrec ListJournalS3ExportsForLedger
readList :: ReadS [ListJournalS3ExportsForLedger]
$creadList :: ReadS [ListJournalS3ExportsForLedger]
readsPrec :: Int -> ReadS ListJournalS3ExportsForLedger
$creadsPrec :: Int -> ReadS ListJournalS3ExportsForLedger
Prelude.Read, Int -> ListJournalS3ExportsForLedger -> ShowS
[ListJournalS3ExportsForLedger] -> ShowS
ListJournalS3ExportsForLedger -> String
(Int -> ListJournalS3ExportsForLedger -> ShowS)
-> (ListJournalS3ExportsForLedger -> String)
-> ([ListJournalS3ExportsForLedger] -> ShowS)
-> Show ListJournalS3ExportsForLedger
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListJournalS3ExportsForLedger] -> ShowS
$cshowList :: [ListJournalS3ExportsForLedger] -> ShowS
show :: ListJournalS3ExportsForLedger -> String
$cshow :: ListJournalS3ExportsForLedger -> String
showsPrec :: Int -> ListJournalS3ExportsForLedger -> ShowS
$cshowsPrec :: Int -> ListJournalS3ExportsForLedger -> ShowS
Prelude.Show, (forall x.
 ListJournalS3ExportsForLedger
 -> Rep ListJournalS3ExportsForLedger x)
-> (forall x.
    Rep ListJournalS3ExportsForLedger x
    -> ListJournalS3ExportsForLedger)
-> Generic ListJournalS3ExportsForLedger
forall x.
Rep ListJournalS3ExportsForLedger x
-> ListJournalS3ExportsForLedger
forall x.
ListJournalS3ExportsForLedger
-> Rep ListJournalS3ExportsForLedger x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListJournalS3ExportsForLedger x
-> ListJournalS3ExportsForLedger
$cfrom :: forall x.
ListJournalS3ExportsForLedger
-> Rep ListJournalS3ExportsForLedger x
Prelude.Generic)

-- |
-- Create a value of 'ListJournalS3ExportsForLedger' 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', 'listJournalS3ExportsForLedger_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 @ListJournalS3ExportsForLedger@ call, then you should use
-- that value as input here.
--
-- 'maxResults', 'listJournalS3ExportsForLedger_maxResults' - The maximum number of results to return in a single
-- @ListJournalS3ExportsForLedger@ request. (The actual number of results
-- returned might be fewer.)
--
-- 'name', 'listJournalS3ExportsForLedger_name' - The name of the ledger.
newListJournalS3ExportsForLedger ::
  -- | 'name'
  Prelude.Text ->
  ListJournalS3ExportsForLedger
newListJournalS3ExportsForLedger :: Text -> ListJournalS3ExportsForLedger
newListJournalS3ExportsForLedger Text
pName_ =
  ListJournalS3ExportsForLedger' :: Maybe Text
-> Maybe Natural -> Text -> ListJournalS3ExportsForLedger
ListJournalS3ExportsForLedger'
    { $sel:nextToken:ListJournalS3ExportsForLedger' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListJournalS3ExportsForLedger' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ListJournalS3ExportsForLedger' :: Text
name = Text
pName_
    }

-- | 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 @ListJournalS3ExportsForLedger@ call, then you should use
-- that value as input here.
listJournalS3ExportsForLedger_nextToken :: Lens.Lens' ListJournalS3ExportsForLedger (Prelude.Maybe Prelude.Text)
listJournalS3ExportsForLedger_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListJournalS3ExportsForLedger -> f ListJournalS3ExportsForLedger
listJournalS3ExportsForLedger_nextToken = (ListJournalS3ExportsForLedger -> Maybe Text)
-> (ListJournalS3ExportsForLedger
    -> Maybe Text -> ListJournalS3ExportsForLedger)
-> Lens
     ListJournalS3ExportsForLedger
     ListJournalS3ExportsForLedger
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJournalS3ExportsForLedger' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListJournalS3ExportsForLedger' :: ListJournalS3ExportsForLedger -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListJournalS3ExportsForLedger
s@ListJournalS3ExportsForLedger' {} Maybe Text
a -> ListJournalS3ExportsForLedger
s {$sel:nextToken:ListJournalS3ExportsForLedger' :: Maybe Text
nextToken = Maybe Text
a} :: ListJournalS3ExportsForLedger)

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

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

instance
  Core.AWSRequest
    ListJournalS3ExportsForLedger
  where
  type
    AWSResponse ListJournalS3ExportsForLedger =
      ListJournalS3ExportsForLedgerResponse
  request :: ListJournalS3ExportsForLedger
-> Request ListJournalS3ExportsForLedger
request = Service
-> ListJournalS3ExportsForLedger
-> Request ListJournalS3ExportsForLedger
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListJournalS3ExportsForLedger
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListJournalS3ExportsForLedger)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListJournalS3ExportsForLedger))
-> Logger
-> Service
-> Proxy ListJournalS3ExportsForLedger
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListJournalS3ExportsForLedger)))
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 [JournalS3ExportDescription]
-> Maybe Text -> Int -> ListJournalS3ExportsForLedgerResponse
ListJournalS3ExportsForLedgerResponse'
            (Maybe [JournalS3ExportDescription]
 -> Maybe Text -> Int -> ListJournalS3ExportsForLedgerResponse)
-> Either String (Maybe [JournalS3ExportDescription])
-> Either
     String (Maybe Text -> Int -> ListJournalS3ExportsForLedgerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [JournalS3ExportDescription]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"JournalS3Exports"
                            Either String (Maybe (Maybe [JournalS3ExportDescription]))
-> Maybe [JournalS3ExportDescription]
-> Either String (Maybe [JournalS3ExportDescription])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [JournalS3ExportDescription]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String (Maybe Text -> Int -> ListJournalS3ExportsForLedgerResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListJournalS3ExportsForLedgerResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Int -> ListJournalS3ExportsForLedgerResponse)
-> Either String Int
-> Either String ListJournalS3ExportsForLedgerResponse
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
    ListJournalS3ExportsForLedger

instance Prelude.NFData ListJournalS3ExportsForLedger

instance Core.ToHeaders ListJournalS3ExportsForLedger where
  toHeaders :: ListJournalS3ExportsForLedger -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListJournalS3ExportsForLedger -> 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 ListJournalS3ExportsForLedger where
  toPath :: ListJournalS3ExportsForLedger -> ByteString
toPath ListJournalS3ExportsForLedger' {Maybe Natural
Maybe Text
Text
name :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:name:ListJournalS3ExportsForLedger' :: ListJournalS3ExportsForLedger -> Text
$sel:maxResults:ListJournalS3ExportsForLedger' :: ListJournalS3ExportsForLedger -> Maybe Natural
$sel:nextToken:ListJournalS3ExportsForLedger' :: ListJournalS3ExportsForLedger -> 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
name, ByteString
"/journal-s3-exports"]

instance Core.ToQuery ListJournalS3ExportsForLedger where
  toQuery :: ListJournalS3ExportsForLedger -> QueryString
toQuery ListJournalS3ExportsForLedger' {Maybe Natural
Maybe Text
Text
name :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:name:ListJournalS3ExportsForLedger' :: ListJournalS3ExportsForLedger -> Text
$sel:maxResults:ListJournalS3ExportsForLedger' :: ListJournalS3ExportsForLedger -> Maybe Natural
$sel:nextToken:ListJournalS3ExportsForLedger' :: ListJournalS3ExportsForLedger -> 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:/ 'newListJournalS3ExportsForLedgerResponse' smart constructor.
data ListJournalS3ExportsForLedgerResponse = ListJournalS3ExportsForLedgerResponse'
  { -- | The array of journal export job descriptions that are associated with
    -- the specified ledger.
    ListJournalS3ExportsForLedgerResponse
-> Maybe [JournalS3ExportDescription]
journalS3Exports :: Prelude.Maybe [JournalS3ExportDescription],
    -- | -   If @NextToken@ is empty, then the last page of results has been
    --     processed and there are no more results to be retrieved.
    --
    -- -   If @NextToken@ is /not/ empty, then there are more results
    --     available. To retrieve the next page of results, use the value of
    --     @NextToken@ in a subsequent @ListJournalS3ExportsForLedger@ call.
    ListJournalS3ExportsForLedgerResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListJournalS3ExportsForLedgerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListJournalS3ExportsForLedgerResponse
-> ListJournalS3ExportsForLedgerResponse -> Bool
(ListJournalS3ExportsForLedgerResponse
 -> ListJournalS3ExportsForLedgerResponse -> Bool)
-> (ListJournalS3ExportsForLedgerResponse
    -> ListJournalS3ExportsForLedgerResponse -> Bool)
-> Eq ListJournalS3ExportsForLedgerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListJournalS3ExportsForLedgerResponse
-> ListJournalS3ExportsForLedgerResponse -> Bool
$c/= :: ListJournalS3ExportsForLedgerResponse
-> ListJournalS3ExportsForLedgerResponse -> Bool
== :: ListJournalS3ExportsForLedgerResponse
-> ListJournalS3ExportsForLedgerResponse -> Bool
$c== :: ListJournalS3ExportsForLedgerResponse
-> ListJournalS3ExportsForLedgerResponse -> Bool
Prelude.Eq, ReadPrec [ListJournalS3ExportsForLedgerResponse]
ReadPrec ListJournalS3ExportsForLedgerResponse
Int -> ReadS ListJournalS3ExportsForLedgerResponse
ReadS [ListJournalS3ExportsForLedgerResponse]
(Int -> ReadS ListJournalS3ExportsForLedgerResponse)
-> ReadS [ListJournalS3ExportsForLedgerResponse]
-> ReadPrec ListJournalS3ExportsForLedgerResponse
-> ReadPrec [ListJournalS3ExportsForLedgerResponse]
-> Read ListJournalS3ExportsForLedgerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListJournalS3ExportsForLedgerResponse]
$creadListPrec :: ReadPrec [ListJournalS3ExportsForLedgerResponse]
readPrec :: ReadPrec ListJournalS3ExportsForLedgerResponse
$creadPrec :: ReadPrec ListJournalS3ExportsForLedgerResponse
readList :: ReadS [ListJournalS3ExportsForLedgerResponse]
$creadList :: ReadS [ListJournalS3ExportsForLedgerResponse]
readsPrec :: Int -> ReadS ListJournalS3ExportsForLedgerResponse
$creadsPrec :: Int -> ReadS ListJournalS3ExportsForLedgerResponse
Prelude.Read, Int -> ListJournalS3ExportsForLedgerResponse -> ShowS
[ListJournalS3ExportsForLedgerResponse] -> ShowS
ListJournalS3ExportsForLedgerResponse -> String
(Int -> ListJournalS3ExportsForLedgerResponse -> ShowS)
-> (ListJournalS3ExportsForLedgerResponse -> String)
-> ([ListJournalS3ExportsForLedgerResponse] -> ShowS)
-> Show ListJournalS3ExportsForLedgerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListJournalS3ExportsForLedgerResponse] -> ShowS
$cshowList :: [ListJournalS3ExportsForLedgerResponse] -> ShowS
show :: ListJournalS3ExportsForLedgerResponse -> String
$cshow :: ListJournalS3ExportsForLedgerResponse -> String
showsPrec :: Int -> ListJournalS3ExportsForLedgerResponse -> ShowS
$cshowsPrec :: Int -> ListJournalS3ExportsForLedgerResponse -> ShowS
Prelude.Show, (forall x.
 ListJournalS3ExportsForLedgerResponse
 -> Rep ListJournalS3ExportsForLedgerResponse x)
-> (forall x.
    Rep ListJournalS3ExportsForLedgerResponse x
    -> ListJournalS3ExportsForLedgerResponse)
-> Generic ListJournalS3ExportsForLedgerResponse
forall x.
Rep ListJournalS3ExportsForLedgerResponse x
-> ListJournalS3ExportsForLedgerResponse
forall x.
ListJournalS3ExportsForLedgerResponse
-> Rep ListJournalS3ExportsForLedgerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListJournalS3ExportsForLedgerResponse x
-> ListJournalS3ExportsForLedgerResponse
$cfrom :: forall x.
ListJournalS3ExportsForLedgerResponse
-> Rep ListJournalS3ExportsForLedgerResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListJournalS3ExportsForLedgerResponse' 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:
--
-- 'journalS3Exports', 'listJournalS3ExportsForLedgerResponse_journalS3Exports' - The array of journal export job descriptions that are associated with
-- the specified ledger.
--
-- 'nextToken', 'listJournalS3ExportsForLedgerResponse_nextToken' - -   If @NextToken@ is empty, then the last page of results has been
--     processed and there are no more results to be retrieved.
--
-- -   If @NextToken@ is /not/ empty, then there are more results
--     available. To retrieve the next page of results, use the value of
--     @NextToken@ in a subsequent @ListJournalS3ExportsForLedger@ call.
--
-- 'httpStatus', 'listJournalS3ExportsForLedgerResponse_httpStatus' - The response's http status code.
newListJournalS3ExportsForLedgerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListJournalS3ExportsForLedgerResponse
newListJournalS3ExportsForLedgerResponse :: Int -> ListJournalS3ExportsForLedgerResponse
newListJournalS3ExportsForLedgerResponse Int
pHttpStatus_ =
  ListJournalS3ExportsForLedgerResponse' :: Maybe [JournalS3ExportDescription]
-> Maybe Text -> Int -> ListJournalS3ExportsForLedgerResponse
ListJournalS3ExportsForLedgerResponse'
    { $sel:journalS3Exports:ListJournalS3ExportsForLedgerResponse' :: Maybe [JournalS3ExportDescription]
journalS3Exports =
        Maybe [JournalS3ExportDescription]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListJournalS3ExportsForLedgerResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListJournalS3ExportsForLedgerResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The array of journal export job descriptions that are associated with
-- the specified ledger.
listJournalS3ExportsForLedgerResponse_journalS3Exports :: Lens.Lens' ListJournalS3ExportsForLedgerResponse (Prelude.Maybe [JournalS3ExportDescription])
listJournalS3ExportsForLedgerResponse_journalS3Exports :: (Maybe [JournalS3ExportDescription]
 -> f (Maybe [JournalS3ExportDescription]))
-> ListJournalS3ExportsForLedgerResponse
-> f ListJournalS3ExportsForLedgerResponse
listJournalS3ExportsForLedgerResponse_journalS3Exports = (ListJournalS3ExportsForLedgerResponse
 -> Maybe [JournalS3ExportDescription])
-> (ListJournalS3ExportsForLedgerResponse
    -> Maybe [JournalS3ExportDescription]
    -> ListJournalS3ExportsForLedgerResponse)
-> Lens
     ListJournalS3ExportsForLedgerResponse
     ListJournalS3ExportsForLedgerResponse
     (Maybe [JournalS3ExportDescription])
     (Maybe [JournalS3ExportDescription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJournalS3ExportsForLedgerResponse' {Maybe [JournalS3ExportDescription]
journalS3Exports :: Maybe [JournalS3ExportDescription]
$sel:journalS3Exports:ListJournalS3ExportsForLedgerResponse' :: ListJournalS3ExportsForLedgerResponse
-> Maybe [JournalS3ExportDescription]
journalS3Exports} -> Maybe [JournalS3ExportDescription]
journalS3Exports) (\s :: ListJournalS3ExportsForLedgerResponse
s@ListJournalS3ExportsForLedgerResponse' {} Maybe [JournalS3ExportDescription]
a -> ListJournalS3ExportsForLedgerResponse
s {$sel:journalS3Exports:ListJournalS3ExportsForLedgerResponse' :: Maybe [JournalS3ExportDescription]
journalS3Exports = Maybe [JournalS3ExportDescription]
a} :: ListJournalS3ExportsForLedgerResponse) ((Maybe [JournalS3ExportDescription]
  -> f (Maybe [JournalS3ExportDescription]))
 -> ListJournalS3ExportsForLedgerResponse
 -> f ListJournalS3ExportsForLedgerResponse)
-> ((Maybe [JournalS3ExportDescription]
     -> f (Maybe [JournalS3ExportDescription]))
    -> Maybe [JournalS3ExportDescription]
    -> f (Maybe [JournalS3ExportDescription]))
-> (Maybe [JournalS3ExportDescription]
    -> f (Maybe [JournalS3ExportDescription]))
-> ListJournalS3ExportsForLedgerResponse
-> f ListJournalS3ExportsForLedgerResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [JournalS3ExportDescription]
  [JournalS3ExportDescription]
  [JournalS3ExportDescription]
  [JournalS3ExportDescription]
-> Iso
     (Maybe [JournalS3ExportDescription])
     (Maybe [JournalS3ExportDescription])
     (Maybe [JournalS3ExportDescription])
     (Maybe [JournalS3ExportDescription])
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
  [JournalS3ExportDescription]
  [JournalS3ExportDescription]
  [JournalS3ExportDescription]
  [JournalS3ExportDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance
  Prelude.NFData
    ListJournalS3ExportsForLedgerResponse