{-# 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.AttackSummary 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.AttackVectorDescription
data AttackSummary = AttackSummary'
{
AttackSummary -> Maybe Text
attackId :: Prelude.Maybe Prelude.Text,
AttackSummary -> Maybe [AttackVectorDescription]
attackVectors :: Prelude.Maybe [AttackVectorDescription],
AttackSummary -> Maybe POSIX
endTime :: Prelude.Maybe Data.POSIX,
AttackSummary -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text,
AttackSummary -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX
}
deriving (AttackSummary -> AttackSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttackSummary -> AttackSummary -> Bool
$c/= :: AttackSummary -> AttackSummary -> Bool
== :: AttackSummary -> AttackSummary -> Bool
$c== :: AttackSummary -> AttackSummary -> Bool
Prelude.Eq, ReadPrec [AttackSummary]
ReadPrec AttackSummary
Int -> ReadS AttackSummary
ReadS [AttackSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttackSummary]
$creadListPrec :: ReadPrec [AttackSummary]
readPrec :: ReadPrec AttackSummary
$creadPrec :: ReadPrec AttackSummary
readList :: ReadS [AttackSummary]
$creadList :: ReadS [AttackSummary]
readsPrec :: Int -> ReadS AttackSummary
$creadsPrec :: Int -> ReadS AttackSummary
Prelude.Read, Int -> AttackSummary -> ShowS
[AttackSummary] -> ShowS
AttackSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttackSummary] -> ShowS
$cshowList :: [AttackSummary] -> ShowS
show :: AttackSummary -> String
$cshow :: AttackSummary -> String
showsPrec :: Int -> AttackSummary -> ShowS
$cshowsPrec :: Int -> AttackSummary -> ShowS
Prelude.Show, forall x. Rep AttackSummary x -> AttackSummary
forall x. AttackSummary -> Rep AttackSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttackSummary x -> AttackSummary
$cfrom :: forall x. AttackSummary -> Rep AttackSummary x
Prelude.Generic)
newAttackSummary ::
AttackSummary
newAttackSummary :: AttackSummary
newAttackSummary =
AttackSummary'
{ $sel:attackId:AttackSummary' :: Maybe Text
attackId = forall a. Maybe a
Prelude.Nothing,
$sel:attackVectors:AttackSummary' :: Maybe [AttackVectorDescription]
attackVectors = forall a. Maybe a
Prelude.Nothing,
$sel:endTime:AttackSummary' :: Maybe POSIX
endTime = forall a. Maybe a
Prelude.Nothing,
$sel:resourceArn:AttackSummary' :: Maybe Text
resourceArn = forall a. Maybe a
Prelude.Nothing,
$sel:startTime:AttackSummary' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing
}
attackSummary_attackId :: Lens.Lens' AttackSummary (Prelude.Maybe Prelude.Text)
attackSummary_attackId :: Lens' AttackSummary (Maybe Text)
attackSummary_attackId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttackSummary' {Maybe Text
attackId :: Maybe Text
$sel:attackId:AttackSummary' :: AttackSummary -> Maybe Text
attackId} -> Maybe Text
attackId) (\s :: AttackSummary
s@AttackSummary' {} Maybe Text
a -> AttackSummary
s {$sel:attackId:AttackSummary' :: Maybe Text
attackId = Maybe Text
a} :: AttackSummary)
attackSummary_attackVectors :: Lens.Lens' AttackSummary (Prelude.Maybe [AttackVectorDescription])
attackSummary_attackVectors :: Lens' AttackSummary (Maybe [AttackVectorDescription])
attackSummary_attackVectors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttackSummary' {Maybe [AttackVectorDescription]
attackVectors :: Maybe [AttackVectorDescription]
$sel:attackVectors:AttackSummary' :: AttackSummary -> Maybe [AttackVectorDescription]
attackVectors} -> Maybe [AttackVectorDescription]
attackVectors) (\s :: AttackSummary
s@AttackSummary' {} Maybe [AttackVectorDescription]
a -> AttackSummary
s {$sel:attackVectors:AttackSummary' :: Maybe [AttackVectorDescription]
attackVectors = Maybe [AttackVectorDescription]
a} :: AttackSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
attackSummary_endTime :: Lens.Lens' AttackSummary (Prelude.Maybe Prelude.UTCTime)
attackSummary_endTime :: Lens' AttackSummary (Maybe UTCTime)
attackSummary_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttackSummary' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:AttackSummary' :: AttackSummary -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: AttackSummary
s@AttackSummary' {} Maybe POSIX
a -> AttackSummary
s {$sel:endTime:AttackSummary' :: Maybe POSIX
endTime = Maybe POSIX
a} :: AttackSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
attackSummary_resourceArn :: Lens.Lens' AttackSummary (Prelude.Maybe Prelude.Text)
attackSummary_resourceArn :: Lens' AttackSummary (Maybe Text)
attackSummary_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttackSummary' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:AttackSummary' :: AttackSummary -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: AttackSummary
s@AttackSummary' {} Maybe Text
a -> AttackSummary
s {$sel:resourceArn:AttackSummary' :: Maybe Text
resourceArn = Maybe Text
a} :: AttackSummary)
attackSummary_startTime :: Lens.Lens' AttackSummary (Prelude.Maybe Prelude.UTCTime)
attackSummary_startTime :: Lens' AttackSummary (Maybe UTCTime)
attackSummary_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttackSummary' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:AttackSummary' :: AttackSummary -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: AttackSummary
s@AttackSummary' {} Maybe POSIX
a -> AttackSummary
s {$sel:startTime:AttackSummary' :: Maybe POSIX
startTime = Maybe POSIX
a} :: AttackSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON AttackSummary where
parseJSON :: Value -> Parser AttackSummary
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AttackSummary"
( \Object
x ->
Maybe Text
-> Maybe [AttackVectorDescription]
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> AttackSummary
AttackSummary'
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
"AttackId")
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
"AttackVectors" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"EndTime")
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
"ResourceArn")
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
"StartTime")
)
instance Prelude.Hashable AttackSummary where
hashWithSalt :: Int -> AttackSummary -> Int
hashWithSalt Int
_salt AttackSummary' {Maybe [AttackVectorDescription]
Maybe Text
Maybe POSIX
startTime :: Maybe POSIX
resourceArn :: Maybe Text
endTime :: Maybe POSIX
attackVectors :: Maybe [AttackVectorDescription]
attackId :: Maybe Text
$sel:startTime:AttackSummary' :: AttackSummary -> Maybe POSIX
$sel:resourceArn:AttackSummary' :: AttackSummary -> Maybe Text
$sel:endTime:AttackSummary' :: AttackSummary -> Maybe POSIX
$sel:attackVectors:AttackSummary' :: AttackSummary -> Maybe [AttackVectorDescription]
$sel:attackId:AttackSummary' :: AttackSummary -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
attackId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AttackVectorDescription]
attackVectors
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
endTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startTime
instance Prelude.NFData AttackSummary where
rnf :: AttackSummary -> ()
rnf AttackSummary' {Maybe [AttackVectorDescription]
Maybe Text
Maybe POSIX
startTime :: Maybe POSIX
resourceArn :: Maybe Text
endTime :: Maybe POSIX
attackVectors :: Maybe [AttackVectorDescription]
attackId :: Maybe Text
$sel:startTime:AttackSummary' :: AttackSummary -> Maybe POSIX
$sel:resourceArn:AttackSummary' :: AttackSummary -> Maybe Text
$sel:endTime:AttackSummary' :: AttackSummary -> Maybe POSIX
$sel:attackVectors:AttackSummary' :: AttackSummary -> Maybe [AttackVectorDescription]
$sel:attackId:AttackSummary' :: AttackSummary -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
attackId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [AttackVectorDescription]
attackVectors
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
endTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startTime