{-# 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-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)
module Amazonka.CodeBuild.Types.ReportGroupTrendStats where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 maximum value analyzed.
    ReportGroupTrendStats -> Maybe Text
max :: Prelude.Maybe Prelude.Text,
    -- | Contains the average of all values analyzed.
    ReportGroupTrendStats -> Maybe Text
average :: Prelude.Maybe Prelude.Text,
    -- | Contains the minimum value analyzed.
    ReportGroupTrendStats -> Maybe Text
min :: Prelude.Maybe Prelude.Text
  }
  deriving (ReportGroupTrendStats -> ReportGroupTrendStats -> Bool
(ReportGroupTrendStats -> ReportGroupTrendStats -> Bool)
-> (ReportGroupTrendStats -> ReportGroupTrendStats -> Bool)
-> Eq ReportGroupTrendStats
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]
(Int -> ReadS ReportGroupTrendStats)
-> ReadS [ReportGroupTrendStats]
-> ReadPrec ReportGroupTrendStats
-> ReadPrec [ReportGroupTrendStats]
-> Read 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
(Int -> ReportGroupTrendStats -> ShowS)
-> (ReportGroupTrendStats -> String)
-> ([ReportGroupTrendStats] -> ShowS)
-> Show ReportGroupTrendStats
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. ReportGroupTrendStats -> Rep ReportGroupTrendStats x)
-> (forall x. Rep ReportGroupTrendStats x -> ReportGroupTrendStats)
-> Generic ReportGroupTrendStats
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:
--
-- 'max', 'reportGroupTrendStats_max' - Contains the maximum value analyzed.
--
-- 'average', 'reportGroupTrendStats_average' - Contains the average of all values analyzed.
--
-- 'min', 'reportGroupTrendStats_min' - Contains the minimum value analyzed.
newReportGroupTrendStats ::
  ReportGroupTrendStats
newReportGroupTrendStats :: ReportGroupTrendStats
newReportGroupTrendStats =
  ReportGroupTrendStats' :: Maybe Text -> Maybe Text -> Maybe Text -> ReportGroupTrendStats
ReportGroupTrendStats'
    { $sel:max:ReportGroupTrendStats' :: Maybe Text
max = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:average:ReportGroupTrendStats' :: Maybe Text
average = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:min:ReportGroupTrendStats' :: Maybe Text
min = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Contains the maximum value analyzed.
reportGroupTrendStats_max :: Lens.Lens' ReportGroupTrendStats (Prelude.Maybe Prelude.Text)
reportGroupTrendStats_max :: (Maybe Text -> f (Maybe Text))
-> ReportGroupTrendStats -> f ReportGroupTrendStats
reportGroupTrendStats_max = (ReportGroupTrendStats -> Maybe Text)
-> (ReportGroupTrendStats -> Maybe Text -> ReportGroupTrendStats)
-> Lens
     ReportGroupTrendStats
     ReportGroupTrendStats
     (Maybe Text)
     (Maybe Text)
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 average of all values analyzed.
reportGroupTrendStats_average :: Lens.Lens' ReportGroupTrendStats (Prelude.Maybe Prelude.Text)
reportGroupTrendStats_average :: (Maybe Text -> f (Maybe Text))
-> ReportGroupTrendStats -> f ReportGroupTrendStats
reportGroupTrendStats_average = (ReportGroupTrendStats -> Maybe Text)
-> (ReportGroupTrendStats -> Maybe Text -> ReportGroupTrendStats)
-> Lens
     ReportGroupTrendStats
     ReportGroupTrendStats
     (Maybe Text)
     (Maybe Text)
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 minimum value analyzed.
reportGroupTrendStats_min :: Lens.Lens' ReportGroupTrendStats (Prelude.Maybe Prelude.Text)
reportGroupTrendStats_min :: (Maybe Text -> f (Maybe Text))
-> ReportGroupTrendStats -> f ReportGroupTrendStats
reportGroupTrendStats_min = (ReportGroupTrendStats -> Maybe Text)
-> (ReportGroupTrendStats -> Maybe Text -> ReportGroupTrendStats)
-> Lens
     ReportGroupTrendStats
     ReportGroupTrendStats
     (Maybe Text)
     (Maybe Text)
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 Core.FromJSON ReportGroupTrendStats where
  parseJSON :: Value -> Parser ReportGroupTrendStats
parseJSON =
    String
-> (Object -> Parser ReportGroupTrendStats)
-> Value
-> Parser ReportGroupTrendStats
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ReportGroupTrendStats"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> ReportGroupTrendStats
ReportGroupTrendStats'
            (Maybe Text -> Maybe Text -> Maybe Text -> ReportGroupTrendStats)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ReportGroupTrendStats)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"max")
            Parser (Maybe Text -> Maybe Text -> ReportGroupTrendStats)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ReportGroupTrendStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"average")
            Parser (Maybe Text -> ReportGroupTrendStats)
-> Parser (Maybe Text) -> Parser ReportGroupTrendStats
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"min")
      )

instance Prelude.Hashable ReportGroupTrendStats

instance Prelude.NFData ReportGroupTrendStats