{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.ReportGroupTrendStats
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CodeBuild.Types.ReportGroupTrendStats where

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

-- | Contains trend statistics for a set of reports. The actual values depend
-- on the type of trend being collected. For more information, see .
--
-- /See:/ 'newReportGroupTrendStats' smart constructor.
data ReportGroupTrendStats = ReportGroupTrendStats'
  { -- | Contains the average of all values analyzed.
    ReportGroupTrendStats -> Maybe Text
average :: Prelude.Maybe Prelude.Text,
    -- | Contains the maximum value analyzed.
    ReportGroupTrendStats -> Maybe Text
max :: Prelude.Maybe Prelude.Text,
    -- | Contains the minimum value analyzed.
    ReportGroupTrendStats -> Maybe Text
min :: Prelude.Maybe Prelude.Text
  }
  deriving (ReportGroupTrendStats -> ReportGroupTrendStats -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReportGroupTrendStats -> ReportGroupTrendStats -> Bool
$c/= :: ReportGroupTrendStats -> ReportGroupTrendStats -> Bool
== :: ReportGroupTrendStats -> ReportGroupTrendStats -> Bool
$c== :: ReportGroupTrendStats -> ReportGroupTrendStats -> Bool
Prelude.Eq, ReadPrec [ReportGroupTrendStats]
ReadPrec ReportGroupTrendStats
Int -> ReadS ReportGroupTrendStats
ReadS [ReportGroupTrendStats]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReportGroupTrendStats]
$creadListPrec :: ReadPrec [ReportGroupTrendStats]
readPrec :: ReadPrec ReportGroupTrendStats
$creadPrec :: ReadPrec ReportGroupTrendStats
readList :: ReadS [ReportGroupTrendStats]
$creadList :: ReadS [ReportGroupTrendStats]
readsPrec :: Int -> ReadS ReportGroupTrendStats
$creadsPrec :: Int -> ReadS ReportGroupTrendStats
Prelude.Read, Int -> ReportGroupTrendStats -> ShowS
[ReportGroupTrendStats] -> ShowS
ReportGroupTrendStats -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReportGroupTrendStats] -> ShowS
$cshowList :: [ReportGroupTrendStats] -> ShowS
show :: ReportGroupTrendStats -> String
$cshow :: ReportGroupTrendStats -> String
showsPrec :: Int -> ReportGroupTrendStats -> ShowS
$cshowsPrec :: Int -> ReportGroupTrendStats -> ShowS
Prelude.Show, forall x. Rep ReportGroupTrendStats x -> ReportGroupTrendStats
forall x. ReportGroupTrendStats -> Rep ReportGroupTrendStats x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReportGroupTrendStats x -> ReportGroupTrendStats
$cfrom :: forall x. ReportGroupTrendStats -> Rep ReportGroupTrendStats x
Prelude.Generic)

-- |
-- Create a value of 'ReportGroupTrendStats' 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:
--
-- 'average', 'reportGroupTrendStats_average' - Contains the average of all values analyzed.
--
-- 'max', 'reportGroupTrendStats_max' - Contains the maximum value analyzed.
--
-- 'min', 'reportGroupTrendStats_min' - Contains the minimum value analyzed.
newReportGroupTrendStats ::
  ReportGroupTrendStats
newReportGroupTrendStats :: ReportGroupTrendStats
newReportGroupTrendStats =
  ReportGroupTrendStats'
    { $sel:average:ReportGroupTrendStats' :: Maybe Text
average = forall a. Maybe a
Prelude.Nothing,
      $sel:max:ReportGroupTrendStats' :: Maybe Text
max = forall a. Maybe a
Prelude.Nothing,
      $sel:min:ReportGroupTrendStats' :: Maybe Text
min = forall a. Maybe a
Prelude.Nothing
    }

-- | Contains the average of all values analyzed.
reportGroupTrendStats_average :: Lens.Lens' ReportGroupTrendStats (Prelude.Maybe Prelude.Text)
reportGroupTrendStats_average :: Lens' ReportGroupTrendStats (Maybe Text)
reportGroupTrendStats_average = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportGroupTrendStats' {Maybe Text
average :: Maybe Text
$sel:average:ReportGroupTrendStats' :: ReportGroupTrendStats -> Maybe Text
average} -> Maybe Text
average) (\s :: ReportGroupTrendStats
s@ReportGroupTrendStats' {} Maybe Text
a -> ReportGroupTrendStats
s {$sel:average:ReportGroupTrendStats' :: Maybe Text
average = Maybe Text
a} :: ReportGroupTrendStats)

-- | Contains the maximum value analyzed.
reportGroupTrendStats_max :: Lens.Lens' ReportGroupTrendStats (Prelude.Maybe Prelude.Text)
reportGroupTrendStats_max :: Lens' ReportGroupTrendStats (Maybe Text)
reportGroupTrendStats_max = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportGroupTrendStats' {Maybe Text
max :: Maybe Text
$sel:max:ReportGroupTrendStats' :: ReportGroupTrendStats -> Maybe Text
max} -> Maybe Text
max) (\s :: ReportGroupTrendStats
s@ReportGroupTrendStats' {} Maybe Text
a -> ReportGroupTrendStats
s {$sel:max:ReportGroupTrendStats' :: Maybe Text
max = Maybe Text
a} :: ReportGroupTrendStats)

-- | Contains the minimum value analyzed.
reportGroupTrendStats_min :: Lens.Lens' ReportGroupTrendStats (Prelude.Maybe Prelude.Text)
reportGroupTrendStats_min :: Lens' ReportGroupTrendStats (Maybe Text)
reportGroupTrendStats_min = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportGroupTrendStats' {Maybe Text
min :: Maybe Text
$sel:min:ReportGroupTrendStats' :: ReportGroupTrendStats -> Maybe Text
min} -> Maybe Text
min) (\s :: ReportGroupTrendStats
s@ReportGroupTrendStats' {} Maybe Text
a -> ReportGroupTrendStats
s {$sel:min:ReportGroupTrendStats' :: Maybe Text
min = Maybe Text
a} :: ReportGroupTrendStats)

instance Data.FromJSON ReportGroupTrendStats where
  parseJSON :: Value -> Parser ReportGroupTrendStats
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ReportGroupTrendStats"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> ReportGroupTrendStats
ReportGroupTrendStats'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"average")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"max")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"min")
      )

instance Prelude.Hashable ReportGroupTrendStats where
  hashWithSalt :: Int -> ReportGroupTrendStats -> Int
hashWithSalt Int
_salt ReportGroupTrendStats' {Maybe Text
min :: Maybe Text
max :: Maybe Text
average :: Maybe Text
$sel:min:ReportGroupTrendStats' :: ReportGroupTrendStats -> Maybe Text
$sel:max:ReportGroupTrendStats' :: ReportGroupTrendStats -> Maybe Text
$sel:average:ReportGroupTrendStats' :: ReportGroupTrendStats -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
average
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
max
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
min

instance Prelude.NFData ReportGroupTrendStats where
  rnf :: ReportGroupTrendStats -> ()
rnf ReportGroupTrendStats' {Maybe Text
min :: Maybe Text
max :: Maybe Text
average :: Maybe Text
$sel:min:ReportGroupTrendStats' :: ReportGroupTrendStats -> Maybe Text
$sel:max:ReportGroupTrendStats' :: ReportGroupTrendStats -> Maybe Text
$sel:average:ReportGroupTrendStats' :: ReportGroupTrendStats -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
average
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
max
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
min