{-# 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-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 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_sortOrder,
    listReports_nextToken,
    listReports_filter,
    listReports_maxResults,

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

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

import Amazonka.CodeBuild.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | 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,
    -- | 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,
    -- | 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
  }
  deriving (ListReports -> ListReports -> Bool
(ListReports -> ListReports -> Bool)
-> (ListReports -> ListReports -> Bool) -> Eq ListReports
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]
(Int -> ReadS ListReports)
-> ReadS [ListReports]
-> ReadPrec ListReports
-> ReadPrec [ListReports]
-> Read 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
(Int -> ListReports -> ShowS)
-> (ListReports -> String)
-> ([ListReports] -> ShowS)
-> Show ListReports
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. ListReports -> Rep ListReports x)
-> (forall x. Rep ListReports x -> ListReports)
-> Generic ListReports
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:
--
-- '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.
--
-- '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.
--
-- '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.
newListReports ::
  ListReports
newListReports :: ListReports
newListReports =
  ListReports' :: Maybe SortOrderType
-> Maybe Text -> Maybe ReportFilter -> Maybe Natural -> ListReports
ListReports'
    { $sel:sortOrder:ListReports' :: Maybe SortOrderType
sortOrder = Maybe SortOrderType
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListReports' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':ListReports' :: Maybe ReportFilter
filter' = Maybe ReportFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListReports' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe SortOrderType -> f (Maybe SortOrderType))
-> ListReports -> f ListReports
listReports_sortOrder = (ListReports -> Maybe SortOrderType)
-> (ListReports -> Maybe SortOrderType -> ListReports)
-> Lens
     ListReports ListReports (Maybe SortOrderType) (Maybe SortOrderType)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> ListReports -> f ListReports
listReports_nextToken = (ListReports -> Maybe Text)
-> (ListReports -> Maybe Text -> ListReports)
-> Lens ListReports ListReports (Maybe Text) (Maybe Text)
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)

-- | A @ReportFilter@ object used to filter the returned reports.
listReports_filter :: Lens.Lens' ListReports (Prelude.Maybe ReportFilter)
listReports_filter :: (Maybe ReportFilter -> f (Maybe ReportFilter))
-> ListReports -> f ListReports
listReports_filter = (ListReports -> Maybe ReportFilter)
-> (ListReports -> Maybe ReportFilter -> ListReports)
-> Lens
     ListReports ListReports (Maybe ReportFilter) (Maybe ReportFilter)
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 :: (Maybe Natural -> f (Maybe Natural))
-> ListReports -> f ListReports
listReports_maxResults = (ListReports -> Maybe Natural)
-> (ListReports -> Maybe Natural -> ListReports)
-> Lens ListReports ListReports (Maybe Natural) (Maybe Natural)
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)

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

instance Core.AWSRequest ListReports where
  type AWSResponse ListReports = ListReportsResponse
  request :: ListReports -> Request ListReports
request = Service -> ListReports -> Request ListReports
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListReports
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListReports)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListReports))
-> Logger
-> Service
-> Proxy ListReports
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListReports)))
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 (NonEmpty Text) -> Maybe Text -> Int -> ListReportsResponse
ListReportsResponse'
            (Maybe (NonEmpty Text) -> Maybe Text -> Int -> ListReportsResponse)
-> Either String (Maybe (NonEmpty Text))
-> Either String (Maybe Text -> Int -> ListReportsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"reports")
            Either String (Maybe Text -> Int -> ListReportsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListReportsResponse)
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 -> ListReportsResponse)
-> Either String Int -> Either String ListReportsResponse
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 ListReports

instance Prelude.NFData ListReports

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

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

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

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

-- | /See:/ 'newListReportsResponse' smart constructor.
data ListReportsResponse = ListReportsResponse'
  { -- | 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),
    -- | 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 response's http status code.
    ListReportsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListReportsResponse -> ListReportsResponse -> Bool
(ListReportsResponse -> ListReportsResponse -> Bool)
-> (ListReportsResponse -> ListReportsResponse -> Bool)
-> Eq ListReportsResponse
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]
(Int -> ReadS ListReportsResponse)
-> ReadS [ListReportsResponse]
-> ReadPrec ListReportsResponse
-> ReadPrec [ListReportsResponse]
-> Read 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
(Int -> ListReportsResponse -> ShowS)
-> (ListReportsResponse -> String)
-> ([ListReportsResponse] -> ShowS)
-> Show ListReportsResponse
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. ListReportsResponse -> Rep ListReportsResponse x)
-> (forall x. Rep ListReportsResponse x -> ListReportsResponse)
-> Generic ListReportsResponse
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:
--
-- 'reports', 'listReportsResponse_reports' - The list of returned ARNs for the reports in the current Amazon Web
-- Services account.
--
-- '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.
--
-- 'httpStatus', 'listReportsResponse_httpStatus' - The response's http status code.
newListReportsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListReportsResponse
newListReportsResponse :: Int -> ListReportsResponse
newListReportsResponse Int
pHttpStatus_ =
  ListReportsResponse' :: Maybe (NonEmpty Text) -> Maybe Text -> Int -> ListReportsResponse
ListReportsResponse'
    { $sel:reports:ListReportsResponse' :: Maybe (NonEmpty Text)
reports = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListReportsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListReportsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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 :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListReportsResponse -> f ListReportsResponse
listReportsResponse_reports = (ListReportsResponse -> Maybe (NonEmpty Text))
-> (ListReportsResponse
    -> Maybe (NonEmpty Text) -> ListReportsResponse)
-> Lens' ListReportsResponse (Maybe (NonEmpty Text))
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) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> ListReportsResponse -> f ListReportsResponse)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListReportsResponse
-> f ListReportsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ListReportsResponse -> f ListReportsResponse
listReportsResponse_nextToken = (ListReportsResponse -> Maybe Text)
-> (ListReportsResponse -> Maybe Text -> ListReportsResponse)
-> Lens' ListReportsResponse (Maybe Text)
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 response's http status code.
listReportsResponse_httpStatus :: Lens.Lens' ListReportsResponse Prelude.Int
listReportsResponse_httpStatus :: (Int -> f Int) -> ListReportsResponse -> f ListReportsResponse
listReportsResponse_httpStatus = (ListReportsResponse -> Int)
-> (ListReportsResponse -> Int -> ListReportsResponse)
-> Lens ListReportsResponse ListReportsResponse Int Int
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