{-# 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.SecurityHub.Types.ThreatIntelIndicator where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.ThreatIntelIndicatorCategory
import Amazonka.SecurityHub.Types.ThreatIntelIndicatorType
data ThreatIntelIndicator = ThreatIntelIndicator'
{
ThreatIntelIndicator -> Maybe ThreatIntelIndicatorCategory
category :: Prelude.Maybe ThreatIntelIndicatorCategory,
ThreatIntelIndicator -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
ThreatIntelIndicator -> Maybe Text
source :: Prelude.Maybe Prelude.Text,
ThreatIntelIndicator -> Maybe ThreatIntelIndicatorType
type' :: Prelude.Maybe ThreatIntelIndicatorType,
ThreatIntelIndicator -> Maybe Text
sourceUrl :: Prelude.Maybe Prelude.Text,
ThreatIntelIndicator -> Maybe Text
lastObservedAt :: Prelude.Maybe Prelude.Text
}
deriving (ThreatIntelIndicator -> ThreatIntelIndicator -> Bool
(ThreatIntelIndicator -> ThreatIntelIndicator -> Bool)
-> (ThreatIntelIndicator -> ThreatIntelIndicator -> Bool)
-> Eq ThreatIntelIndicator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ThreatIntelIndicator -> ThreatIntelIndicator -> Bool
$c/= :: ThreatIntelIndicator -> ThreatIntelIndicator -> Bool
== :: ThreatIntelIndicator -> ThreatIntelIndicator -> Bool
$c== :: ThreatIntelIndicator -> ThreatIntelIndicator -> Bool
Prelude.Eq, ReadPrec [ThreatIntelIndicator]
ReadPrec ThreatIntelIndicator
Int -> ReadS ThreatIntelIndicator
ReadS [ThreatIntelIndicator]
(Int -> ReadS ThreatIntelIndicator)
-> ReadS [ThreatIntelIndicator]
-> ReadPrec ThreatIntelIndicator
-> ReadPrec [ThreatIntelIndicator]
-> Read ThreatIntelIndicator
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ThreatIntelIndicator]
$creadListPrec :: ReadPrec [ThreatIntelIndicator]
readPrec :: ReadPrec ThreatIntelIndicator
$creadPrec :: ReadPrec ThreatIntelIndicator
readList :: ReadS [ThreatIntelIndicator]
$creadList :: ReadS [ThreatIntelIndicator]
readsPrec :: Int -> ReadS ThreatIntelIndicator
$creadsPrec :: Int -> ReadS ThreatIntelIndicator
Prelude.Read, Int -> ThreatIntelIndicator -> ShowS
[ThreatIntelIndicator] -> ShowS
ThreatIntelIndicator -> String
(Int -> ThreatIntelIndicator -> ShowS)
-> (ThreatIntelIndicator -> String)
-> ([ThreatIntelIndicator] -> ShowS)
-> Show ThreatIntelIndicator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ThreatIntelIndicator] -> ShowS
$cshowList :: [ThreatIntelIndicator] -> ShowS
show :: ThreatIntelIndicator -> String
$cshow :: ThreatIntelIndicator -> String
showsPrec :: Int -> ThreatIntelIndicator -> ShowS
$cshowsPrec :: Int -> ThreatIntelIndicator -> ShowS
Prelude.Show, (forall x. ThreatIntelIndicator -> Rep ThreatIntelIndicator x)
-> (forall x. Rep ThreatIntelIndicator x -> ThreatIntelIndicator)
-> Generic ThreatIntelIndicator
forall x. Rep ThreatIntelIndicator x -> ThreatIntelIndicator
forall x. ThreatIntelIndicator -> Rep ThreatIntelIndicator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ThreatIntelIndicator x -> ThreatIntelIndicator
$cfrom :: forall x. ThreatIntelIndicator -> Rep ThreatIntelIndicator x
Prelude.Generic)
newThreatIntelIndicator ::
ThreatIntelIndicator
newThreatIntelIndicator :: ThreatIntelIndicator
newThreatIntelIndicator =
ThreatIntelIndicator' :: Maybe ThreatIntelIndicatorCategory
-> Maybe Text
-> Maybe Text
-> Maybe ThreatIntelIndicatorType
-> Maybe Text
-> Maybe Text
-> ThreatIntelIndicator
ThreatIntelIndicator'
{ $sel:category:ThreatIntelIndicator' :: Maybe ThreatIntelIndicatorCategory
category = Maybe ThreatIntelIndicatorCategory
forall a. Maybe a
Prelude.Nothing,
$sel:value:ThreatIntelIndicator' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:source:ThreatIntelIndicator' :: Maybe Text
source = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':ThreatIntelIndicator' :: Maybe ThreatIntelIndicatorType
type' = Maybe ThreatIntelIndicatorType
forall a. Maybe a
Prelude.Nothing,
$sel:sourceUrl:ThreatIntelIndicator' :: Maybe Text
sourceUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastObservedAt:ThreatIntelIndicator' :: Maybe Text
lastObservedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
threatIntelIndicator_category :: Lens.Lens' ThreatIntelIndicator (Prelude.Maybe ThreatIntelIndicatorCategory)
threatIntelIndicator_category :: (Maybe ThreatIntelIndicatorCategory
-> f (Maybe ThreatIntelIndicatorCategory))
-> ThreatIntelIndicator -> f ThreatIntelIndicator
threatIntelIndicator_category = (ThreatIntelIndicator -> Maybe ThreatIntelIndicatorCategory)
-> (ThreatIntelIndicator
-> Maybe ThreatIntelIndicatorCategory -> ThreatIntelIndicator)
-> Lens
ThreatIntelIndicator
ThreatIntelIndicator
(Maybe ThreatIntelIndicatorCategory)
(Maybe ThreatIntelIndicatorCategory)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThreatIntelIndicator' {Maybe ThreatIntelIndicatorCategory
category :: Maybe ThreatIntelIndicatorCategory
$sel:category:ThreatIntelIndicator' :: ThreatIntelIndicator -> Maybe ThreatIntelIndicatorCategory
category} -> Maybe ThreatIntelIndicatorCategory
category) (\s :: ThreatIntelIndicator
s@ThreatIntelIndicator' {} Maybe ThreatIntelIndicatorCategory
a -> ThreatIntelIndicator
s {$sel:category:ThreatIntelIndicator' :: Maybe ThreatIntelIndicatorCategory
category = Maybe ThreatIntelIndicatorCategory
a} :: ThreatIntelIndicator)
threatIntelIndicator_value :: Lens.Lens' ThreatIntelIndicator (Prelude.Maybe Prelude.Text)
threatIntelIndicator_value :: (Maybe Text -> f (Maybe Text))
-> ThreatIntelIndicator -> f ThreatIntelIndicator
threatIntelIndicator_value = (ThreatIntelIndicator -> Maybe Text)
-> (ThreatIntelIndicator -> Maybe Text -> ThreatIntelIndicator)
-> Lens
ThreatIntelIndicator ThreatIntelIndicator (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThreatIntelIndicator' {Maybe Text
value :: Maybe Text
$sel:value:ThreatIntelIndicator' :: ThreatIntelIndicator -> Maybe Text
value} -> Maybe Text
value) (\s :: ThreatIntelIndicator
s@ThreatIntelIndicator' {} Maybe Text
a -> ThreatIntelIndicator
s {$sel:value:ThreatIntelIndicator' :: Maybe Text
value = Maybe Text
a} :: ThreatIntelIndicator)
threatIntelIndicator_source :: Lens.Lens' ThreatIntelIndicator (Prelude.Maybe Prelude.Text)
threatIntelIndicator_source :: (Maybe Text -> f (Maybe Text))
-> ThreatIntelIndicator -> f ThreatIntelIndicator
threatIntelIndicator_source = (ThreatIntelIndicator -> Maybe Text)
-> (ThreatIntelIndicator -> Maybe Text -> ThreatIntelIndicator)
-> Lens
ThreatIntelIndicator ThreatIntelIndicator (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThreatIntelIndicator' {Maybe Text
source :: Maybe Text
$sel:source:ThreatIntelIndicator' :: ThreatIntelIndicator -> Maybe Text
source} -> Maybe Text
source) (\s :: ThreatIntelIndicator
s@ThreatIntelIndicator' {} Maybe Text
a -> ThreatIntelIndicator
s {$sel:source:ThreatIntelIndicator' :: Maybe Text
source = Maybe Text
a} :: ThreatIntelIndicator)
threatIntelIndicator_type :: Lens.Lens' ThreatIntelIndicator (Prelude.Maybe ThreatIntelIndicatorType)
threatIntelIndicator_type :: (Maybe ThreatIntelIndicatorType
-> f (Maybe ThreatIntelIndicatorType))
-> ThreatIntelIndicator -> f ThreatIntelIndicator
threatIntelIndicator_type = (ThreatIntelIndicator -> Maybe ThreatIntelIndicatorType)
-> (ThreatIntelIndicator
-> Maybe ThreatIntelIndicatorType -> ThreatIntelIndicator)
-> Lens
ThreatIntelIndicator
ThreatIntelIndicator
(Maybe ThreatIntelIndicatorType)
(Maybe ThreatIntelIndicatorType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThreatIntelIndicator' {Maybe ThreatIntelIndicatorType
type' :: Maybe ThreatIntelIndicatorType
$sel:type':ThreatIntelIndicator' :: ThreatIntelIndicator -> Maybe ThreatIntelIndicatorType
type'} -> Maybe ThreatIntelIndicatorType
type') (\s :: ThreatIntelIndicator
s@ThreatIntelIndicator' {} Maybe ThreatIntelIndicatorType
a -> ThreatIntelIndicator
s {$sel:type':ThreatIntelIndicator' :: Maybe ThreatIntelIndicatorType
type' = Maybe ThreatIntelIndicatorType
a} :: ThreatIntelIndicator)
threatIntelIndicator_sourceUrl :: Lens.Lens' ThreatIntelIndicator (Prelude.Maybe Prelude.Text)
threatIntelIndicator_sourceUrl :: (Maybe Text -> f (Maybe Text))
-> ThreatIntelIndicator -> f ThreatIntelIndicator
threatIntelIndicator_sourceUrl = (ThreatIntelIndicator -> Maybe Text)
-> (ThreatIntelIndicator -> Maybe Text -> ThreatIntelIndicator)
-> Lens
ThreatIntelIndicator ThreatIntelIndicator (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThreatIntelIndicator' {Maybe Text
sourceUrl :: Maybe Text
$sel:sourceUrl:ThreatIntelIndicator' :: ThreatIntelIndicator -> Maybe Text
sourceUrl} -> Maybe Text
sourceUrl) (\s :: ThreatIntelIndicator
s@ThreatIntelIndicator' {} Maybe Text
a -> ThreatIntelIndicator
s {$sel:sourceUrl:ThreatIntelIndicator' :: Maybe Text
sourceUrl = Maybe Text
a} :: ThreatIntelIndicator)
threatIntelIndicator_lastObservedAt :: Lens.Lens' ThreatIntelIndicator (Prelude.Maybe Prelude.Text)
threatIntelIndicator_lastObservedAt :: (Maybe Text -> f (Maybe Text))
-> ThreatIntelIndicator -> f ThreatIntelIndicator
threatIntelIndicator_lastObservedAt = (ThreatIntelIndicator -> Maybe Text)
-> (ThreatIntelIndicator -> Maybe Text -> ThreatIntelIndicator)
-> Lens
ThreatIntelIndicator ThreatIntelIndicator (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThreatIntelIndicator' {Maybe Text
lastObservedAt :: Maybe Text
$sel:lastObservedAt:ThreatIntelIndicator' :: ThreatIntelIndicator -> Maybe Text
lastObservedAt} -> Maybe Text
lastObservedAt) (\s :: ThreatIntelIndicator
s@ThreatIntelIndicator' {} Maybe Text
a -> ThreatIntelIndicator
s {$sel:lastObservedAt:ThreatIntelIndicator' :: Maybe Text
lastObservedAt = Maybe Text
a} :: ThreatIntelIndicator)
instance Core.FromJSON ThreatIntelIndicator where
parseJSON :: Value -> Parser ThreatIntelIndicator
parseJSON =
String
-> (Object -> Parser ThreatIntelIndicator)
-> Value
-> Parser ThreatIntelIndicator
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ThreatIntelIndicator"
( \Object
x ->
Maybe ThreatIntelIndicatorCategory
-> Maybe Text
-> Maybe Text
-> Maybe ThreatIntelIndicatorType
-> Maybe Text
-> Maybe Text
-> ThreatIntelIndicator
ThreatIntelIndicator'
(Maybe ThreatIntelIndicatorCategory
-> Maybe Text
-> Maybe Text
-> Maybe ThreatIntelIndicatorType
-> Maybe Text
-> Maybe Text
-> ThreatIntelIndicator)
-> Parser (Maybe ThreatIntelIndicatorCategory)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe ThreatIntelIndicatorType
-> Maybe Text
-> Maybe Text
-> ThreatIntelIndicator)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ThreatIntelIndicatorCategory)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Category")
Parser
(Maybe Text
-> Maybe Text
-> Maybe ThreatIntelIndicatorType
-> Maybe Text
-> Maybe Text
-> ThreatIntelIndicator)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe ThreatIntelIndicatorType
-> Maybe Text
-> Maybe Text
-> ThreatIntelIndicator)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Value")
Parser
(Maybe Text
-> Maybe ThreatIntelIndicatorType
-> Maybe Text
-> Maybe Text
-> ThreatIntelIndicator)
-> Parser (Maybe Text)
-> Parser
(Maybe ThreatIntelIndicatorType
-> Maybe Text -> Maybe Text -> ThreatIntelIndicator)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Source")
Parser
(Maybe ThreatIntelIndicatorType
-> Maybe Text -> Maybe Text -> ThreatIntelIndicator)
-> Parser (Maybe ThreatIntelIndicatorType)
-> Parser (Maybe Text -> Maybe Text -> ThreatIntelIndicator)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ThreatIntelIndicatorType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
Parser (Maybe Text -> Maybe Text -> ThreatIntelIndicator)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ThreatIntelIndicator)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SourceUrl")
Parser (Maybe Text -> ThreatIntelIndicator)
-> Parser (Maybe Text) -> Parser ThreatIntelIndicator
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastObservedAt")
)
instance Prelude.Hashable ThreatIntelIndicator
instance Prelude.NFData ThreatIntelIndicator
instance Core.ToJSON ThreatIntelIndicator where
toJSON :: ThreatIntelIndicator -> Value
toJSON ThreatIntelIndicator' {Maybe Text
Maybe ThreatIntelIndicatorCategory
Maybe ThreatIntelIndicatorType
lastObservedAt :: Maybe Text
sourceUrl :: Maybe Text
type' :: Maybe ThreatIntelIndicatorType
source :: Maybe Text
value :: Maybe Text
category :: Maybe ThreatIntelIndicatorCategory
$sel:lastObservedAt:ThreatIntelIndicator' :: ThreatIntelIndicator -> Maybe Text
$sel:sourceUrl:ThreatIntelIndicator' :: ThreatIntelIndicator -> Maybe Text
$sel:type':ThreatIntelIndicator' :: ThreatIntelIndicator -> Maybe ThreatIntelIndicatorType
$sel:source:ThreatIntelIndicator' :: ThreatIntelIndicator -> Maybe Text
$sel:value:ThreatIntelIndicator' :: ThreatIntelIndicator -> Maybe Text
$sel:category:ThreatIntelIndicator' :: ThreatIntelIndicator -> Maybe ThreatIntelIndicatorCategory
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Category" Text -> ThreatIntelIndicatorCategory -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ThreatIntelIndicatorCategory -> Pair)
-> Maybe ThreatIntelIndicatorCategory -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ThreatIntelIndicatorCategory
category,
(Text
"Value" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
value,
(Text
"Source" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
source,
(Text
"Type" Text -> ThreatIntelIndicatorType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ThreatIntelIndicatorType -> Pair)
-> Maybe ThreatIntelIndicatorType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ThreatIntelIndicatorType
type',
(Text
"SourceUrl" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceUrl,
(Text
"LastObservedAt" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
lastObservedAt
]
)