{-# 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 #-}
module Amazonka.Shield.Types.AttackVolume 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
import Amazonka.Shield.Types.AttackVolumeStatistics
data AttackVolume = AttackVolume'
{
AttackVolume -> Maybe AttackVolumeStatistics
bitsPerSecond :: Prelude.Maybe AttackVolumeStatistics,
AttackVolume -> Maybe AttackVolumeStatistics
packetsPerSecond :: Prelude.Maybe AttackVolumeStatistics,
AttackVolume -> Maybe AttackVolumeStatistics
requestsPerSecond :: Prelude.Maybe AttackVolumeStatistics
}
deriving (AttackVolume -> AttackVolume -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttackVolume -> AttackVolume -> Bool
$c/= :: AttackVolume -> AttackVolume -> Bool
== :: AttackVolume -> AttackVolume -> Bool
$c== :: AttackVolume -> AttackVolume -> Bool
Prelude.Eq, ReadPrec [AttackVolume]
ReadPrec AttackVolume
Int -> ReadS AttackVolume
ReadS [AttackVolume]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttackVolume]
$creadListPrec :: ReadPrec [AttackVolume]
readPrec :: ReadPrec AttackVolume
$creadPrec :: ReadPrec AttackVolume
readList :: ReadS [AttackVolume]
$creadList :: ReadS [AttackVolume]
readsPrec :: Int -> ReadS AttackVolume
$creadsPrec :: Int -> ReadS AttackVolume
Prelude.Read, Int -> AttackVolume -> ShowS
[AttackVolume] -> ShowS
AttackVolume -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttackVolume] -> ShowS
$cshowList :: [AttackVolume] -> ShowS
show :: AttackVolume -> String
$cshow :: AttackVolume -> String
showsPrec :: Int -> AttackVolume -> ShowS
$cshowsPrec :: Int -> AttackVolume -> ShowS
Prelude.Show, forall x. Rep AttackVolume x -> AttackVolume
forall x. AttackVolume -> Rep AttackVolume x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttackVolume x -> AttackVolume
$cfrom :: forall x. AttackVolume -> Rep AttackVolume x
Prelude.Generic)
newAttackVolume ::
AttackVolume
newAttackVolume :: AttackVolume
newAttackVolume =
AttackVolume'
{ $sel:bitsPerSecond:AttackVolume' :: Maybe AttackVolumeStatistics
bitsPerSecond = forall a. Maybe a
Prelude.Nothing,
$sel:packetsPerSecond:AttackVolume' :: Maybe AttackVolumeStatistics
packetsPerSecond = forall a. Maybe a
Prelude.Nothing,
$sel:requestsPerSecond:AttackVolume' :: Maybe AttackVolumeStatistics
requestsPerSecond = forall a. Maybe a
Prelude.Nothing
}
attackVolume_bitsPerSecond :: Lens.Lens' AttackVolume (Prelude.Maybe AttackVolumeStatistics)
attackVolume_bitsPerSecond :: Lens' AttackVolume (Maybe AttackVolumeStatistics)
attackVolume_bitsPerSecond = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttackVolume' {Maybe AttackVolumeStatistics
bitsPerSecond :: Maybe AttackVolumeStatistics
$sel:bitsPerSecond:AttackVolume' :: AttackVolume -> Maybe AttackVolumeStatistics
bitsPerSecond} -> Maybe AttackVolumeStatistics
bitsPerSecond) (\s :: AttackVolume
s@AttackVolume' {} Maybe AttackVolumeStatistics
a -> AttackVolume
s {$sel:bitsPerSecond:AttackVolume' :: Maybe AttackVolumeStatistics
bitsPerSecond = Maybe AttackVolumeStatistics
a} :: AttackVolume)
attackVolume_packetsPerSecond :: Lens.Lens' AttackVolume (Prelude.Maybe AttackVolumeStatistics)
attackVolume_packetsPerSecond :: Lens' AttackVolume (Maybe AttackVolumeStatistics)
attackVolume_packetsPerSecond = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttackVolume' {Maybe AttackVolumeStatistics
packetsPerSecond :: Maybe AttackVolumeStatistics
$sel:packetsPerSecond:AttackVolume' :: AttackVolume -> Maybe AttackVolumeStatistics
packetsPerSecond} -> Maybe AttackVolumeStatistics
packetsPerSecond) (\s :: AttackVolume
s@AttackVolume' {} Maybe AttackVolumeStatistics
a -> AttackVolume
s {$sel:packetsPerSecond:AttackVolume' :: Maybe AttackVolumeStatistics
packetsPerSecond = Maybe AttackVolumeStatistics
a} :: AttackVolume)
attackVolume_requestsPerSecond :: Lens.Lens' AttackVolume (Prelude.Maybe AttackVolumeStatistics)
attackVolume_requestsPerSecond :: Lens' AttackVolume (Maybe AttackVolumeStatistics)
attackVolume_requestsPerSecond = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttackVolume' {Maybe AttackVolumeStatistics
requestsPerSecond :: Maybe AttackVolumeStatistics
$sel:requestsPerSecond:AttackVolume' :: AttackVolume -> Maybe AttackVolumeStatistics
requestsPerSecond} -> Maybe AttackVolumeStatistics
requestsPerSecond) (\s :: AttackVolume
s@AttackVolume' {} Maybe AttackVolumeStatistics
a -> AttackVolume
s {$sel:requestsPerSecond:AttackVolume' :: Maybe AttackVolumeStatistics
requestsPerSecond = Maybe AttackVolumeStatistics
a} :: AttackVolume)
instance Data.FromJSON AttackVolume where
parseJSON :: Value -> Parser AttackVolume
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AttackVolume"
( \Object
x ->
Maybe AttackVolumeStatistics
-> Maybe AttackVolumeStatistics
-> Maybe AttackVolumeStatistics
-> AttackVolume
AttackVolume'
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
"BitsPerSecond")
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
"PacketsPerSecond")
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
"RequestsPerSecond")
)
instance Prelude.Hashable AttackVolume where
hashWithSalt :: Int -> AttackVolume -> Int
hashWithSalt Int
_salt AttackVolume' {Maybe AttackVolumeStatistics
requestsPerSecond :: Maybe AttackVolumeStatistics
packetsPerSecond :: Maybe AttackVolumeStatistics
bitsPerSecond :: Maybe AttackVolumeStatistics
$sel:requestsPerSecond:AttackVolume' :: AttackVolume -> Maybe AttackVolumeStatistics
$sel:packetsPerSecond:AttackVolume' :: AttackVolume -> Maybe AttackVolumeStatistics
$sel:bitsPerSecond:AttackVolume' :: AttackVolume -> Maybe AttackVolumeStatistics
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AttackVolumeStatistics
bitsPerSecond
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AttackVolumeStatistics
packetsPerSecond
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AttackVolumeStatistics
requestsPerSecond
instance Prelude.NFData AttackVolume where
rnf :: AttackVolume -> ()
rnf AttackVolume' {Maybe AttackVolumeStatistics
requestsPerSecond :: Maybe AttackVolumeStatistics
packetsPerSecond :: Maybe AttackVolumeStatistics
bitsPerSecond :: Maybe AttackVolumeStatistics
$sel:requestsPerSecond:AttackVolume' :: AttackVolume -> Maybe AttackVolumeStatistics
$sel:packetsPerSecond:AttackVolume' :: AttackVolume -> Maybe AttackVolumeStatistics
$sel:bitsPerSecond:AttackVolume' :: AttackVolume -> Maybe AttackVolumeStatistics
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AttackVolumeStatistics
bitsPerSecond
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AttackVolumeStatistics
packetsPerSecond
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AttackVolumeStatistics
requestsPerSecond