{-# 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.AttackStatisticsDataItem 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.AttackVolume
data AttackStatisticsDataItem = AttackStatisticsDataItem'
{
AttackStatisticsDataItem -> Maybe AttackVolume
attackVolume :: Prelude.Maybe AttackVolume,
AttackStatisticsDataItem -> Integer
attackCount :: Prelude.Integer
}
deriving (AttackStatisticsDataItem -> AttackStatisticsDataItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttackStatisticsDataItem -> AttackStatisticsDataItem -> Bool
$c/= :: AttackStatisticsDataItem -> AttackStatisticsDataItem -> Bool
== :: AttackStatisticsDataItem -> AttackStatisticsDataItem -> Bool
$c== :: AttackStatisticsDataItem -> AttackStatisticsDataItem -> Bool
Prelude.Eq, ReadPrec [AttackStatisticsDataItem]
ReadPrec AttackStatisticsDataItem
Int -> ReadS AttackStatisticsDataItem
ReadS [AttackStatisticsDataItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttackStatisticsDataItem]
$creadListPrec :: ReadPrec [AttackStatisticsDataItem]
readPrec :: ReadPrec AttackStatisticsDataItem
$creadPrec :: ReadPrec AttackStatisticsDataItem
readList :: ReadS [AttackStatisticsDataItem]
$creadList :: ReadS [AttackStatisticsDataItem]
readsPrec :: Int -> ReadS AttackStatisticsDataItem
$creadsPrec :: Int -> ReadS AttackStatisticsDataItem
Prelude.Read, Int -> AttackStatisticsDataItem -> ShowS
[AttackStatisticsDataItem] -> ShowS
AttackStatisticsDataItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttackStatisticsDataItem] -> ShowS
$cshowList :: [AttackStatisticsDataItem] -> ShowS
show :: AttackStatisticsDataItem -> String
$cshow :: AttackStatisticsDataItem -> String
showsPrec :: Int -> AttackStatisticsDataItem -> ShowS
$cshowsPrec :: Int -> AttackStatisticsDataItem -> ShowS
Prelude.Show, forall x.
Rep AttackStatisticsDataItem x -> AttackStatisticsDataItem
forall x.
AttackStatisticsDataItem -> Rep AttackStatisticsDataItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AttackStatisticsDataItem x -> AttackStatisticsDataItem
$cfrom :: forall x.
AttackStatisticsDataItem -> Rep AttackStatisticsDataItem x
Prelude.Generic)
newAttackStatisticsDataItem ::
Prelude.Integer ->
AttackStatisticsDataItem
newAttackStatisticsDataItem :: Integer -> AttackStatisticsDataItem
newAttackStatisticsDataItem Integer
pAttackCount_ =
AttackStatisticsDataItem'
{ $sel:attackVolume:AttackStatisticsDataItem' :: Maybe AttackVolume
attackVolume =
forall a. Maybe a
Prelude.Nothing,
$sel:attackCount:AttackStatisticsDataItem' :: Integer
attackCount = Integer
pAttackCount_
}
attackStatisticsDataItem_attackVolume :: Lens.Lens' AttackStatisticsDataItem (Prelude.Maybe AttackVolume)
attackStatisticsDataItem_attackVolume :: Lens' AttackStatisticsDataItem (Maybe AttackVolume)
attackStatisticsDataItem_attackVolume = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttackStatisticsDataItem' {Maybe AttackVolume
attackVolume :: Maybe AttackVolume
$sel:attackVolume:AttackStatisticsDataItem' :: AttackStatisticsDataItem -> Maybe AttackVolume
attackVolume} -> Maybe AttackVolume
attackVolume) (\s :: AttackStatisticsDataItem
s@AttackStatisticsDataItem' {} Maybe AttackVolume
a -> AttackStatisticsDataItem
s {$sel:attackVolume:AttackStatisticsDataItem' :: Maybe AttackVolume
attackVolume = Maybe AttackVolume
a} :: AttackStatisticsDataItem)
attackStatisticsDataItem_attackCount :: Lens.Lens' AttackStatisticsDataItem Prelude.Integer
attackStatisticsDataItem_attackCount :: Lens' AttackStatisticsDataItem Integer
attackStatisticsDataItem_attackCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttackStatisticsDataItem' {Integer
attackCount :: Integer
$sel:attackCount:AttackStatisticsDataItem' :: AttackStatisticsDataItem -> Integer
attackCount} -> Integer
attackCount) (\s :: AttackStatisticsDataItem
s@AttackStatisticsDataItem' {} Integer
a -> AttackStatisticsDataItem
s {$sel:attackCount:AttackStatisticsDataItem' :: Integer
attackCount = Integer
a} :: AttackStatisticsDataItem)
instance Data.FromJSON AttackStatisticsDataItem where
parseJSON :: Value -> Parser AttackStatisticsDataItem
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AttackStatisticsDataItem"
( \Object
x ->
Maybe AttackVolume -> Integer -> AttackStatisticsDataItem
AttackStatisticsDataItem'
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
"AttackVolume")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"AttackCount")
)
instance Prelude.Hashable AttackStatisticsDataItem where
hashWithSalt :: Int -> AttackStatisticsDataItem -> Int
hashWithSalt Int
_salt AttackStatisticsDataItem' {Integer
Maybe AttackVolume
attackCount :: Integer
attackVolume :: Maybe AttackVolume
$sel:attackCount:AttackStatisticsDataItem' :: AttackStatisticsDataItem -> Integer
$sel:attackVolume:AttackStatisticsDataItem' :: AttackStatisticsDataItem -> Maybe AttackVolume
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AttackVolume
attackVolume
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
attackCount
instance Prelude.NFData AttackStatisticsDataItem where
rnf :: AttackStatisticsDataItem -> ()
rnf AttackStatisticsDataItem' {Integer
Maybe AttackVolume
attackCount :: Integer
attackVolume :: Maybe AttackVolume
$sel:attackCount:AttackStatisticsDataItem' :: AttackStatisticsDataItem -> Integer
$sel:attackVolume:AttackStatisticsDataItem' :: AttackStatisticsDataItem -> Maybe AttackVolume
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AttackVolume
attackVolume
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
attackCount