{-# 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.SummarizedAttackVector where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Shield.Types.SummarizedCounter
data SummarizedAttackVector = SummarizedAttackVector'
{
SummarizedAttackVector -> Maybe [SummarizedCounter]
vectorCounters :: Prelude.Maybe [SummarizedCounter],
SummarizedAttackVector -> Text
vectorType :: Prelude.Text
}
deriving (SummarizedAttackVector -> SummarizedAttackVector -> Bool
(SummarizedAttackVector -> SummarizedAttackVector -> Bool)
-> (SummarizedAttackVector -> SummarizedAttackVector -> Bool)
-> Eq SummarizedAttackVector
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SummarizedAttackVector -> SummarizedAttackVector -> Bool
$c/= :: SummarizedAttackVector -> SummarizedAttackVector -> Bool
== :: SummarizedAttackVector -> SummarizedAttackVector -> Bool
$c== :: SummarizedAttackVector -> SummarizedAttackVector -> Bool
Prelude.Eq, ReadPrec [SummarizedAttackVector]
ReadPrec SummarizedAttackVector
Int -> ReadS SummarizedAttackVector
ReadS [SummarizedAttackVector]
(Int -> ReadS SummarizedAttackVector)
-> ReadS [SummarizedAttackVector]
-> ReadPrec SummarizedAttackVector
-> ReadPrec [SummarizedAttackVector]
-> Read SummarizedAttackVector
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SummarizedAttackVector]
$creadListPrec :: ReadPrec [SummarizedAttackVector]
readPrec :: ReadPrec SummarizedAttackVector
$creadPrec :: ReadPrec SummarizedAttackVector
readList :: ReadS [SummarizedAttackVector]
$creadList :: ReadS [SummarizedAttackVector]
readsPrec :: Int -> ReadS SummarizedAttackVector
$creadsPrec :: Int -> ReadS SummarizedAttackVector
Prelude.Read, Int -> SummarizedAttackVector -> ShowS
[SummarizedAttackVector] -> ShowS
SummarizedAttackVector -> String
(Int -> SummarizedAttackVector -> ShowS)
-> (SummarizedAttackVector -> String)
-> ([SummarizedAttackVector] -> ShowS)
-> Show SummarizedAttackVector
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SummarizedAttackVector] -> ShowS
$cshowList :: [SummarizedAttackVector] -> ShowS
show :: SummarizedAttackVector -> String
$cshow :: SummarizedAttackVector -> String
showsPrec :: Int -> SummarizedAttackVector -> ShowS
$cshowsPrec :: Int -> SummarizedAttackVector -> ShowS
Prelude.Show, (forall x. SummarizedAttackVector -> Rep SummarizedAttackVector x)
-> (forall x.
Rep SummarizedAttackVector x -> SummarizedAttackVector)
-> Generic SummarizedAttackVector
forall x. Rep SummarizedAttackVector x -> SummarizedAttackVector
forall x. SummarizedAttackVector -> Rep SummarizedAttackVector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SummarizedAttackVector x -> SummarizedAttackVector
$cfrom :: forall x. SummarizedAttackVector -> Rep SummarizedAttackVector x
Prelude.Generic)
newSummarizedAttackVector ::
Prelude.Text ->
SummarizedAttackVector
newSummarizedAttackVector :: Text -> SummarizedAttackVector
newSummarizedAttackVector Text
pVectorType_ =
SummarizedAttackVector' :: Maybe [SummarizedCounter] -> Text -> SummarizedAttackVector
SummarizedAttackVector'
{ $sel:vectorCounters:SummarizedAttackVector' :: Maybe [SummarizedCounter]
vectorCounters =
Maybe [SummarizedCounter]
forall a. Maybe a
Prelude.Nothing,
$sel:vectorType:SummarizedAttackVector' :: Text
vectorType = Text
pVectorType_
}
summarizedAttackVector_vectorCounters :: Lens.Lens' SummarizedAttackVector (Prelude.Maybe [SummarizedCounter])
summarizedAttackVector_vectorCounters :: (Maybe [SummarizedCounter] -> f (Maybe [SummarizedCounter]))
-> SummarizedAttackVector -> f SummarizedAttackVector
summarizedAttackVector_vectorCounters = (SummarizedAttackVector -> Maybe [SummarizedCounter])
-> (SummarizedAttackVector
-> Maybe [SummarizedCounter] -> SummarizedAttackVector)
-> Lens
SummarizedAttackVector
SummarizedAttackVector
(Maybe [SummarizedCounter])
(Maybe [SummarizedCounter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SummarizedAttackVector' {Maybe [SummarizedCounter]
vectorCounters :: Maybe [SummarizedCounter]
$sel:vectorCounters:SummarizedAttackVector' :: SummarizedAttackVector -> Maybe [SummarizedCounter]
vectorCounters} -> Maybe [SummarizedCounter]
vectorCounters) (\s :: SummarizedAttackVector
s@SummarizedAttackVector' {} Maybe [SummarizedCounter]
a -> SummarizedAttackVector
s {$sel:vectorCounters:SummarizedAttackVector' :: Maybe [SummarizedCounter]
vectorCounters = Maybe [SummarizedCounter]
a} :: SummarizedAttackVector) ((Maybe [SummarizedCounter] -> f (Maybe [SummarizedCounter]))
-> SummarizedAttackVector -> f SummarizedAttackVector)
-> ((Maybe [SummarizedCounter] -> f (Maybe [SummarizedCounter]))
-> Maybe [SummarizedCounter] -> f (Maybe [SummarizedCounter]))
-> (Maybe [SummarizedCounter] -> f (Maybe [SummarizedCounter]))
-> SummarizedAttackVector
-> f SummarizedAttackVector
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[SummarizedCounter]
[SummarizedCounter]
[SummarizedCounter]
[SummarizedCounter]
-> Iso
(Maybe [SummarizedCounter])
(Maybe [SummarizedCounter])
(Maybe [SummarizedCounter])
(Maybe [SummarizedCounter])
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 AnIso
[SummarizedCounter]
[SummarizedCounter]
[SummarizedCounter]
[SummarizedCounter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
summarizedAttackVector_vectorType :: Lens.Lens' SummarizedAttackVector Prelude.Text
summarizedAttackVector_vectorType :: (Text -> f Text)
-> SummarizedAttackVector -> f SummarizedAttackVector
summarizedAttackVector_vectorType = (SummarizedAttackVector -> Text)
-> (SummarizedAttackVector -> Text -> SummarizedAttackVector)
-> Lens SummarizedAttackVector SummarizedAttackVector Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SummarizedAttackVector' {Text
vectorType :: Text
$sel:vectorType:SummarizedAttackVector' :: SummarizedAttackVector -> Text
vectorType} -> Text
vectorType) (\s :: SummarizedAttackVector
s@SummarizedAttackVector' {} Text
a -> SummarizedAttackVector
s {$sel:vectorType:SummarizedAttackVector' :: Text
vectorType = Text
a} :: SummarizedAttackVector)
instance Core.FromJSON SummarizedAttackVector where
parseJSON :: Value -> Parser SummarizedAttackVector
parseJSON =
String
-> (Object -> Parser SummarizedAttackVector)
-> Value
-> Parser SummarizedAttackVector
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SummarizedAttackVector"
( \Object
x ->
Maybe [SummarizedCounter] -> Text -> SummarizedAttackVector
SummarizedAttackVector'
(Maybe [SummarizedCounter] -> Text -> SummarizedAttackVector)
-> Parser (Maybe [SummarizedCounter])
-> Parser (Text -> SummarizedAttackVector)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [SummarizedCounter]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VectorCounters" Parser (Maybe (Maybe [SummarizedCounter]))
-> Maybe [SummarizedCounter] -> Parser (Maybe [SummarizedCounter])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [SummarizedCounter]
forall a. Monoid a => a
Prelude.mempty)
Parser (Text -> SummarizedAttackVector)
-> Parser Text -> Parser SummarizedAttackVector
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"VectorType")
)
instance Prelude.Hashable SummarizedAttackVector
instance Prelude.NFData SummarizedAttackVector