{-# 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.MwAA.Types.StatisticSet
-- 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.MwAA.Types.StatisticSet where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Internal only API.
--
-- /See:/ 'newStatisticSet' smart constructor.
data StatisticSet = StatisticSet'
  { -- | Internal only API.
    StatisticSet -> Maybe Int
sampleCount :: Prelude.Maybe Prelude.Int,
    -- | Internal only API.
    StatisticSet -> Maybe Double
maximum :: Prelude.Maybe Prelude.Double,
    -- | Internal only API.
    StatisticSet -> Maybe Double
minimum :: Prelude.Maybe Prelude.Double,
    -- | Internal only API.
    StatisticSet -> Maybe Double
sum :: Prelude.Maybe Prelude.Double
  }
  deriving (StatisticSet -> StatisticSet -> Bool
(StatisticSet -> StatisticSet -> Bool)
-> (StatisticSet -> StatisticSet -> Bool) -> Eq StatisticSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StatisticSet -> StatisticSet -> Bool
$c/= :: StatisticSet -> StatisticSet -> Bool
== :: StatisticSet -> StatisticSet -> Bool
$c== :: StatisticSet -> StatisticSet -> Bool
Prelude.Eq, ReadPrec [StatisticSet]
ReadPrec StatisticSet
Int -> ReadS StatisticSet
ReadS [StatisticSet]
(Int -> ReadS StatisticSet)
-> ReadS [StatisticSet]
-> ReadPrec StatisticSet
-> ReadPrec [StatisticSet]
-> Read StatisticSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StatisticSet]
$creadListPrec :: ReadPrec [StatisticSet]
readPrec :: ReadPrec StatisticSet
$creadPrec :: ReadPrec StatisticSet
readList :: ReadS [StatisticSet]
$creadList :: ReadS [StatisticSet]
readsPrec :: Int -> ReadS StatisticSet
$creadsPrec :: Int -> ReadS StatisticSet
Prelude.Read, Int -> StatisticSet -> ShowS
[StatisticSet] -> ShowS
StatisticSet -> String
(Int -> StatisticSet -> ShowS)
-> (StatisticSet -> String)
-> ([StatisticSet] -> ShowS)
-> Show StatisticSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StatisticSet] -> ShowS
$cshowList :: [StatisticSet] -> ShowS
show :: StatisticSet -> String
$cshow :: StatisticSet -> String
showsPrec :: Int -> StatisticSet -> ShowS
$cshowsPrec :: Int -> StatisticSet -> ShowS
Prelude.Show, (forall x. StatisticSet -> Rep StatisticSet x)
-> (forall x. Rep StatisticSet x -> StatisticSet)
-> Generic StatisticSet
forall x. Rep StatisticSet x -> StatisticSet
forall x. StatisticSet -> Rep StatisticSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StatisticSet x -> StatisticSet
$cfrom :: forall x. StatisticSet -> Rep StatisticSet x
Prelude.Generic)

-- |
-- Create a value of 'StatisticSet' 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:
--
-- 'sampleCount', 'statisticSet_sampleCount' - Internal only API.
--
-- 'maximum', 'statisticSet_maximum' - Internal only API.
--
-- 'minimum', 'statisticSet_minimum' - Internal only API.
--
-- 'sum', 'statisticSet_sum' - Internal only API.
newStatisticSet ::
  StatisticSet
newStatisticSet :: StatisticSet
newStatisticSet =
  StatisticSet' :: Maybe Int
-> Maybe Double -> Maybe Double -> Maybe Double -> StatisticSet
StatisticSet'
    { $sel:sampleCount:StatisticSet' :: Maybe Int
sampleCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:maximum:StatisticSet' :: Maybe Double
maximum = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:minimum:StatisticSet' :: Maybe Double
minimum = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:sum:StatisticSet' :: Maybe Double
sum = Maybe Double
forall a. Maybe a
Prelude.Nothing
    }

-- | Internal only API.
statisticSet_sampleCount :: Lens.Lens' StatisticSet (Prelude.Maybe Prelude.Int)
statisticSet_sampleCount :: (Maybe Int -> f (Maybe Int)) -> StatisticSet -> f StatisticSet
statisticSet_sampleCount = (StatisticSet -> Maybe Int)
-> (StatisticSet -> Maybe Int -> StatisticSet)
-> Lens StatisticSet StatisticSet (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatisticSet' {Maybe Int
sampleCount :: Maybe Int
$sel:sampleCount:StatisticSet' :: StatisticSet -> Maybe Int
sampleCount} -> Maybe Int
sampleCount) (\s :: StatisticSet
s@StatisticSet' {} Maybe Int
a -> StatisticSet
s {$sel:sampleCount:StatisticSet' :: Maybe Int
sampleCount = Maybe Int
a} :: StatisticSet)

-- | Internal only API.
statisticSet_maximum :: Lens.Lens' StatisticSet (Prelude.Maybe Prelude.Double)
statisticSet_maximum :: (Maybe Double -> f (Maybe Double))
-> StatisticSet -> f StatisticSet
statisticSet_maximum = (StatisticSet -> Maybe Double)
-> (StatisticSet -> Maybe Double -> StatisticSet)
-> Lens StatisticSet StatisticSet (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatisticSet' {Maybe Double
maximum :: Maybe Double
$sel:maximum:StatisticSet' :: StatisticSet -> Maybe Double
maximum} -> Maybe Double
maximum) (\s :: StatisticSet
s@StatisticSet' {} Maybe Double
a -> StatisticSet
s {$sel:maximum:StatisticSet' :: Maybe Double
maximum = Maybe Double
a} :: StatisticSet)

-- | Internal only API.
statisticSet_minimum :: Lens.Lens' StatisticSet (Prelude.Maybe Prelude.Double)
statisticSet_minimum :: (Maybe Double -> f (Maybe Double))
-> StatisticSet -> f StatisticSet
statisticSet_minimum = (StatisticSet -> Maybe Double)
-> (StatisticSet -> Maybe Double -> StatisticSet)
-> Lens StatisticSet StatisticSet (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatisticSet' {Maybe Double
minimum :: Maybe Double
$sel:minimum:StatisticSet' :: StatisticSet -> Maybe Double
minimum} -> Maybe Double
minimum) (\s :: StatisticSet
s@StatisticSet' {} Maybe Double
a -> StatisticSet
s {$sel:minimum:StatisticSet' :: Maybe Double
minimum = Maybe Double
a} :: StatisticSet)

-- | Internal only API.
statisticSet_sum :: Lens.Lens' StatisticSet (Prelude.Maybe Prelude.Double)
statisticSet_sum :: (Maybe Double -> f (Maybe Double))
-> StatisticSet -> f StatisticSet
statisticSet_sum = (StatisticSet -> Maybe Double)
-> (StatisticSet -> Maybe Double -> StatisticSet)
-> Lens StatisticSet StatisticSet (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatisticSet' {Maybe Double
sum :: Maybe Double
$sel:sum:StatisticSet' :: StatisticSet -> Maybe Double
sum} -> Maybe Double
sum) (\s :: StatisticSet
s@StatisticSet' {} Maybe Double
a -> StatisticSet
s {$sel:sum:StatisticSet' :: Maybe Double
sum = Maybe Double
a} :: StatisticSet)

instance Prelude.Hashable StatisticSet

instance Prelude.NFData StatisticSet

instance Core.ToJSON StatisticSet where
  toJSON :: StatisticSet -> Value
toJSON StatisticSet' {Maybe Double
Maybe Int
sum :: Maybe Double
minimum :: Maybe Double
maximum :: Maybe Double
sampleCount :: Maybe Int
$sel:sum:StatisticSet' :: StatisticSet -> Maybe Double
$sel:minimum:StatisticSet' :: StatisticSet -> Maybe Double
$sel:maximum:StatisticSet' :: StatisticSet -> Maybe Double
$sel:sampleCount:StatisticSet' :: StatisticSet -> Maybe Int
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SampleCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
sampleCount,
            (Text
"Maximum" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
maximum,
            (Text
"Minimum" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
minimum,
            (Text
"Sum" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
sum
          ]
      )