{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Shield.Types.AttackVolumeStatistics
data AttackVolume = AttackVolume'
{
AttackVolume -> Maybe AttackVolumeStatistics
packetsPerSecond :: Prelude.Maybe AttackVolumeStatistics,
AttackVolume -> Maybe AttackVolumeStatistics
requestsPerSecond :: Prelude.Maybe AttackVolumeStatistics,
AttackVolume -> Maybe AttackVolumeStatistics
bitsPerSecond :: Prelude.Maybe AttackVolumeStatistics
}
deriving (AttackVolume -> AttackVolume -> Bool
(AttackVolume -> AttackVolume -> Bool)
-> (AttackVolume -> AttackVolume -> Bool) -> Eq AttackVolume
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]
(Int -> ReadS AttackVolume)
-> ReadS [AttackVolume]
-> ReadPrec AttackVolume
-> ReadPrec [AttackVolume]
-> Read 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
(Int -> AttackVolume -> ShowS)
-> (AttackVolume -> String)
-> ([AttackVolume] -> ShowS)
-> Show AttackVolume
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. AttackVolume -> Rep AttackVolume x)
-> (forall x. Rep AttackVolume x -> AttackVolume)
-> Generic AttackVolume
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' :: Maybe AttackVolumeStatistics
-> Maybe AttackVolumeStatistics
-> Maybe AttackVolumeStatistics
-> AttackVolume
AttackVolume'
{ $sel:packetsPerSecond:AttackVolume' :: Maybe AttackVolumeStatistics
packetsPerSecond = Maybe AttackVolumeStatistics
forall a. Maybe a
Prelude.Nothing,
$sel:requestsPerSecond:AttackVolume' :: Maybe AttackVolumeStatistics
requestsPerSecond = Maybe AttackVolumeStatistics
forall a. Maybe a
Prelude.Nothing,
$sel:bitsPerSecond:AttackVolume' :: Maybe AttackVolumeStatistics
bitsPerSecond = Maybe AttackVolumeStatistics
forall a. Maybe a
Prelude.Nothing
}
attackVolume_packetsPerSecond :: Lens.Lens' AttackVolume (Prelude.Maybe AttackVolumeStatistics)
attackVolume_packetsPerSecond :: (Maybe AttackVolumeStatistics -> f (Maybe AttackVolumeStatistics))
-> AttackVolume -> f AttackVolume
attackVolume_packetsPerSecond = (AttackVolume -> Maybe AttackVolumeStatistics)
-> (AttackVolume -> Maybe AttackVolumeStatistics -> AttackVolume)
-> Lens
AttackVolume
AttackVolume
(Maybe AttackVolumeStatistics)
(Maybe AttackVolumeStatistics)
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 :: (Maybe AttackVolumeStatistics -> f (Maybe AttackVolumeStatistics))
-> AttackVolume -> f AttackVolume
attackVolume_requestsPerSecond = (AttackVolume -> Maybe AttackVolumeStatistics)
-> (AttackVolume -> Maybe AttackVolumeStatistics -> AttackVolume)
-> Lens
AttackVolume
AttackVolume
(Maybe AttackVolumeStatistics)
(Maybe AttackVolumeStatistics)
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)
attackVolume_bitsPerSecond :: Lens.Lens' AttackVolume (Prelude.Maybe AttackVolumeStatistics)
attackVolume_bitsPerSecond :: (Maybe AttackVolumeStatistics -> f (Maybe AttackVolumeStatistics))
-> AttackVolume -> f AttackVolume
attackVolume_bitsPerSecond = (AttackVolume -> Maybe AttackVolumeStatistics)
-> (AttackVolume -> Maybe AttackVolumeStatistics -> AttackVolume)
-> Lens
AttackVolume
AttackVolume
(Maybe AttackVolumeStatistics)
(Maybe AttackVolumeStatistics)
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)
instance Core.FromJSON AttackVolume where
parseJSON :: Value -> Parser AttackVolume
parseJSON =
String
-> (Object -> Parser AttackVolume) -> Value -> Parser AttackVolume
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AttackVolume"
( \Object
x ->
Maybe AttackVolumeStatistics
-> Maybe AttackVolumeStatistics
-> Maybe AttackVolumeStatistics
-> AttackVolume
AttackVolume'
(Maybe AttackVolumeStatistics
-> Maybe AttackVolumeStatistics
-> Maybe AttackVolumeStatistics
-> AttackVolume)
-> Parser (Maybe AttackVolumeStatistics)
-> Parser
(Maybe AttackVolumeStatistics
-> Maybe AttackVolumeStatistics -> AttackVolume)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AttackVolumeStatistics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PacketsPerSecond")
Parser
(Maybe AttackVolumeStatistics
-> Maybe AttackVolumeStatistics -> AttackVolume)
-> Parser (Maybe AttackVolumeStatistics)
-> Parser (Maybe AttackVolumeStatistics -> AttackVolume)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AttackVolumeStatistics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RequestsPerSecond")
Parser (Maybe AttackVolumeStatistics -> AttackVolume)
-> Parser (Maybe AttackVolumeStatistics) -> Parser AttackVolume
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AttackVolumeStatistics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BitsPerSecond")
)
instance Prelude.Hashable AttackVolume
instance Prelude.NFData AttackVolume