{-# 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.Shield.Types.AttackVolumeStatistics
-- 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.Shield.Types.AttackVolumeStatistics where

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

-- | Statistics objects for the various data types in AttackVolume.
--
-- /See:/ 'newAttackVolumeStatistics' smart constructor.
data AttackVolumeStatistics = AttackVolumeStatistics'
  { -- | The maximum attack volume observed for the given unit.
    AttackVolumeStatistics -> Double
max :: Prelude.Double
  }
  deriving (AttackVolumeStatistics -> AttackVolumeStatistics -> Bool
(AttackVolumeStatistics -> AttackVolumeStatistics -> Bool)
-> (AttackVolumeStatistics -> AttackVolumeStatistics -> Bool)
-> Eq AttackVolumeStatistics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttackVolumeStatistics -> AttackVolumeStatistics -> Bool
$c/= :: AttackVolumeStatistics -> AttackVolumeStatistics -> Bool
== :: AttackVolumeStatistics -> AttackVolumeStatistics -> Bool
$c== :: AttackVolumeStatistics -> AttackVolumeStatistics -> Bool
Prelude.Eq, ReadPrec [AttackVolumeStatistics]
ReadPrec AttackVolumeStatistics
Int -> ReadS AttackVolumeStatistics
ReadS [AttackVolumeStatistics]
(Int -> ReadS AttackVolumeStatistics)
-> ReadS [AttackVolumeStatistics]
-> ReadPrec AttackVolumeStatistics
-> ReadPrec [AttackVolumeStatistics]
-> Read AttackVolumeStatistics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttackVolumeStatistics]
$creadListPrec :: ReadPrec [AttackVolumeStatistics]
readPrec :: ReadPrec AttackVolumeStatistics
$creadPrec :: ReadPrec AttackVolumeStatistics
readList :: ReadS [AttackVolumeStatistics]
$creadList :: ReadS [AttackVolumeStatistics]
readsPrec :: Int -> ReadS AttackVolumeStatistics
$creadsPrec :: Int -> ReadS AttackVolumeStatistics
Prelude.Read, Int -> AttackVolumeStatistics -> ShowS
[AttackVolumeStatistics] -> ShowS
AttackVolumeStatistics -> String
(Int -> AttackVolumeStatistics -> ShowS)
-> (AttackVolumeStatistics -> String)
-> ([AttackVolumeStatistics] -> ShowS)
-> Show AttackVolumeStatistics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttackVolumeStatistics] -> ShowS
$cshowList :: [AttackVolumeStatistics] -> ShowS
show :: AttackVolumeStatistics -> String
$cshow :: AttackVolumeStatistics -> String
showsPrec :: Int -> AttackVolumeStatistics -> ShowS
$cshowsPrec :: Int -> AttackVolumeStatistics -> ShowS
Prelude.Show, (forall x. AttackVolumeStatistics -> Rep AttackVolumeStatistics x)
-> (forall x.
    Rep AttackVolumeStatistics x -> AttackVolumeStatistics)
-> Generic AttackVolumeStatistics
forall x. Rep AttackVolumeStatistics x -> AttackVolumeStatistics
forall x. AttackVolumeStatistics -> Rep AttackVolumeStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttackVolumeStatistics x -> AttackVolumeStatistics
$cfrom :: forall x. AttackVolumeStatistics -> Rep AttackVolumeStatistics x
Prelude.Generic)

-- |
-- Create a value of 'AttackVolumeStatistics' 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', 'attackVolumeStatistics_max' - The maximum attack volume observed for the given unit.
newAttackVolumeStatistics ::
  -- | 'max'
  Prelude.Double ->
  AttackVolumeStatistics
newAttackVolumeStatistics :: Double -> AttackVolumeStatistics
newAttackVolumeStatistics Double
pMax_ =
  AttackVolumeStatistics' :: Double -> AttackVolumeStatistics
AttackVolumeStatistics' {$sel:max:AttackVolumeStatistics' :: Double
max = Double
pMax_}

-- | The maximum attack volume observed for the given unit.
attackVolumeStatistics_max :: Lens.Lens' AttackVolumeStatistics Prelude.Double
attackVolumeStatistics_max :: (Double -> f Double)
-> AttackVolumeStatistics -> f AttackVolumeStatistics
attackVolumeStatistics_max = (AttackVolumeStatistics -> Double)
-> (AttackVolumeStatistics -> Double -> AttackVolumeStatistics)
-> Lens AttackVolumeStatistics AttackVolumeStatistics Double Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttackVolumeStatistics' {Double
max :: Double
$sel:max:AttackVolumeStatistics' :: AttackVolumeStatistics -> Double
max} -> Double
max) (\s :: AttackVolumeStatistics
s@AttackVolumeStatistics' {} Double
a -> AttackVolumeStatistics
s {$sel:max:AttackVolumeStatistics' :: Double
max = Double
a} :: AttackVolumeStatistics)

instance Core.FromJSON AttackVolumeStatistics where
  parseJSON :: Value -> Parser AttackVolumeStatistics
parseJSON =
    String
-> (Object -> Parser AttackVolumeStatistics)
-> Value
-> Parser AttackVolumeStatistics
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AttackVolumeStatistics"
      ( \Object
x ->
          Double -> AttackVolumeStatistics
AttackVolumeStatistics'
            (Double -> AttackVolumeStatistics)
-> Parser Double -> Parser AttackVolumeStatistics
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Max")
      )

instance Prelude.Hashable AttackVolumeStatistics

instance Prelude.NFData AttackVolumeStatistics