{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Shield.Types.AttackVolumeStatistics 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

-- | 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
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]
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
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. 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' {$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 :: Lens' AttackVolumeStatistics Double
attackVolumeStatistics_max = 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 Data.FromJSON AttackVolumeStatistics where
  parseJSON :: Value -> Parser AttackVolumeStatistics
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AttackVolumeStatistics"
      ( \Object
x ->
          Double -> AttackVolumeStatistics
AttackVolumeStatistics'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Max")
      )

instance Prelude.Hashable AttackVolumeStatistics where
  hashWithSalt :: Int -> AttackVolumeStatistics -> Int
hashWithSalt Int
_salt AttackVolumeStatistics' {Double
max :: Double
$sel:max:AttackVolumeStatistics' :: AttackVolumeStatistics -> Double
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
max

instance Prelude.NFData AttackVolumeStatistics where
  rnf :: AttackVolumeStatistics -> ()
rnf AttackVolumeStatistics' {Double
max :: Double
$sel:max:AttackVolumeStatistics' :: AttackVolumeStatistics -> Double
..} = forall a. NFData a => a -> ()
Prelude.rnf Double
max