{-# 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.FraudDetector.Types.Event where
import qualified Amazonka.Core as Core
import Amazonka.FraudDetector.Types.Entity
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Event = Event'
{
Event -> Maybe Text
eventTimestamp :: Prelude.Maybe Prelude.Text,
Event -> Maybe [Sensitive Entity]
entities :: Prelude.Maybe [Core.Sensitive Entity],
Event -> Maybe Text
labelTimestamp :: Prelude.Maybe Prelude.Text,
Event -> Maybe Text
eventTypeName :: Prelude.Maybe Prelude.Text,
Event -> Maybe (HashMap Text (Sensitive Text))
eventVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text (Core.Sensitive Prelude.Text)),
Event -> Maybe Text
currentLabel :: Prelude.Maybe Prelude.Text,
Event -> Maybe Text
eventId :: Prelude.Maybe Prelude.Text
}
deriving (Event -> Event -> Bool
(Event -> Event -> Bool) -> (Event -> Event -> Bool) -> Eq Event
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Event -> Event -> Bool
$c/= :: Event -> Event -> Bool
== :: Event -> Event -> Bool
$c== :: Event -> Event -> Bool
Prelude.Eq, Int -> Event -> ShowS
[Event] -> ShowS
Event -> String
(Int -> Event -> ShowS)
-> (Event -> String) -> ([Event] -> ShowS) -> Show Event
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Event] -> ShowS
$cshowList :: [Event] -> ShowS
show :: Event -> String
$cshow :: Event -> String
showsPrec :: Int -> Event -> ShowS
$cshowsPrec :: Int -> Event -> ShowS
Prelude.Show, (forall x. Event -> Rep Event x)
-> (forall x. Rep Event x -> Event) -> Generic Event
forall x. Rep Event x -> Event
forall x. Event -> Rep Event x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Event x -> Event
$cfrom :: forall x. Event -> Rep Event x
Prelude.Generic)
newEvent ::
Event
newEvent :: Event
newEvent =
Event' :: Maybe Text
-> Maybe [Sensitive Entity]
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe Text
-> Maybe Text
-> Event
Event'
{ $sel:eventTimestamp:Event' :: Maybe Text
eventTimestamp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:entities:Event' :: Maybe [Sensitive Entity]
entities = Maybe [Sensitive Entity]
forall a. Maybe a
Prelude.Nothing,
$sel:labelTimestamp:Event' :: Maybe Text
labelTimestamp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eventTypeName:Event' :: Maybe Text
eventTypeName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eventVariables:Event' :: Maybe (HashMap Text (Sensitive Text))
eventVariables = Maybe (HashMap Text (Sensitive Text))
forall a. Maybe a
Prelude.Nothing,
$sel:currentLabel:Event' :: Maybe Text
currentLabel = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eventId:Event' :: Maybe Text
eventId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
event_eventTimestamp :: Lens.Lens' Event (Prelude.Maybe Prelude.Text)
event_eventTimestamp :: (Maybe Text -> f (Maybe Text)) -> Event -> f Event
event_eventTimestamp = (Event -> Maybe Text)
-> (Event -> Maybe Text -> Event)
-> Lens Event Event (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe Text
eventTimestamp :: Maybe Text
$sel:eventTimestamp:Event' :: Event -> Maybe Text
eventTimestamp} -> Maybe Text
eventTimestamp) (\s :: Event
s@Event' {} Maybe Text
a -> Event
s {$sel:eventTimestamp:Event' :: Maybe Text
eventTimestamp = Maybe Text
a} :: Event)
event_entities :: Lens.Lens' Event (Prelude.Maybe [Entity])
event_entities :: (Maybe [Entity] -> f (Maybe [Entity])) -> Event -> f Event
event_entities = (Event -> Maybe [Sensitive Entity])
-> (Event -> Maybe [Sensitive Entity] -> Event)
-> Lens
Event Event (Maybe [Sensitive Entity]) (Maybe [Sensitive Entity])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe [Sensitive Entity]
entities :: Maybe [Sensitive Entity]
$sel:entities:Event' :: Event -> Maybe [Sensitive Entity]
entities} -> Maybe [Sensitive Entity]
entities) (\s :: Event
s@Event' {} Maybe [Sensitive Entity]
a -> Event
s {$sel:entities:Event' :: Maybe [Sensitive Entity]
entities = Maybe [Sensitive Entity]
a} :: Event) ((Maybe [Sensitive Entity] -> f (Maybe [Sensitive Entity]))
-> Event -> f Event)
-> ((Maybe [Entity] -> f (Maybe [Entity]))
-> Maybe [Sensitive Entity] -> f (Maybe [Sensitive Entity]))
-> (Maybe [Entity] -> f (Maybe [Entity]))
-> Event
-> f Event
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Sensitive Entity] [Sensitive Entity] [Entity] [Entity]
-> Iso
(Maybe [Sensitive Entity])
(Maybe [Sensitive Entity])
(Maybe [Entity])
(Maybe [Entity])
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 [Sensitive Entity] [Sensitive Entity] [Entity] [Entity]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
event_labelTimestamp :: Lens.Lens' Event (Prelude.Maybe Prelude.Text)
event_labelTimestamp :: (Maybe Text -> f (Maybe Text)) -> Event -> f Event
event_labelTimestamp = (Event -> Maybe Text)
-> (Event -> Maybe Text -> Event)
-> Lens Event Event (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe Text
labelTimestamp :: Maybe Text
$sel:labelTimestamp:Event' :: Event -> Maybe Text
labelTimestamp} -> Maybe Text
labelTimestamp) (\s :: Event
s@Event' {} Maybe Text
a -> Event
s {$sel:labelTimestamp:Event' :: Maybe Text
labelTimestamp = Maybe Text
a} :: Event)
event_eventTypeName :: Lens.Lens' Event (Prelude.Maybe Prelude.Text)
event_eventTypeName :: (Maybe Text -> f (Maybe Text)) -> Event -> f Event
event_eventTypeName = (Event -> Maybe Text)
-> (Event -> Maybe Text -> Event)
-> Lens Event Event (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe Text
eventTypeName :: Maybe Text
$sel:eventTypeName:Event' :: Event -> Maybe Text
eventTypeName} -> Maybe Text
eventTypeName) (\s :: Event
s@Event' {} Maybe Text
a -> Event
s {$sel:eventTypeName:Event' :: Maybe Text
eventTypeName = Maybe Text
a} :: Event)
event_eventVariables :: Lens.Lens' Event (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
event_eventVariables :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Event -> f Event
event_eventVariables = (Event -> Maybe (HashMap Text (Sensitive Text)))
-> (Event -> Maybe (HashMap Text (Sensitive Text)) -> Event)
-> Lens
Event
Event
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text (Sensitive Text)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe (HashMap Text (Sensitive Text))
eventVariables :: Maybe (HashMap Text (Sensitive Text))
$sel:eventVariables:Event' :: Event -> Maybe (HashMap Text (Sensitive Text))
eventVariables} -> Maybe (HashMap Text (Sensitive Text))
eventVariables) (\s :: Event
s@Event' {} Maybe (HashMap Text (Sensitive Text))
a -> Event
s {$sel:eventVariables:Event' :: Maybe (HashMap Text (Sensitive Text))
eventVariables = Maybe (HashMap Text (Sensitive Text))
a} :: Event) ((Maybe (HashMap Text (Sensitive Text))
-> f (Maybe (HashMap Text (Sensitive Text))))
-> Event -> f Event)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text (Sensitive Text))
-> f (Maybe (HashMap Text (Sensitive Text))))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Event
-> f Event
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text (Sensitive Text))
(HashMap Text (Sensitive Text))
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text (Sensitive Text))
(HashMap Text (Sensitive Text))
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
event_currentLabel :: Lens.Lens' Event (Prelude.Maybe Prelude.Text)
event_currentLabel :: (Maybe Text -> f (Maybe Text)) -> Event -> f Event
event_currentLabel = (Event -> Maybe Text)
-> (Event -> Maybe Text -> Event)
-> Lens Event Event (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe Text
currentLabel :: Maybe Text
$sel:currentLabel:Event' :: Event -> Maybe Text
currentLabel} -> Maybe Text
currentLabel) (\s :: Event
s@Event' {} Maybe Text
a -> Event
s {$sel:currentLabel:Event' :: Maybe Text
currentLabel = Maybe Text
a} :: Event)
event_eventId :: Lens.Lens' Event (Prelude.Maybe Prelude.Text)
event_eventId :: (Maybe Text -> f (Maybe Text)) -> Event -> f Event
event_eventId = (Event -> Maybe Text)
-> (Event -> Maybe Text -> Event)
-> Lens Event Event (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Event' {Maybe Text
eventId :: Maybe Text
$sel:eventId:Event' :: Event -> Maybe Text
eventId} -> Maybe Text
eventId) (\s :: Event
s@Event' {} Maybe Text
a -> Event
s {$sel:eventId:Event' :: Maybe Text
eventId = Maybe Text
a} :: Event)
instance Core.FromJSON Event where
parseJSON :: Value -> Parser Event
parseJSON =
String -> (Object -> Parser Event) -> Value -> Parser Event
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Event"
( \Object
x ->
Maybe Text
-> Maybe [Sensitive Entity]
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe Text
-> Maybe Text
-> Event
Event'
(Maybe Text
-> Maybe [Sensitive Entity]
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe Text
-> Maybe Text
-> Event)
-> Parser (Maybe Text)
-> Parser
(Maybe [Sensitive Entity]
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe Text
-> Maybe Text
-> Event)
forall (f :: * -> *) a b. Functor 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
"eventTimestamp")
Parser
(Maybe [Sensitive Entity]
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe Text
-> Maybe Text
-> Event)
-> Parser (Maybe [Sensitive Entity])
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe Text
-> Maybe Text
-> Event)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Sensitive Entity]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"entities" Parser (Maybe (Maybe [Sensitive Entity]))
-> Maybe [Sensitive Entity] -> Parser (Maybe [Sensitive Entity])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Sensitive Entity]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe Text
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe Text
-> Maybe Text
-> Event)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe Text
-> Maybe Text
-> Event)
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
"labelTimestamp")
Parser
(Maybe Text
-> Maybe (HashMap Text (Sensitive Text))
-> Maybe Text
-> Maybe Text
-> Event)
-> Parser (Maybe Text)
-> Parser
(Maybe (HashMap Text (Sensitive Text))
-> Maybe Text -> Maybe Text -> Event)
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
"eventTypeName")
Parser
(Maybe (HashMap Text (Sensitive Text))
-> Maybe Text -> Maybe Text -> Event)
-> Parser (Maybe (HashMap Text (Sensitive Text)))
-> Parser (Maybe Text -> Maybe Text -> Event)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe (HashMap Text (Sensitive Text))))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"eventVariables" Parser (Maybe (Maybe (HashMap Text (Sensitive Text))))
-> Maybe (HashMap Text (Sensitive Text))
-> Parser (Maybe (HashMap Text (Sensitive Text)))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text (Sensitive Text))
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> Maybe Text -> Event)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Event)
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
"currentLabel")
Parser (Maybe Text -> Event) -> Parser (Maybe Text) -> Parser Event
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
"eventId")
)
instance Prelude.Hashable Event
instance Prelude.NFData Event