{-# 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.GetReportGroupTrend
-- 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)
--
-- Analyzes and accumulates test report values for the specified test
-- reports.
module Amazonka.CodeBuild.GetReportGroupTrend
  ( -- * Creating a Request
    GetReportGroupTrend (..),
    newGetReportGroupTrend,

    -- * Request Lenses
    getReportGroupTrend_numOfReports,
    getReportGroupTrend_reportGroupArn,
    getReportGroupTrend_trendField,

    -- * Destructuring the Response
    GetReportGroupTrendResponse (..),
    newGetReportGroupTrendResponse,

    -- * Response Lenses
    getReportGroupTrendResponse_rawData,
    getReportGroupTrendResponse_stats,
    getReportGroupTrendResponse_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:/ 'newGetReportGroupTrend' smart constructor.
data GetReportGroupTrend = GetReportGroupTrend'
  { -- | The number of reports to analyze. This operation always retrieves the
    -- most recent reports.
    --
    -- If this parameter is omitted, the most recent 100 reports are analyzed.
    GetReportGroupTrend -> Maybe Natural
numOfReports :: Prelude.Maybe Prelude.Natural,
    -- | The ARN of the report group that contains the reports to analyze.
    GetReportGroupTrend -> Text
reportGroupArn :: Prelude.Text,
    -- | The test report value to accumulate. This must be one of the following
    -- values:
    --
    -- [Test reports:]
    --     [DURATION]
    --         Accumulate the test run times for the specified reports.
    --
    --     [PASS_RATE]
    --         Accumulate the percentage of tests that passed for the specified
    --         test reports.
    --
    --     [TOTAL]
    --         Accumulate the total number of tests for the specified test
    --         reports.
    --
    -- [Code coverage reports:]
    --     [BRANCH_COVERAGE]
    --         Accumulate the branch coverage percentages for the specified
    --         test reports.
    --
    --     [BRANCHES_COVERED]
    --         Accumulate the branches covered values for the specified test
    --         reports.
    --
    --     [BRANCHES_MISSED]
    --         Accumulate the branches missed values for the specified test
    --         reports.
    --
    --     [LINE_COVERAGE]
    --         Accumulate the line coverage percentages for the specified test
    --         reports.
    --
    --     [LINES_COVERED]
    --         Accumulate the lines covered values for the specified test
    --         reports.
    --
    --     [LINES_MISSED]
    --         Accumulate the lines not covered values for the specified test
    --         reports.
    GetReportGroupTrend -> ReportGroupTrendFieldType
trendField :: ReportGroupTrendFieldType
  }
  deriving (GetReportGroupTrend -> GetReportGroupTrend -> Bool
(GetReportGroupTrend -> GetReportGroupTrend -> Bool)
-> (GetReportGroupTrend -> GetReportGroupTrend -> Bool)
-> Eq GetReportGroupTrend
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReportGroupTrend -> GetReportGroupTrend -> Bool
$c/= :: GetReportGroupTrend -> GetReportGroupTrend -> Bool
== :: GetReportGroupTrend -> GetReportGroupTrend -> Bool
$c== :: GetReportGroupTrend -> GetReportGroupTrend -> Bool
Prelude.Eq, ReadPrec [GetReportGroupTrend]
ReadPrec GetReportGroupTrend
Int -> ReadS GetReportGroupTrend
ReadS [GetReportGroupTrend]
(Int -> ReadS GetReportGroupTrend)
-> ReadS [GetReportGroupTrend]
-> ReadPrec GetReportGroupTrend
-> ReadPrec [GetReportGroupTrend]
-> Read GetReportGroupTrend
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReportGroupTrend]
$creadListPrec :: ReadPrec [GetReportGroupTrend]
readPrec :: ReadPrec GetReportGroupTrend
$creadPrec :: ReadPrec GetReportGroupTrend
readList :: ReadS [GetReportGroupTrend]
$creadList :: ReadS [GetReportGroupTrend]
readsPrec :: Int -> ReadS GetReportGroupTrend
$creadsPrec :: Int -> ReadS GetReportGroupTrend
Prelude.Read, Int -> GetReportGroupTrend -> ShowS
[GetReportGroupTrend] -> ShowS
GetReportGroupTrend -> String
(Int -> GetReportGroupTrend -> ShowS)
-> (GetReportGroupTrend -> String)
-> ([GetReportGroupTrend] -> ShowS)
-> Show GetReportGroupTrend
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReportGroupTrend] -> ShowS
$cshowList :: [GetReportGroupTrend] -> ShowS
show :: GetReportGroupTrend -> String
$cshow :: GetReportGroupTrend -> String
showsPrec :: Int -> GetReportGroupTrend -> ShowS
$cshowsPrec :: Int -> GetReportGroupTrend -> ShowS
Prelude.Show, (forall x. GetReportGroupTrend -> Rep GetReportGroupTrend x)
-> (forall x. Rep GetReportGroupTrend x -> GetReportGroupTrend)
-> Generic GetReportGroupTrend
forall x. Rep GetReportGroupTrend x -> GetReportGroupTrend
forall x. GetReportGroupTrend -> Rep GetReportGroupTrend x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetReportGroupTrend x -> GetReportGroupTrend
$cfrom :: forall x. GetReportGroupTrend -> Rep GetReportGroupTrend x
Prelude.Generic)

-- |
-- Create a value of 'GetReportGroupTrend' 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:
--
-- 'numOfReports', 'getReportGroupTrend_numOfReports' - The number of reports to analyze. This operation always retrieves the
-- most recent reports.
--
-- If this parameter is omitted, the most recent 100 reports are analyzed.
--
-- 'reportGroupArn', 'getReportGroupTrend_reportGroupArn' - The ARN of the report group that contains the reports to analyze.
--
-- 'trendField', 'getReportGroupTrend_trendField' - The test report value to accumulate. This must be one of the following
-- values:
--
-- [Test reports:]
--     [DURATION]
--         Accumulate the test run times for the specified reports.
--
--     [PASS_RATE]
--         Accumulate the percentage of tests that passed for the specified
--         test reports.
--
--     [TOTAL]
--         Accumulate the total number of tests for the specified test
--         reports.
--
-- [Code coverage reports:]
--     [BRANCH_COVERAGE]
--         Accumulate the branch coverage percentages for the specified
--         test reports.
--
--     [BRANCHES_COVERED]
--         Accumulate the branches covered values for the specified test
--         reports.
--
--     [BRANCHES_MISSED]
--         Accumulate the branches missed values for the specified test
--         reports.
--
--     [LINE_COVERAGE]
--         Accumulate the line coverage percentages for the specified test
--         reports.
--
--     [LINES_COVERED]
--         Accumulate the lines covered values for the specified test
--         reports.
--
--     [LINES_MISSED]
--         Accumulate the lines not covered values for the specified test
--         reports.
newGetReportGroupTrend ::
  -- | 'reportGroupArn'
  Prelude.Text ->
  -- | 'trendField'
  ReportGroupTrendFieldType ->
  GetReportGroupTrend
newGetReportGroupTrend :: Text -> ReportGroupTrendFieldType -> GetReportGroupTrend
newGetReportGroupTrend Text
pReportGroupArn_ ReportGroupTrendFieldType
pTrendField_ =
  GetReportGroupTrend' :: Maybe Natural
-> Text -> ReportGroupTrendFieldType -> GetReportGroupTrend
GetReportGroupTrend'
    { $sel:numOfReports:GetReportGroupTrend' :: Maybe Natural
numOfReports =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:reportGroupArn:GetReportGroupTrend' :: Text
reportGroupArn = Text
pReportGroupArn_,
      $sel:trendField:GetReportGroupTrend' :: ReportGroupTrendFieldType
trendField = ReportGroupTrendFieldType
pTrendField_
    }

-- | The number of reports to analyze. This operation always retrieves the
-- most recent reports.
--
-- If this parameter is omitted, the most recent 100 reports are analyzed.
getReportGroupTrend_numOfReports :: Lens.Lens' GetReportGroupTrend (Prelude.Maybe Prelude.Natural)
getReportGroupTrend_numOfReports :: (Maybe Natural -> f (Maybe Natural))
-> GetReportGroupTrend -> f GetReportGroupTrend
getReportGroupTrend_numOfReports = (GetReportGroupTrend -> Maybe Natural)
-> (GetReportGroupTrend -> Maybe Natural -> GetReportGroupTrend)
-> Lens
     GetReportGroupTrend
     GetReportGroupTrend
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportGroupTrend' {Maybe Natural
numOfReports :: Maybe Natural
$sel:numOfReports:GetReportGroupTrend' :: GetReportGroupTrend -> Maybe Natural
numOfReports} -> Maybe Natural
numOfReports) (\s :: GetReportGroupTrend
s@GetReportGroupTrend' {} Maybe Natural
a -> GetReportGroupTrend
s {$sel:numOfReports:GetReportGroupTrend' :: Maybe Natural
numOfReports = Maybe Natural
a} :: GetReportGroupTrend)

-- | The ARN of the report group that contains the reports to analyze.
getReportGroupTrend_reportGroupArn :: Lens.Lens' GetReportGroupTrend Prelude.Text
getReportGroupTrend_reportGroupArn :: (Text -> f Text) -> GetReportGroupTrend -> f GetReportGroupTrend
getReportGroupTrend_reportGroupArn = (GetReportGroupTrend -> Text)
-> (GetReportGroupTrend -> Text -> GetReportGroupTrend)
-> Lens GetReportGroupTrend GetReportGroupTrend Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportGroupTrend' {Text
reportGroupArn :: Text
$sel:reportGroupArn:GetReportGroupTrend' :: GetReportGroupTrend -> Text
reportGroupArn} -> Text
reportGroupArn) (\s :: GetReportGroupTrend
s@GetReportGroupTrend' {} Text
a -> GetReportGroupTrend
s {$sel:reportGroupArn:GetReportGroupTrend' :: Text
reportGroupArn = Text
a} :: GetReportGroupTrend)

-- | The test report value to accumulate. This must be one of the following
-- values:
--
-- [Test reports:]
--     [DURATION]
--         Accumulate the test run times for the specified reports.
--
--     [PASS_RATE]
--         Accumulate the percentage of tests that passed for the specified
--         test reports.
--
--     [TOTAL]
--         Accumulate the total number of tests for the specified test
--         reports.
--
-- [Code coverage reports:]
--     [BRANCH_COVERAGE]
--         Accumulate the branch coverage percentages for the specified
--         test reports.
--
--     [BRANCHES_COVERED]
--         Accumulate the branches covered values for the specified test
--         reports.
--
--     [BRANCHES_MISSED]
--         Accumulate the branches missed values for the specified test
--         reports.
--
--     [LINE_COVERAGE]
--         Accumulate the line coverage percentages for the specified test
--         reports.
--
--     [LINES_COVERED]
--         Accumulate the lines covered values for the specified test
--         reports.
--
--     [LINES_MISSED]
--         Accumulate the lines not covered values for the specified test
--         reports.
getReportGroupTrend_trendField :: Lens.Lens' GetReportGroupTrend ReportGroupTrendFieldType
getReportGroupTrend_trendField :: (ReportGroupTrendFieldType -> f ReportGroupTrendFieldType)
-> GetReportGroupTrend -> f GetReportGroupTrend
getReportGroupTrend_trendField = (GetReportGroupTrend -> ReportGroupTrendFieldType)
-> (GetReportGroupTrend
    -> ReportGroupTrendFieldType -> GetReportGroupTrend)
-> Lens
     GetReportGroupTrend
     GetReportGroupTrend
     ReportGroupTrendFieldType
     ReportGroupTrendFieldType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportGroupTrend' {ReportGroupTrendFieldType
trendField :: ReportGroupTrendFieldType
$sel:trendField:GetReportGroupTrend' :: GetReportGroupTrend -> ReportGroupTrendFieldType
trendField} -> ReportGroupTrendFieldType
trendField) (\s :: GetReportGroupTrend
s@GetReportGroupTrend' {} ReportGroupTrendFieldType
a -> GetReportGroupTrend
s {$sel:trendField:GetReportGroupTrend' :: ReportGroupTrendFieldType
trendField = ReportGroupTrendFieldType
a} :: GetReportGroupTrend)

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

instance Prelude.NFData GetReportGroupTrend

instance Core.ToHeaders GetReportGroupTrend where
  toHeaders :: GetReportGroupTrend -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetReportGroupTrend -> 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.GetReportGroupTrend" ::
                          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 GetReportGroupTrend where
  toJSON :: GetReportGroupTrend -> Value
toJSON GetReportGroupTrend' {Maybe Natural
Text
ReportGroupTrendFieldType
trendField :: ReportGroupTrendFieldType
reportGroupArn :: Text
numOfReports :: Maybe Natural
$sel:trendField:GetReportGroupTrend' :: GetReportGroupTrend -> ReportGroupTrendFieldType
$sel:reportGroupArn:GetReportGroupTrend' :: GetReportGroupTrend -> Text
$sel:numOfReports:GetReportGroupTrend' :: GetReportGroupTrend -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"numOfReports" 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
numOfReports,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"reportGroupArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
reportGroupArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"trendField" Text -> ReportGroupTrendFieldType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ReportGroupTrendFieldType
trendField)
          ]
      )

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

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

-- | /See:/ 'newGetReportGroupTrendResponse' smart constructor.
data GetReportGroupTrendResponse = GetReportGroupTrendResponse'
  { -- | An array that contains the raw data for each report.
    GetReportGroupTrendResponse -> Maybe [ReportWithRawData]
rawData :: Prelude.Maybe [ReportWithRawData],
    -- | Contains the accumulated trend data.
    GetReportGroupTrendResponse -> Maybe ReportGroupTrendStats
stats :: Prelude.Maybe ReportGroupTrendStats,
    -- | The response's http status code.
    GetReportGroupTrendResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetReportGroupTrendResponse -> GetReportGroupTrendResponse -> Bool
(GetReportGroupTrendResponse
 -> GetReportGroupTrendResponse -> Bool)
-> (GetReportGroupTrendResponse
    -> GetReportGroupTrendResponse -> Bool)
-> Eq GetReportGroupTrendResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReportGroupTrendResponse -> GetReportGroupTrendResponse -> Bool
$c/= :: GetReportGroupTrendResponse -> GetReportGroupTrendResponse -> Bool
== :: GetReportGroupTrendResponse -> GetReportGroupTrendResponse -> Bool
$c== :: GetReportGroupTrendResponse -> GetReportGroupTrendResponse -> Bool
Prelude.Eq, ReadPrec [GetReportGroupTrendResponse]
ReadPrec GetReportGroupTrendResponse
Int -> ReadS GetReportGroupTrendResponse
ReadS [GetReportGroupTrendResponse]
(Int -> ReadS GetReportGroupTrendResponse)
-> ReadS [GetReportGroupTrendResponse]
-> ReadPrec GetReportGroupTrendResponse
-> ReadPrec [GetReportGroupTrendResponse]
-> Read GetReportGroupTrendResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReportGroupTrendResponse]
$creadListPrec :: ReadPrec [GetReportGroupTrendResponse]
readPrec :: ReadPrec GetReportGroupTrendResponse
$creadPrec :: ReadPrec GetReportGroupTrendResponse
readList :: ReadS [GetReportGroupTrendResponse]
$creadList :: ReadS [GetReportGroupTrendResponse]
readsPrec :: Int -> ReadS GetReportGroupTrendResponse
$creadsPrec :: Int -> ReadS GetReportGroupTrendResponse
Prelude.Read, Int -> GetReportGroupTrendResponse -> ShowS
[GetReportGroupTrendResponse] -> ShowS
GetReportGroupTrendResponse -> String
(Int -> GetReportGroupTrendResponse -> ShowS)
-> (GetReportGroupTrendResponse -> String)
-> ([GetReportGroupTrendResponse] -> ShowS)
-> Show GetReportGroupTrendResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReportGroupTrendResponse] -> ShowS
$cshowList :: [GetReportGroupTrendResponse] -> ShowS
show :: GetReportGroupTrendResponse -> String
$cshow :: GetReportGroupTrendResponse -> String
showsPrec :: Int -> GetReportGroupTrendResponse -> ShowS
$cshowsPrec :: Int -> GetReportGroupTrendResponse -> ShowS
Prelude.Show, (forall x.
 GetReportGroupTrendResponse -> Rep GetReportGroupTrendResponse x)
-> (forall x.
    Rep GetReportGroupTrendResponse x -> GetReportGroupTrendResponse)
-> Generic GetReportGroupTrendResponse
forall x.
Rep GetReportGroupTrendResponse x -> GetReportGroupTrendResponse
forall x.
GetReportGroupTrendResponse -> Rep GetReportGroupTrendResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetReportGroupTrendResponse x -> GetReportGroupTrendResponse
$cfrom :: forall x.
GetReportGroupTrendResponse -> Rep GetReportGroupTrendResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetReportGroupTrendResponse' 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:
--
-- 'rawData', 'getReportGroupTrendResponse_rawData' - An array that contains the raw data for each report.
--
-- 'stats', 'getReportGroupTrendResponse_stats' - Contains the accumulated trend data.
--
-- 'httpStatus', 'getReportGroupTrendResponse_httpStatus' - The response's http status code.
newGetReportGroupTrendResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetReportGroupTrendResponse
newGetReportGroupTrendResponse :: Int -> GetReportGroupTrendResponse
newGetReportGroupTrendResponse Int
pHttpStatus_ =
  GetReportGroupTrendResponse' :: Maybe [ReportWithRawData]
-> Maybe ReportGroupTrendStats
-> Int
-> GetReportGroupTrendResponse
GetReportGroupTrendResponse'
    { $sel:rawData:GetReportGroupTrendResponse' :: Maybe [ReportWithRawData]
rawData =
        Maybe [ReportWithRawData]
forall a. Maybe a
Prelude.Nothing,
      $sel:stats:GetReportGroupTrendResponse' :: Maybe ReportGroupTrendStats
stats = Maybe ReportGroupTrendStats
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetReportGroupTrendResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array that contains the raw data for each report.
getReportGroupTrendResponse_rawData :: Lens.Lens' GetReportGroupTrendResponse (Prelude.Maybe [ReportWithRawData])
getReportGroupTrendResponse_rawData :: (Maybe [ReportWithRawData] -> f (Maybe [ReportWithRawData]))
-> GetReportGroupTrendResponse -> f GetReportGroupTrendResponse
getReportGroupTrendResponse_rawData = (GetReportGroupTrendResponse -> Maybe [ReportWithRawData])
-> (GetReportGroupTrendResponse
    -> Maybe [ReportWithRawData] -> GetReportGroupTrendResponse)
-> Lens
     GetReportGroupTrendResponse
     GetReportGroupTrendResponse
     (Maybe [ReportWithRawData])
     (Maybe [ReportWithRawData])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportGroupTrendResponse' {Maybe [ReportWithRawData]
rawData :: Maybe [ReportWithRawData]
$sel:rawData:GetReportGroupTrendResponse' :: GetReportGroupTrendResponse -> Maybe [ReportWithRawData]
rawData} -> Maybe [ReportWithRawData]
rawData) (\s :: GetReportGroupTrendResponse
s@GetReportGroupTrendResponse' {} Maybe [ReportWithRawData]
a -> GetReportGroupTrendResponse
s {$sel:rawData:GetReportGroupTrendResponse' :: Maybe [ReportWithRawData]
rawData = Maybe [ReportWithRawData]
a} :: GetReportGroupTrendResponse) ((Maybe [ReportWithRawData] -> f (Maybe [ReportWithRawData]))
 -> GetReportGroupTrendResponse -> f GetReportGroupTrendResponse)
-> ((Maybe [ReportWithRawData] -> f (Maybe [ReportWithRawData]))
    -> Maybe [ReportWithRawData] -> f (Maybe [ReportWithRawData]))
-> (Maybe [ReportWithRawData] -> f (Maybe [ReportWithRawData]))
-> GetReportGroupTrendResponse
-> f GetReportGroupTrendResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ReportWithRawData]
  [ReportWithRawData]
  [ReportWithRawData]
  [ReportWithRawData]
-> Iso
     (Maybe [ReportWithRawData])
     (Maybe [ReportWithRawData])
     (Maybe [ReportWithRawData])
     (Maybe [ReportWithRawData])
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
  [ReportWithRawData]
  [ReportWithRawData]
  [ReportWithRawData]
  [ReportWithRawData]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Contains the accumulated trend data.
getReportGroupTrendResponse_stats :: Lens.Lens' GetReportGroupTrendResponse (Prelude.Maybe ReportGroupTrendStats)
getReportGroupTrendResponse_stats :: (Maybe ReportGroupTrendStats -> f (Maybe ReportGroupTrendStats))
-> GetReportGroupTrendResponse -> f GetReportGroupTrendResponse
getReportGroupTrendResponse_stats = (GetReportGroupTrendResponse -> Maybe ReportGroupTrendStats)
-> (GetReportGroupTrendResponse
    -> Maybe ReportGroupTrendStats -> GetReportGroupTrendResponse)
-> Lens
     GetReportGroupTrendResponse
     GetReportGroupTrendResponse
     (Maybe ReportGroupTrendStats)
     (Maybe ReportGroupTrendStats)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportGroupTrendResponse' {Maybe ReportGroupTrendStats
stats :: Maybe ReportGroupTrendStats
$sel:stats:GetReportGroupTrendResponse' :: GetReportGroupTrendResponse -> Maybe ReportGroupTrendStats
stats} -> Maybe ReportGroupTrendStats
stats) (\s :: GetReportGroupTrendResponse
s@GetReportGroupTrendResponse' {} Maybe ReportGroupTrendStats
a -> GetReportGroupTrendResponse
s {$sel:stats:GetReportGroupTrendResponse' :: Maybe ReportGroupTrendStats
stats = Maybe ReportGroupTrendStats
a} :: GetReportGroupTrendResponse)

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

instance Prelude.NFData GetReportGroupTrendResponse