{-# 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.Lens as Lens
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
(AttackStatisticsDataItem -> AttackStatisticsDataItem -> Bool)
-> (AttackStatisticsDataItem -> AttackStatisticsDataItem -> Bool)
-> Eq AttackStatisticsDataItem
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]
(Int -> ReadS AttackStatisticsDataItem)
-> ReadS [AttackStatisticsDataItem]
-> ReadPrec AttackStatisticsDataItem
-> ReadPrec [AttackStatisticsDataItem]
-> Read 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
(Int -> AttackStatisticsDataItem -> ShowS)
-> (AttackStatisticsDataItem -> String)
-> ([AttackStatisticsDataItem] -> ShowS)
-> Show AttackStatisticsDataItem
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.
AttackStatisticsDataItem -> Rep AttackStatisticsDataItem x)
-> (forall x.
Rep AttackStatisticsDataItem x -> AttackStatisticsDataItem)
-> Generic AttackStatisticsDataItem
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' :: Maybe AttackVolume -> Integer -> AttackStatisticsDataItem
AttackStatisticsDataItem'
{ $sel:attackVolume:AttackStatisticsDataItem' :: Maybe AttackVolume
attackVolume =
Maybe AttackVolume
forall a. Maybe a
Prelude.Nothing,
$sel:attackCount:AttackStatisticsDataItem' :: Integer
attackCount = Integer
pAttackCount_
}
attackStatisticsDataItem_attackVolume :: Lens.Lens' AttackStatisticsDataItem (Prelude.Maybe AttackVolume)
attackStatisticsDataItem_attackVolume :: (Maybe AttackVolume -> f (Maybe AttackVolume))
-> AttackStatisticsDataItem -> f AttackStatisticsDataItem
attackStatisticsDataItem_attackVolume = (AttackStatisticsDataItem -> Maybe AttackVolume)
-> (AttackStatisticsDataItem
-> Maybe AttackVolume -> AttackStatisticsDataItem)
-> Lens
AttackStatisticsDataItem
AttackStatisticsDataItem
(Maybe AttackVolume)
(Maybe 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 :: (Integer -> f Integer)
-> AttackStatisticsDataItem -> f AttackStatisticsDataItem
attackStatisticsDataItem_attackCount = (AttackStatisticsDataItem -> Integer)
-> (AttackStatisticsDataItem
-> Integer -> AttackStatisticsDataItem)
-> Lens
AttackStatisticsDataItem AttackStatisticsDataItem Integer Integer
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 Core.FromJSON AttackStatisticsDataItem where
parseJSON :: Value -> Parser AttackStatisticsDataItem
parseJSON =
String
-> (Object -> Parser AttackStatisticsDataItem)
-> Value
-> Parser AttackStatisticsDataItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AttackStatisticsDataItem"
( \Object
x ->
Maybe AttackVolume -> Integer -> AttackStatisticsDataItem
AttackStatisticsDataItem'
(Maybe AttackVolume -> Integer -> AttackStatisticsDataItem)
-> Parser (Maybe AttackVolume)
-> Parser (Integer -> AttackStatisticsDataItem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AttackVolume)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AttackVolume")
Parser (Integer -> AttackStatisticsDataItem)
-> Parser Integer -> Parser AttackStatisticsDataItem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AttackCount")
)
instance Prelude.Hashable AttackStatisticsDataItem
instance Prelude.NFData AttackStatisticsDataItem