{-# 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.CodeBuild.ListReports
-- 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 a list of ARNs for the reports in the current Amazon Web
-- Services account.
--
-- This operation returns paginated results.
module Amazonka.CodeBuild.ListReports
  ( -- * Creating a Request
    ListReports (..),
    newListReports,

    -- * Request Lenses
    listReports_filter,
    listReports_maxResults,
    listReports_nextToken,
    listReports_sortOrder,

    -- * Destructuring the Response
    ListReportsResponse (..),
    newListReportsResponse,

    -- * Response Lenses
    listReportsResponse_nextToken,
    listReportsResponse_reports,
    listReportsResponse_httpStatus,
  )
where

import Amazonka.CodeBuild.Types
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListReports' smart constructor.
data ListReports = ListReports'
  { -- | A @ReportFilter@ object used to filter the returned reports.
    ListReports -> Maybe ReportFilter
filter' :: Prelude.Maybe ReportFilter,
    -- | The maximum number of paginated reports returned per response. Use
    -- @nextToken@ to iterate pages in the list of returned @Report@ objects.
    -- The default value is 100.
    ListReports -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | During a previous call, the maximum number of items that can be returned
    -- is the value specified in @maxResults@. If there more items in the list,
    -- then a unique string called a /nextToken/ is returned. To get the next
    -- batch of items in the list, call this operation again, adding the next
    -- token to the call. To get all of the items in the list, keep calling
    -- this operation with each subsequent next token that is returned, until
    -- no more next tokens are returned.
    ListReports -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specifies the sort order for the list of returned reports. Valid values
    -- are:
    --
    -- -   @ASCENDING@: return reports in chronological order based on their
    --     creation date.
    --
    -- -   @DESCENDING@: return reports in the reverse chronological order
    --     based on their creation date.
    ListReports -> Maybe SortOrderType
sortOrder :: Prelude.Maybe SortOrderType
  }
  deriving (ListReports -> ListReports -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListReports -> ListReports -> Bool
$c/= :: ListReports -> ListReports -> Bool
== :: ListReports -> ListReports -> Bool
$c== :: ListReports -> ListReports -> Bool
Prelude.Eq, ReadPrec [ListReports]
ReadPrec ListReports
Int -> ReadS ListReports
ReadS [ListReports]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListReports]
$creadListPrec :: ReadPrec [ListReports]
readPrec :: ReadPrec ListReports
$creadPrec :: ReadPrec ListReports
readList :: ReadS [ListReports]
$creadList :: ReadS [ListReports]
readsPrec :: Int -> ReadS ListReports
$creadsPrec :: Int -> ReadS ListReports
Prelude.Read, Int -> ListReports -> ShowS
[ListReports] -> ShowS
ListReports -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListReports] -> ShowS
$cshowList :: [ListReports] -> ShowS
show :: ListReports -> String
$cshow :: ListReports -> String
showsPrec :: Int -> ListReports -> ShowS
$cshowsPrec :: Int -> ListReports -> ShowS
Prelude.Show, forall x. Rep ListReports x -> ListReports
forall x. ListReports -> Rep ListReports x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListReports x -> ListReports
$cfrom :: forall x. ListReports -> Rep ListReports x
Prelude.Generic)

-- |
-- Create a value of 'ListReports' 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:
--
-- 'filter'', 'listReports_filter' - A @ReportFilter@ object used to filter the returned reports.
--
-- 'maxResults', 'listReports_maxResults' - The maximum number of paginated reports returned per response. Use
-- @nextToken@ to iterate pages in the list of returned @Report@ objects.
-- The default value is 100.
--
-- 'nextToken', 'listReports_nextToken' - During a previous call, the maximum number of items that can be returned
-- is the value specified in @maxResults@. If there more items in the list,
-- then a unique string called a /nextToken/ is returned. To get the next
-- batch of items in the list, call this operation again, adding the next
-- token to the call. To get all of the items in the list, keep calling
-- this operation with each subsequent next token that is returned, until
-- no more next tokens are returned.
--
-- 'sortOrder', 'listReports_sortOrder' - Specifies the sort order for the list of returned reports. Valid values
-- are:
--
-- -   @ASCENDING@: return reports in chronological order based on their
--     creation date.
--
-- -   @DESCENDING@: return reports in the reverse chronological order
--     based on their creation date.
newListReports ::
  ListReports
newListReports :: ListReports
newListReports =
  ListReports'
    { $sel:filter':ListReports' :: Maybe ReportFilter
filter' = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListReports' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListReports' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListReports' :: Maybe SortOrderType
sortOrder = forall a. Maybe a
Prelude.Nothing
    }

-- | A @ReportFilter@ object used to filter the returned reports.
listReports_filter :: Lens.Lens' ListReports (Prelude.Maybe ReportFilter)
listReports_filter :: Lens' ListReports (Maybe ReportFilter)
listReports_filter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReports' {Maybe ReportFilter
filter' :: Maybe ReportFilter
$sel:filter':ListReports' :: ListReports -> Maybe ReportFilter
filter'} -> Maybe ReportFilter
filter') (\s :: ListReports
s@ListReports' {} Maybe ReportFilter
a -> ListReports
s {$sel:filter':ListReports' :: Maybe ReportFilter
filter' = Maybe ReportFilter
a} :: ListReports)

-- | The maximum number of paginated reports returned per response. Use
-- @nextToken@ to iterate pages in the list of returned @Report@ objects.
-- The default value is 100.
listReports_maxResults :: Lens.Lens' ListReports (Prelude.Maybe Prelude.Natural)
listReports_maxResults :: Lens' ListReports (Maybe Natural)
listReports_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReports' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListReports' :: ListReports -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListReports
s@ListReports' {} Maybe Natural
a -> ListReports
s {$sel:maxResults:ListReports' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListReports)

-- | During a previous call, the maximum number of items that can be returned
-- is the value specified in @maxResults@. If there more items in the list,
-- then a unique string called a /nextToken/ is returned. To get the next
-- batch of items in the list, call this operation again, adding the next
-- token to the call. To get all of the items in the list, keep calling
-- this operation with each subsequent next token that is returned, until
-- no more next tokens are returned.
listReports_nextToken :: Lens.Lens' ListReports (Prelude.Maybe Prelude.Text)
listReports_nextToken :: Lens' ListReports (Maybe Text)
listReports_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReports' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListReports' :: ListReports -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListReports
s@ListReports' {} Maybe Text
a -> ListReports
s {$sel:nextToken:ListReports' :: Maybe Text
nextToken = Maybe Text
a} :: ListReports)

-- | Specifies the sort order for the list of returned reports. Valid values
-- are:
--
-- -   @ASCENDING@: return reports in chronological order based on their
--     creation date.
--
-- -   @DESCENDING@: return reports in the reverse chronological order
--     based on their creation date.
listReports_sortOrder :: Lens.Lens' ListReports (Prelude.Maybe SortOrderType)
listReports_sortOrder :: Lens' ListReports (Maybe SortOrderType)
listReports_sortOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReports' {Maybe SortOrderType
sortOrder :: Maybe SortOrderType
$sel:sortOrder:ListReports' :: ListReports -> Maybe SortOrderType
sortOrder} -> Maybe SortOrderType
sortOrder) (\s :: ListReports
s@ListReports' {} Maybe SortOrderType
a -> ListReports
s {$sel:sortOrder:ListReports' :: Maybe SortOrderType
sortOrder = Maybe SortOrderType
a} :: ListReports)

instance Core.AWSPager ListReports where
  page :: ListReports -> AWSResponse ListReports -> Maybe ListReports
page ListReports
rq AWSResponse ListReports
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListReports
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListReportsResponse (Maybe Text)
listReportsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListReports
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListReportsResponse (Maybe (NonEmpty Text))
listReportsResponse_reports
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to forall l. IsList l => l -> [Item l]
Prelude.toList
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListReports
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListReports (Maybe Text)
listReports_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListReports
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListReportsResponse (Maybe Text)
listReportsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListReports where
  type AWSResponse ListReports = ListReportsResponse
  request :: (Service -> Service) -> ListReports -> Request ListReports
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListReports
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListReports)))
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 (NonEmpty Text) -> Int -> ListReportsResponse
ListReportsResponse'
            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
"reports")
            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 ListReports where
  hashWithSalt :: Int -> ListReports -> Int
hashWithSalt Int
_salt ListReports' {Maybe Natural
Maybe Text
Maybe ReportFilter
Maybe SortOrderType
sortOrder :: Maybe SortOrderType
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe ReportFilter
$sel:sortOrder:ListReports' :: ListReports -> Maybe SortOrderType
$sel:nextToken:ListReports' :: ListReports -> Maybe Text
$sel:maxResults:ListReports' :: ListReports -> Maybe Natural
$sel:filter':ListReports' :: ListReports -> Maybe ReportFilter
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReportFilter
filter'
      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` Maybe SortOrderType
sortOrder

instance Prelude.NFData ListReports where
  rnf :: ListReports -> ()
rnf ListReports' {Maybe Natural
Maybe Text
Maybe ReportFilter
Maybe SortOrderType
sortOrder :: Maybe SortOrderType
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe ReportFilter
$sel:sortOrder:ListReports' :: ListReports -> Maybe SortOrderType
$sel:nextToken:ListReports' :: ListReports -> Maybe Text
$sel:maxResults:ListReports' :: ListReports -> Maybe Natural
$sel:filter':ListReports' :: ListReports -> Maybe ReportFilter
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ReportFilter
filter'
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Maybe SortOrderType
sortOrder

instance Data.ToHeaders ListReports where
  toHeaders :: ListReports -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"CodeBuild_20161006.ListReports" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListReports where
  toJSON :: ListReports -> Value
toJSON ListReports' {Maybe Natural
Maybe Text
Maybe ReportFilter
Maybe SortOrderType
sortOrder :: Maybe SortOrderType
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe ReportFilter
$sel:sortOrder:ListReports' :: ListReports -> Maybe SortOrderType
$sel:nextToken:ListReports' :: ListReports -> Maybe Text
$sel:maxResults:ListReports' :: ListReports -> Maybe Natural
$sel:filter':ListReports' :: ListReports -> Maybe ReportFilter
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"filter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReportFilter
filter',
            (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"sortOrder" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortOrderType
sortOrder
          ]
      )

instance Data.ToPath ListReports where
  toPath :: ListReports -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery ListReports where
  toQuery :: ListReports -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListReportsResponse' smart constructor.
data ListReportsResponse = ListReportsResponse'
  { -- | During a previous call, the maximum number of items that can be returned
    -- is the value specified in @maxResults@. If there more items in the list,
    -- then a unique string called a /nextToken/ is returned. To get the next
    -- batch of items in the list, call this operation again, adding the next
    -- token to the call. To get all of the items in the list, keep calling
    -- this operation with each subsequent next token that is returned, until
    -- no more next tokens are returned.
    ListReportsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of returned ARNs for the reports in the current Amazon Web
    -- Services account.
    ListReportsResponse -> Maybe (NonEmpty Text)
reports :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The response's http status code.
    ListReportsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListReportsResponse -> ListReportsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListReportsResponse -> ListReportsResponse -> Bool
$c/= :: ListReportsResponse -> ListReportsResponse -> Bool
== :: ListReportsResponse -> ListReportsResponse -> Bool
$c== :: ListReportsResponse -> ListReportsResponse -> Bool
Prelude.Eq, ReadPrec [ListReportsResponse]
ReadPrec ListReportsResponse
Int -> ReadS ListReportsResponse
ReadS [ListReportsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListReportsResponse]
$creadListPrec :: ReadPrec [ListReportsResponse]
readPrec :: ReadPrec ListReportsResponse
$creadPrec :: ReadPrec ListReportsResponse
readList :: ReadS [ListReportsResponse]
$creadList :: ReadS [ListReportsResponse]
readsPrec :: Int -> ReadS ListReportsResponse
$creadsPrec :: Int -> ReadS ListReportsResponse
Prelude.Read, Int -> ListReportsResponse -> ShowS
[ListReportsResponse] -> ShowS
ListReportsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListReportsResponse] -> ShowS
$cshowList :: [ListReportsResponse] -> ShowS
show :: ListReportsResponse -> String
$cshow :: ListReportsResponse -> String
showsPrec :: Int -> ListReportsResponse -> ShowS
$cshowsPrec :: Int -> ListReportsResponse -> ShowS
Prelude.Show, forall x. Rep ListReportsResponse x -> ListReportsResponse
forall x. ListReportsResponse -> Rep ListReportsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListReportsResponse x -> ListReportsResponse
$cfrom :: forall x. ListReportsResponse -> Rep ListReportsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListReportsResponse' 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', 'listReportsResponse_nextToken' - During a previous call, the maximum number of items that can be returned
-- is the value specified in @maxResults@. If there more items in the list,
-- then a unique string called a /nextToken/ is returned. To get the next
-- batch of items in the list, call this operation again, adding the next
-- token to the call. To get all of the items in the list, keep calling
-- this operation with each subsequent next token that is returned, until
-- no more next tokens are returned.
--
-- 'reports', 'listReportsResponse_reports' - The list of returned ARNs for the reports in the current Amazon Web
-- Services account.
--
-- 'httpStatus', 'listReportsResponse_httpStatus' - The response's http status code.
newListReportsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListReportsResponse
newListReportsResponse :: Int -> ListReportsResponse
newListReportsResponse Int
pHttpStatus_ =
  ListReportsResponse'
    { $sel:nextToken:ListReportsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:reports:ListReportsResponse' :: Maybe (NonEmpty Text)
reports = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListReportsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | During a previous call, the maximum number of items that can be returned
-- is the value specified in @maxResults@. If there more items in the list,
-- then a unique string called a /nextToken/ is returned. To get the next
-- batch of items in the list, call this operation again, adding the next
-- token to the call. To get all of the items in the list, keep calling
-- this operation with each subsequent next token that is returned, until
-- no more next tokens are returned.
listReportsResponse_nextToken :: Lens.Lens' ListReportsResponse (Prelude.Maybe Prelude.Text)
listReportsResponse_nextToken :: Lens' ListReportsResponse (Maybe Text)
listReportsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReportsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListReportsResponse' :: ListReportsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListReportsResponse
s@ListReportsResponse' {} Maybe Text
a -> ListReportsResponse
s {$sel:nextToken:ListReportsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListReportsResponse)

-- | The list of returned ARNs for the reports in the current Amazon Web
-- Services account.
listReportsResponse_reports :: Lens.Lens' ListReportsResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listReportsResponse_reports :: Lens' ListReportsResponse (Maybe (NonEmpty Text))
listReportsResponse_reports = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReportsResponse' {Maybe (NonEmpty Text)
reports :: Maybe (NonEmpty Text)
$sel:reports:ListReportsResponse' :: ListReportsResponse -> Maybe (NonEmpty Text)
reports} -> Maybe (NonEmpty Text)
reports) (\s :: ListReportsResponse
s@ListReportsResponse' {} Maybe (NonEmpty Text)
a -> ListReportsResponse
s {$sel:reports:ListReportsResponse' :: Maybe (NonEmpty Text)
reports = Maybe (NonEmpty Text)
a} :: ListReportsResponse) 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.
listReportsResponse_httpStatus :: Lens.Lens' ListReportsResponse Prelude.Int
listReportsResponse_httpStatus :: Lens' ListReportsResponse Int
listReportsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReportsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListReportsResponse' :: ListReportsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListReportsResponse
s@ListReportsResponse' {} Int
a -> ListReportsResponse
s {$sel:httpStatus:ListReportsResponse' :: Int
httpStatus = Int
a} :: ListReportsResponse)

instance Prelude.NFData ListReportsResponse where
  rnf :: ListReportsResponse -> ()
rnf ListReportsResponse' {Int
Maybe (NonEmpty Text)
Maybe Text
httpStatus :: Int
reports :: Maybe (NonEmpty Text)
nextToken :: Maybe Text
$sel:httpStatus:ListReportsResponse' :: ListReportsResponse -> Int
$sel:reports:ListReportsResponse' :: ListReportsResponse -> Maybe (NonEmpty Text)
$sel:nextToken:ListReportsResponse' :: ListReportsResponse -> 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 (NonEmpty Text)
reports
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus