{-# 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.CodeGuruProfiler.ListFindingsReports
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- List the available reports for a given profiling group and time range.
module Amazonka.CodeGuruProfiler.ListFindingsReports
  ( -- * Creating a Request
    ListFindingsReports (..),
    newListFindingsReports,

    -- * Request Lenses
    listFindingsReports_dailyReportsOnly,
    listFindingsReports_maxResults,
    listFindingsReports_nextToken,
    listFindingsReports_endTime,
    listFindingsReports_profilingGroupName,
    listFindingsReports_startTime,

    -- * Destructuring the Response
    ListFindingsReportsResponse (..),
    newListFindingsReportsResponse,

    -- * Response Lenses
    listFindingsReportsResponse_nextToken,
    listFindingsReportsResponse_httpStatus,
    listFindingsReportsResponse_findingsReportSummaries,
  )
where

import Amazonka.CodeGuruProfiler.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

-- | The structure representing the ListFindingsReportsRequest.
--
-- /See:/ 'newListFindingsReports' smart constructor.
data ListFindingsReports = ListFindingsReports'
  { -- | A @Boolean@ value indicating whether to only return reports from daily
    -- profiles. If set to @True@, only analysis data from daily profiles is
    -- returned. If set to @False@, analysis data is returned from smaller time
    -- windows (for example, one hour).
    ListFindingsReports -> Maybe Bool
dailyReportsOnly :: Prelude.Maybe Prelude.Bool,
    -- | The maximum number of report results returned by @ListFindingsReports@
    -- in paginated output. When this parameter is used, @ListFindingsReports@
    -- only returns @maxResults@ results in a single page along with a
    -- @nextToken@ response element. The remaining results of the initial
    -- request can be seen by sending another @ListFindingsReports@ request
    -- with the returned @nextToken@ value.
    ListFindingsReports -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The @nextToken@ value returned from a previous paginated
    -- @ListFindingsReportsRequest@ request where @maxResults@ was used and the
    -- results exceeded the value of that parameter. Pagination continues from
    -- the end of the previous results that returned the @nextToken@ value.
    --
    -- This token should be treated as an opaque identifier that is only used
    -- to retrieve the next items in a list and not for other programmatic
    -- purposes.
    ListFindingsReports -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The end time of the profile to get analysis data about. You must specify
    -- @startTime@ and @endTime@. This is specified using the ISO 8601 format.
    -- For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June
    -- 1, 2020 1:15:02 PM UTC.
    ListFindingsReports -> ISO8601
endTime :: Data.ISO8601,
    -- | The name of the profiling group from which to search for analysis data.
    ListFindingsReports -> Text
profilingGroupName :: Prelude.Text,
    -- | The start time of the profile to get analysis data about. You must
    -- specify @startTime@ and @endTime@. This is specified using the ISO 8601
    -- format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond
    -- past June 1, 2020 1:15:02 PM UTC.
    ListFindingsReports -> ISO8601
startTime :: Data.ISO8601
  }
  deriving (ListFindingsReports -> ListFindingsReports -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFindingsReports -> ListFindingsReports -> Bool
$c/= :: ListFindingsReports -> ListFindingsReports -> Bool
== :: ListFindingsReports -> ListFindingsReports -> Bool
$c== :: ListFindingsReports -> ListFindingsReports -> Bool
Prelude.Eq, ReadPrec [ListFindingsReports]
ReadPrec ListFindingsReports
Int -> ReadS ListFindingsReports
ReadS [ListFindingsReports]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFindingsReports]
$creadListPrec :: ReadPrec [ListFindingsReports]
readPrec :: ReadPrec ListFindingsReports
$creadPrec :: ReadPrec ListFindingsReports
readList :: ReadS [ListFindingsReports]
$creadList :: ReadS [ListFindingsReports]
readsPrec :: Int -> ReadS ListFindingsReports
$creadsPrec :: Int -> ReadS ListFindingsReports
Prelude.Read, Int -> ListFindingsReports -> ShowS
[ListFindingsReports] -> ShowS
ListFindingsReports -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFindingsReports] -> ShowS
$cshowList :: [ListFindingsReports] -> ShowS
show :: ListFindingsReports -> String
$cshow :: ListFindingsReports -> String
showsPrec :: Int -> ListFindingsReports -> ShowS
$cshowsPrec :: Int -> ListFindingsReports -> ShowS
Prelude.Show, forall x. Rep ListFindingsReports x -> ListFindingsReports
forall x. ListFindingsReports -> Rep ListFindingsReports x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFindingsReports x -> ListFindingsReports
$cfrom :: forall x. ListFindingsReports -> Rep ListFindingsReports x
Prelude.Generic)

-- |
-- Create a value of 'ListFindingsReports' 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:
--
-- 'dailyReportsOnly', 'listFindingsReports_dailyReportsOnly' - A @Boolean@ value indicating whether to only return reports from daily
-- profiles. If set to @True@, only analysis data from daily profiles is
-- returned. If set to @False@, analysis data is returned from smaller time
-- windows (for example, one hour).
--
-- 'maxResults', 'listFindingsReports_maxResults' - The maximum number of report results returned by @ListFindingsReports@
-- in paginated output. When this parameter is used, @ListFindingsReports@
-- only returns @maxResults@ results in a single page along with a
-- @nextToken@ response element. The remaining results of the initial
-- request can be seen by sending another @ListFindingsReports@ request
-- with the returned @nextToken@ value.
--
-- 'nextToken', 'listFindingsReports_nextToken' - The @nextToken@ value returned from a previous paginated
-- @ListFindingsReportsRequest@ request where @maxResults@ was used and the
-- results exceeded the value of that parameter. Pagination continues from
-- the end of the previous results that returned the @nextToken@ value.
--
-- This token should be treated as an opaque identifier that is only used
-- to retrieve the next items in a list and not for other programmatic
-- purposes.
--
-- 'endTime', 'listFindingsReports_endTime' - The end time of the profile to get analysis data about. You must specify
-- @startTime@ and @endTime@. This is specified using the ISO 8601 format.
-- For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June
-- 1, 2020 1:15:02 PM UTC.
--
-- 'profilingGroupName', 'listFindingsReports_profilingGroupName' - The name of the profiling group from which to search for analysis data.
--
-- 'startTime', 'listFindingsReports_startTime' - The start time of the profile to get analysis data about. You must
-- specify @startTime@ and @endTime@. This is specified using the ISO 8601
-- format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond
-- past June 1, 2020 1:15:02 PM UTC.
newListFindingsReports ::
  -- | 'endTime'
  Prelude.UTCTime ->
  -- | 'profilingGroupName'
  Prelude.Text ->
  -- | 'startTime'
  Prelude.UTCTime ->
  ListFindingsReports
newListFindingsReports :: UTCTime -> Text -> UTCTime -> ListFindingsReports
newListFindingsReports
  UTCTime
pEndTime_
  Text
pProfilingGroupName_
  UTCTime
pStartTime_ =
    ListFindingsReports'
      { $sel:dailyReportsOnly:ListFindingsReports' :: Maybe Bool
dailyReportsOnly =
          forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListFindingsReports' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListFindingsReports' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:endTime:ListFindingsReports' :: ISO8601
endTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndTime_,
        $sel:profilingGroupName:ListFindingsReports' :: Text
profilingGroupName = Text
pProfilingGroupName_,
        $sel:startTime:ListFindingsReports' :: ISO8601
startTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_
      }

-- | A @Boolean@ value indicating whether to only return reports from daily
-- profiles. If set to @True@, only analysis data from daily profiles is
-- returned. If set to @False@, analysis data is returned from smaller time
-- windows (for example, one hour).
listFindingsReports_dailyReportsOnly :: Lens.Lens' ListFindingsReports (Prelude.Maybe Prelude.Bool)
listFindingsReports_dailyReportsOnly :: Lens' ListFindingsReports (Maybe Bool)
listFindingsReports_dailyReportsOnly = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFindingsReports' {Maybe Bool
dailyReportsOnly :: Maybe Bool
$sel:dailyReportsOnly:ListFindingsReports' :: ListFindingsReports -> Maybe Bool
dailyReportsOnly} -> Maybe Bool
dailyReportsOnly) (\s :: ListFindingsReports
s@ListFindingsReports' {} Maybe Bool
a -> ListFindingsReports
s {$sel:dailyReportsOnly:ListFindingsReports' :: Maybe Bool
dailyReportsOnly = Maybe Bool
a} :: ListFindingsReports)

-- | The maximum number of report results returned by @ListFindingsReports@
-- in paginated output. When this parameter is used, @ListFindingsReports@
-- only returns @maxResults@ results in a single page along with a
-- @nextToken@ response element. The remaining results of the initial
-- request can be seen by sending another @ListFindingsReports@ request
-- with the returned @nextToken@ value.
listFindingsReports_maxResults :: Lens.Lens' ListFindingsReports (Prelude.Maybe Prelude.Natural)
listFindingsReports_maxResults :: Lens' ListFindingsReports (Maybe Natural)
listFindingsReports_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFindingsReports' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListFindingsReports' :: ListFindingsReports -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListFindingsReports
s@ListFindingsReports' {} Maybe Natural
a -> ListFindingsReports
s {$sel:maxResults:ListFindingsReports' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListFindingsReports)

-- | The @nextToken@ value returned from a previous paginated
-- @ListFindingsReportsRequest@ request where @maxResults@ was used and the
-- results exceeded the value of that parameter. Pagination continues from
-- the end of the previous results that returned the @nextToken@ value.
--
-- This token should be treated as an opaque identifier that is only used
-- to retrieve the next items in a list and not for other programmatic
-- purposes.
listFindingsReports_nextToken :: Lens.Lens' ListFindingsReports (Prelude.Maybe Prelude.Text)
listFindingsReports_nextToken :: Lens' ListFindingsReports (Maybe Text)
listFindingsReports_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFindingsReports' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFindingsReports' :: ListFindingsReports -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFindingsReports
s@ListFindingsReports' {} Maybe Text
a -> ListFindingsReports
s {$sel:nextToken:ListFindingsReports' :: Maybe Text
nextToken = Maybe Text
a} :: ListFindingsReports)

-- | The end time of the profile to get analysis data about. You must specify
-- @startTime@ and @endTime@. This is specified using the ISO 8601 format.
-- For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June
-- 1, 2020 1:15:02 PM UTC.
listFindingsReports_endTime :: Lens.Lens' ListFindingsReports Prelude.UTCTime
listFindingsReports_endTime :: Lens' ListFindingsReports UTCTime
listFindingsReports_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFindingsReports' {ISO8601
endTime :: ISO8601
$sel:endTime:ListFindingsReports' :: ListFindingsReports -> ISO8601
endTime} -> ISO8601
endTime) (\s :: ListFindingsReports
s@ListFindingsReports' {} ISO8601
a -> ListFindingsReports
s {$sel:endTime:ListFindingsReports' :: ISO8601
endTime = ISO8601
a} :: ListFindingsReports) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the profiling group from which to search for analysis data.
listFindingsReports_profilingGroupName :: Lens.Lens' ListFindingsReports Prelude.Text
listFindingsReports_profilingGroupName :: Lens' ListFindingsReports Text
listFindingsReports_profilingGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFindingsReports' {Text
profilingGroupName :: Text
$sel:profilingGroupName:ListFindingsReports' :: ListFindingsReports -> Text
profilingGroupName} -> Text
profilingGroupName) (\s :: ListFindingsReports
s@ListFindingsReports' {} Text
a -> ListFindingsReports
s {$sel:profilingGroupName:ListFindingsReports' :: Text
profilingGroupName = Text
a} :: ListFindingsReports)

-- | The start time of the profile to get analysis data about. You must
-- specify @startTime@ and @endTime@. This is specified using the ISO 8601
-- format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond
-- past June 1, 2020 1:15:02 PM UTC.
listFindingsReports_startTime :: Lens.Lens' ListFindingsReports Prelude.UTCTime
listFindingsReports_startTime :: Lens' ListFindingsReports UTCTime
listFindingsReports_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFindingsReports' {ISO8601
startTime :: ISO8601
$sel:startTime:ListFindingsReports' :: ListFindingsReports -> ISO8601
startTime} -> ISO8601
startTime) (\s :: ListFindingsReports
s@ListFindingsReports' {} ISO8601
a -> ListFindingsReports
s {$sel:startTime:ListFindingsReports' :: ISO8601
startTime = ISO8601
a} :: ListFindingsReports) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Core.AWSRequest ListFindingsReports where
  type
    AWSResponse ListFindingsReports =
      ListFindingsReportsResponse
  request :: (Service -> Service)
-> ListFindingsReports -> Request ListFindingsReports
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListFindingsReports
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListFindingsReports)))
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
-> Int -> [FindingsReportSummary] -> ListFindingsReportsResponse
ListFindingsReportsResponse'
            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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            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
"findingsReportSummaries"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListFindingsReports where
  hashWithSalt :: Int -> ListFindingsReports -> Int
hashWithSalt Int
_salt ListFindingsReports' {Maybe Bool
Maybe Natural
Maybe Text
Text
ISO8601
startTime :: ISO8601
profilingGroupName :: Text
endTime :: ISO8601
nextToken :: Maybe Text
maxResults :: Maybe Natural
dailyReportsOnly :: Maybe Bool
$sel:startTime:ListFindingsReports' :: ListFindingsReports -> ISO8601
$sel:profilingGroupName:ListFindingsReports' :: ListFindingsReports -> Text
$sel:endTime:ListFindingsReports' :: ListFindingsReports -> ISO8601
$sel:nextToken:ListFindingsReports' :: ListFindingsReports -> Maybe Text
$sel:maxResults:ListFindingsReports' :: ListFindingsReports -> Maybe Natural
$sel:dailyReportsOnly:ListFindingsReports' :: ListFindingsReports -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dailyReportsOnly
      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` ISO8601
endTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
profilingGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
startTime

instance Prelude.NFData ListFindingsReports where
  rnf :: ListFindingsReports -> ()
rnf ListFindingsReports' {Maybe Bool
Maybe Natural
Maybe Text
Text
ISO8601
startTime :: ISO8601
profilingGroupName :: Text
endTime :: ISO8601
nextToken :: Maybe Text
maxResults :: Maybe Natural
dailyReportsOnly :: Maybe Bool
$sel:startTime:ListFindingsReports' :: ListFindingsReports -> ISO8601
$sel:profilingGroupName:ListFindingsReports' :: ListFindingsReports -> Text
$sel:endTime:ListFindingsReports' :: ListFindingsReports -> ISO8601
$sel:nextToken:ListFindingsReports' :: ListFindingsReports -> Maybe Text
$sel:maxResults:ListFindingsReports' :: ListFindingsReports -> Maybe Natural
$sel:dailyReportsOnly:ListFindingsReports' :: ListFindingsReports -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dailyReportsOnly
      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 ISO8601
endTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
profilingGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
startTime

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

instance Data.ToPath ListFindingsReports where
  toPath :: ListFindingsReports -> ByteString
toPath ListFindingsReports' {Maybe Bool
Maybe Natural
Maybe Text
Text
ISO8601
startTime :: ISO8601
profilingGroupName :: Text
endTime :: ISO8601
nextToken :: Maybe Text
maxResults :: Maybe Natural
dailyReportsOnly :: Maybe Bool
$sel:startTime:ListFindingsReports' :: ListFindingsReports -> ISO8601
$sel:profilingGroupName:ListFindingsReports' :: ListFindingsReports -> Text
$sel:endTime:ListFindingsReports' :: ListFindingsReports -> ISO8601
$sel:nextToken:ListFindingsReports' :: ListFindingsReports -> Maybe Text
$sel:maxResults:ListFindingsReports' :: ListFindingsReports -> Maybe Natural
$sel:dailyReportsOnly:ListFindingsReports' :: ListFindingsReports -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/internal/profilingGroups/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
profilingGroupName,
        ByteString
"/findingsReports"
      ]

instance Data.ToQuery ListFindingsReports where
  toQuery :: ListFindingsReports -> QueryString
toQuery ListFindingsReports' {Maybe Bool
Maybe Natural
Maybe Text
Text
ISO8601
startTime :: ISO8601
profilingGroupName :: Text
endTime :: ISO8601
nextToken :: Maybe Text
maxResults :: Maybe Natural
dailyReportsOnly :: Maybe Bool
$sel:startTime:ListFindingsReports' :: ListFindingsReports -> ISO8601
$sel:profilingGroupName:ListFindingsReports' :: ListFindingsReports -> Text
$sel:endTime:ListFindingsReports' :: ListFindingsReports -> ISO8601
$sel:nextToken:ListFindingsReports' :: ListFindingsReports -> Maybe Text
$sel:maxResults:ListFindingsReports' :: ListFindingsReports -> Maybe Natural
$sel:dailyReportsOnly:ListFindingsReports' :: ListFindingsReports -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"dailyReportsOnly" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dailyReportsOnly,
        ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"endTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ISO8601
endTime,
        ByteString
"startTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ISO8601
startTime
      ]

-- | The structure representing the ListFindingsReportsResponse.
--
-- /See:/ 'newListFindingsReportsResponse' smart constructor.
data ListFindingsReportsResponse = ListFindingsReportsResponse'
  { -- | The @nextToken@ value to include in a future @ListFindingsReports@
    -- request. When the results of a @ListFindingsReports@ request exceed
    -- @maxResults@, this value can be used to retrieve the next page of
    -- results. This value is @null@ when there are no more results to return.
    ListFindingsReportsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListFindingsReportsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The list of analysis results summaries.
    ListFindingsReportsResponse -> [FindingsReportSummary]
findingsReportSummaries :: [FindingsReportSummary]
  }
  deriving (ListFindingsReportsResponse -> ListFindingsReportsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFindingsReportsResponse -> ListFindingsReportsResponse -> Bool
$c/= :: ListFindingsReportsResponse -> ListFindingsReportsResponse -> Bool
== :: ListFindingsReportsResponse -> ListFindingsReportsResponse -> Bool
$c== :: ListFindingsReportsResponse -> ListFindingsReportsResponse -> Bool
Prelude.Eq, ReadPrec [ListFindingsReportsResponse]
ReadPrec ListFindingsReportsResponse
Int -> ReadS ListFindingsReportsResponse
ReadS [ListFindingsReportsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFindingsReportsResponse]
$creadListPrec :: ReadPrec [ListFindingsReportsResponse]
readPrec :: ReadPrec ListFindingsReportsResponse
$creadPrec :: ReadPrec ListFindingsReportsResponse
readList :: ReadS [ListFindingsReportsResponse]
$creadList :: ReadS [ListFindingsReportsResponse]
readsPrec :: Int -> ReadS ListFindingsReportsResponse
$creadsPrec :: Int -> ReadS ListFindingsReportsResponse
Prelude.Read, Int -> ListFindingsReportsResponse -> ShowS
[ListFindingsReportsResponse] -> ShowS
ListFindingsReportsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFindingsReportsResponse] -> ShowS
$cshowList :: [ListFindingsReportsResponse] -> ShowS
show :: ListFindingsReportsResponse -> String
$cshow :: ListFindingsReportsResponse -> String
showsPrec :: Int -> ListFindingsReportsResponse -> ShowS
$cshowsPrec :: Int -> ListFindingsReportsResponse -> ShowS
Prelude.Show, forall x.
Rep ListFindingsReportsResponse x -> ListFindingsReportsResponse
forall x.
ListFindingsReportsResponse -> Rep ListFindingsReportsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFindingsReportsResponse x -> ListFindingsReportsResponse
$cfrom :: forall x.
ListFindingsReportsResponse -> Rep ListFindingsReportsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFindingsReportsResponse' 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', 'listFindingsReportsResponse_nextToken' - The @nextToken@ value to include in a future @ListFindingsReports@
-- request. When the results of a @ListFindingsReports@ request exceed
-- @maxResults@, this value can be used to retrieve the next page of
-- results. This value is @null@ when there are no more results to return.
--
-- 'httpStatus', 'listFindingsReportsResponse_httpStatus' - The response's http status code.
--
-- 'findingsReportSummaries', 'listFindingsReportsResponse_findingsReportSummaries' - The list of analysis results summaries.
newListFindingsReportsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFindingsReportsResponse
newListFindingsReportsResponse :: Int -> ListFindingsReportsResponse
newListFindingsReportsResponse Int
pHttpStatus_ =
  ListFindingsReportsResponse'
    { $sel:nextToken:ListFindingsReportsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFindingsReportsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:findingsReportSummaries:ListFindingsReportsResponse' :: [FindingsReportSummary]
findingsReportSummaries = forall a. Monoid a => a
Prelude.mempty
    }

-- | The @nextToken@ value to include in a future @ListFindingsReports@
-- request. When the results of a @ListFindingsReports@ request exceed
-- @maxResults@, this value can be used to retrieve the next page of
-- results. This value is @null@ when there are no more results to return.
listFindingsReportsResponse_nextToken :: Lens.Lens' ListFindingsReportsResponse (Prelude.Maybe Prelude.Text)
listFindingsReportsResponse_nextToken :: Lens' ListFindingsReportsResponse (Maybe Text)
listFindingsReportsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFindingsReportsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFindingsReportsResponse' :: ListFindingsReportsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFindingsReportsResponse
s@ListFindingsReportsResponse' {} Maybe Text
a -> ListFindingsReportsResponse
s {$sel:nextToken:ListFindingsReportsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFindingsReportsResponse)

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

-- | The list of analysis results summaries.
listFindingsReportsResponse_findingsReportSummaries :: Lens.Lens' ListFindingsReportsResponse [FindingsReportSummary]
listFindingsReportsResponse_findingsReportSummaries :: Lens' ListFindingsReportsResponse [FindingsReportSummary]
listFindingsReportsResponse_findingsReportSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFindingsReportsResponse' {[FindingsReportSummary]
findingsReportSummaries :: [FindingsReportSummary]
$sel:findingsReportSummaries:ListFindingsReportsResponse' :: ListFindingsReportsResponse -> [FindingsReportSummary]
findingsReportSummaries} -> [FindingsReportSummary]
findingsReportSummaries) (\s :: ListFindingsReportsResponse
s@ListFindingsReportsResponse' {} [FindingsReportSummary]
a -> ListFindingsReportsResponse
s {$sel:findingsReportSummaries:ListFindingsReportsResponse' :: [FindingsReportSummary]
findingsReportSummaries = [FindingsReportSummary]
a} :: ListFindingsReportsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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