{-# 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-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)
--
-- List the available reports for a given profiling group and time range.
module Amazonka.CodeGuruProfiler.ListFindingsReports
  ( -- * Creating a Request
    ListFindingsReports (..),
    newListFindingsReports,

    -- * Request Lenses
    listFindingsReports_nextToken,
    listFindingsReports_dailyReportsOnly,
    listFindingsReports_maxResults,
    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.Lens as Lens
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'
  { -- | 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,
    -- | 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 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 -> POSIX
endTime :: Core.POSIX,
    -- | 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 -> POSIX
startTime :: Core.POSIX
  }
  deriving (ListFindingsReports -> ListFindingsReports -> Bool
(ListFindingsReports -> ListFindingsReports -> Bool)
-> (ListFindingsReports -> ListFindingsReports -> Bool)
-> Eq ListFindingsReports
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]
(Int -> ReadS ListFindingsReports)
-> ReadS [ListFindingsReports]
-> ReadPrec ListFindingsReports
-> ReadPrec [ListFindingsReports]
-> Read 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
(Int -> ListFindingsReports -> ShowS)
-> (ListFindingsReports -> String)
-> ([ListFindingsReports] -> ShowS)
-> Show ListFindingsReports
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. ListFindingsReports -> Rep ListFindingsReports x)
-> (forall x. Rep ListFindingsReports x -> ListFindingsReports)
-> Generic ListFindingsReports
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:
--
-- '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.
--
-- '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.
--
-- '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' :: Maybe Text
-> Maybe Bool
-> Maybe Natural
-> POSIX
-> Text
-> POSIX
-> ListFindingsReports
ListFindingsReports'
      { $sel:nextToken:ListFindingsReports' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:dailyReportsOnly:ListFindingsReports' :: Maybe Bool
dailyReportsOnly = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListFindingsReports' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:endTime:ListFindingsReports' :: POSIX
endTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndTime_,
        $sel:profilingGroupName:ListFindingsReports' :: Text
profilingGroupName = Text
pProfilingGroupName_,
        $sel:startTime:ListFindingsReports' :: POSIX
startTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_
      }

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

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> ListFindingsReports -> f ListFindingsReports
listFindingsReports_dailyReportsOnly = (ListFindingsReports -> Maybe Bool)
-> (ListFindingsReports -> Maybe Bool -> ListFindingsReports)
-> Lens
     ListFindingsReports ListFindingsReports (Maybe Bool) (Maybe Bool)
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 :: (Maybe Natural -> f (Maybe Natural))
-> ListFindingsReports -> f ListFindingsReports
listFindingsReports_maxResults = (ListFindingsReports -> Maybe Natural)
-> (ListFindingsReports -> Maybe Natural -> ListFindingsReports)
-> Lens
     ListFindingsReports
     ListFindingsReports
     (Maybe Natural)
     (Maybe Natural)
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 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 :: (UTCTime -> f UTCTime)
-> ListFindingsReports -> f ListFindingsReports
listFindingsReports_endTime = (ListFindingsReports -> POSIX)
-> (ListFindingsReports -> POSIX -> ListFindingsReports)
-> Lens ListFindingsReports ListFindingsReports POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFindingsReports' {POSIX
endTime :: POSIX
$sel:endTime:ListFindingsReports' :: ListFindingsReports -> POSIX
endTime} -> POSIX
endTime) (\s :: ListFindingsReports
s@ListFindingsReports' {} POSIX
a -> ListFindingsReports
s {$sel:endTime:ListFindingsReports' :: POSIX
endTime = POSIX
a} :: ListFindingsReports) ((POSIX -> f POSIX)
 -> ListFindingsReports -> f ListFindingsReports)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ListFindingsReports
-> f ListFindingsReports
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the profiling group from which to search for analysis data.
listFindingsReports_profilingGroupName :: Lens.Lens' ListFindingsReports Prelude.Text
listFindingsReports_profilingGroupName :: (Text -> f Text) -> ListFindingsReports -> f ListFindingsReports
listFindingsReports_profilingGroupName = (ListFindingsReports -> Text)
-> (ListFindingsReports -> Text -> ListFindingsReports)
-> Lens ListFindingsReports ListFindingsReports Text Text
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 :: (UTCTime -> f UTCTime)
-> ListFindingsReports -> f ListFindingsReports
listFindingsReports_startTime = (ListFindingsReports -> POSIX)
-> (ListFindingsReports -> POSIX -> ListFindingsReports)
-> Lens ListFindingsReports ListFindingsReports POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFindingsReports' {POSIX
startTime :: POSIX
$sel:startTime:ListFindingsReports' :: ListFindingsReports -> POSIX
startTime} -> POSIX
startTime) (\s :: ListFindingsReports
s@ListFindingsReports' {} POSIX
a -> ListFindingsReports
s {$sel:startTime:ListFindingsReports' :: POSIX
startTime = POSIX
a} :: ListFindingsReports) ((POSIX -> f POSIX)
 -> ListFindingsReports -> f ListFindingsReports)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ListFindingsReports
-> f ListFindingsReports
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.AWSRequest ListFindingsReports where
  type
    AWSResponse ListFindingsReports =
      ListFindingsReportsResponse
  request :: ListFindingsReports -> Request ListFindingsReports
request = Service -> ListFindingsReports -> Request ListFindingsReports
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListFindingsReports
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListFindingsReports)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListFindingsReports))
-> Logger
-> Service
-> Proxy ListFindingsReports
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListFindingsReports)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Int -> [FindingsReportSummary] -> ListFindingsReportsResponse
ListFindingsReportsResponse'
            (Maybe Text
 -> Int -> [FindingsReportSummary] -> ListFindingsReportsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int -> [FindingsReportSummary] -> ListFindingsReportsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either
  String
  (Int -> [FindingsReportSummary] -> ListFindingsReportsResponse)
-> Either String Int
-> Either
     String ([FindingsReportSummary] -> ListFindingsReportsResponse)
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))
            Either
  String ([FindingsReportSummary] -> ListFindingsReportsResponse)
-> Either String [FindingsReportSummary]
-> Either String ListFindingsReportsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [FindingsReportSummary])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"findingsReportSummaries"
                            Either String (Maybe [FindingsReportSummary])
-> [FindingsReportSummary] -> Either String [FindingsReportSummary]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [FindingsReportSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListFindingsReports

instance Prelude.NFData ListFindingsReports

instance Core.ToHeaders ListFindingsReports where
  toHeaders :: ListFindingsReports -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListFindingsReports -> 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.1" ::
                          Prelude.ByteString
                      )
          ]
      )

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

instance Core.ToQuery ListFindingsReports where
  toQuery :: ListFindingsReports -> QueryString
toQuery ListFindingsReports' {Maybe Bool
Maybe Natural
Maybe Text
Text
POSIX
startTime :: POSIX
profilingGroupName :: Text
endTime :: POSIX
maxResults :: Maybe Natural
dailyReportsOnly :: Maybe Bool
nextToken :: Maybe Text
$sel:startTime:ListFindingsReports' :: ListFindingsReports -> POSIX
$sel:profilingGroupName:ListFindingsReports' :: ListFindingsReports -> Text
$sel:endTime:ListFindingsReports' :: ListFindingsReports -> POSIX
$sel:maxResults:ListFindingsReports' :: ListFindingsReports -> Maybe Natural
$sel:dailyReportsOnly:ListFindingsReports' :: ListFindingsReports -> Maybe Bool
$sel:nextToken:ListFindingsReports' :: ListFindingsReports -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"dailyReportsOnly" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
dailyReportsOnly,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults,
        ByteString
"endTime" ByteString -> POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: POSIX
endTime,
        ByteString
"startTime" ByteString -> POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: POSIX
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
(ListFindingsReportsResponse
 -> ListFindingsReportsResponse -> Bool)
-> (ListFindingsReportsResponse
    -> ListFindingsReportsResponse -> Bool)
-> Eq ListFindingsReportsResponse
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]
(Int -> ReadS ListFindingsReportsResponse)
-> ReadS [ListFindingsReportsResponse]
-> ReadPrec ListFindingsReportsResponse
-> ReadPrec [ListFindingsReportsResponse]
-> Read 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
(Int -> ListFindingsReportsResponse -> ShowS)
-> (ListFindingsReportsResponse -> String)
-> ([ListFindingsReportsResponse] -> ShowS)
-> Show ListFindingsReportsResponse
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.
 ListFindingsReportsResponse -> Rep ListFindingsReportsResponse x)
-> (forall x.
    Rep ListFindingsReportsResponse x -> ListFindingsReportsResponse)
-> Generic ListFindingsReportsResponse
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' :: Maybe Text
-> Int -> [FindingsReportSummary] -> ListFindingsReportsResponse
ListFindingsReportsResponse'
    { $sel:nextToken:ListFindingsReportsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFindingsReportsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:findingsReportSummaries:ListFindingsReportsResponse' :: [FindingsReportSummary]
findingsReportSummaries = [FindingsReportSummary]
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 :: (Maybe Text -> f (Maybe Text))
-> ListFindingsReportsResponse -> f ListFindingsReportsResponse
listFindingsReportsResponse_nextToken = (ListFindingsReportsResponse -> Maybe Text)
-> (ListFindingsReportsResponse
    -> Maybe Text -> ListFindingsReportsResponse)
-> Lens
     ListFindingsReportsResponse
     ListFindingsReportsResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Int -> f Int)
-> ListFindingsReportsResponse -> f ListFindingsReportsResponse
listFindingsReportsResponse_httpStatus = (ListFindingsReportsResponse -> Int)
-> (ListFindingsReportsResponse
    -> Int -> ListFindingsReportsResponse)
-> Lens
     ListFindingsReportsResponse ListFindingsReportsResponse Int Int
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 :: ([FindingsReportSummary] -> f [FindingsReportSummary])
-> ListFindingsReportsResponse -> f ListFindingsReportsResponse
listFindingsReportsResponse_findingsReportSummaries = (ListFindingsReportsResponse -> [FindingsReportSummary])
-> (ListFindingsReportsResponse
    -> [FindingsReportSummary] -> ListFindingsReportsResponse)
-> Lens
     ListFindingsReportsResponse
     ListFindingsReportsResponse
     [FindingsReportSummary]
     [FindingsReportSummary]
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) (([FindingsReportSummary] -> f [FindingsReportSummary])
 -> ListFindingsReportsResponse -> f ListFindingsReportsResponse)
-> (([FindingsReportSummary] -> f [FindingsReportSummary])
    -> [FindingsReportSummary] -> f [FindingsReportSummary])
-> ([FindingsReportSummary] -> f [FindingsReportSummary])
-> ListFindingsReportsResponse
-> f ListFindingsReportsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([FindingsReportSummary] -> f [FindingsReportSummary])
-> [FindingsReportSummary] -> f [FindingsReportSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListFindingsReportsResponse