{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.FraudDetector.Types.EventPredictionSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.FraudDetector.Types.EventPredictionSummary 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

-- | Information about the summary of an event prediction.
--
-- /See:/ 'newEventPredictionSummary' smart constructor.
data EventPredictionSummary = EventPredictionSummary'
  { -- | The detector ID.
    EventPredictionSummary -> Maybe Text
detectorId :: Prelude.Maybe Prelude.Text,
    -- | The detector version ID.
    EventPredictionSummary -> Maybe Text
detectorVersionId :: Prelude.Maybe Prelude.Text,
    -- | The event ID.
    EventPredictionSummary -> Maybe Text
eventId :: Prelude.Maybe Prelude.Text,
    -- | The timestamp of the event.
    EventPredictionSummary -> Maybe Text
eventTimestamp :: Prelude.Maybe Prelude.Text,
    -- | The event type.
    EventPredictionSummary -> Maybe Text
eventTypeName :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the prediction was generated.
    EventPredictionSummary -> Maybe Text
predictionTimestamp :: Prelude.Maybe Prelude.Text
  }
  deriving (EventPredictionSummary -> EventPredictionSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventPredictionSummary -> EventPredictionSummary -> Bool
$c/= :: EventPredictionSummary -> EventPredictionSummary -> Bool
== :: EventPredictionSummary -> EventPredictionSummary -> Bool
$c== :: EventPredictionSummary -> EventPredictionSummary -> Bool
Prelude.Eq, ReadPrec [EventPredictionSummary]
ReadPrec EventPredictionSummary
Int -> ReadS EventPredictionSummary
ReadS [EventPredictionSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventPredictionSummary]
$creadListPrec :: ReadPrec [EventPredictionSummary]
readPrec :: ReadPrec EventPredictionSummary
$creadPrec :: ReadPrec EventPredictionSummary
readList :: ReadS [EventPredictionSummary]
$creadList :: ReadS [EventPredictionSummary]
readsPrec :: Int -> ReadS EventPredictionSummary
$creadsPrec :: Int -> ReadS EventPredictionSummary
Prelude.Read, Int -> EventPredictionSummary -> ShowS
[EventPredictionSummary] -> ShowS
EventPredictionSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventPredictionSummary] -> ShowS
$cshowList :: [EventPredictionSummary] -> ShowS
show :: EventPredictionSummary -> String
$cshow :: EventPredictionSummary -> String
showsPrec :: Int -> EventPredictionSummary -> ShowS
$cshowsPrec :: Int -> EventPredictionSummary -> ShowS
Prelude.Show, forall x. Rep EventPredictionSummary x -> EventPredictionSummary
forall x. EventPredictionSummary -> Rep EventPredictionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventPredictionSummary x -> EventPredictionSummary
$cfrom :: forall x. EventPredictionSummary -> Rep EventPredictionSummary x
Prelude.Generic)

-- |
-- Create a value of 'EventPredictionSummary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'detectorId', 'eventPredictionSummary_detectorId' - The detector ID.
--
-- 'detectorVersionId', 'eventPredictionSummary_detectorVersionId' - The detector version ID.
--
-- 'eventId', 'eventPredictionSummary_eventId' - The event ID.
--
-- 'eventTimestamp', 'eventPredictionSummary_eventTimestamp' - The timestamp of the event.
--
-- 'eventTypeName', 'eventPredictionSummary_eventTypeName' - The event type.
--
-- 'predictionTimestamp', 'eventPredictionSummary_predictionTimestamp' - The timestamp when the prediction was generated.
newEventPredictionSummary ::
  EventPredictionSummary
newEventPredictionSummary :: EventPredictionSummary
newEventPredictionSummary =
  EventPredictionSummary'
    { $sel:detectorId:EventPredictionSummary' :: Maybe Text
detectorId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:detectorVersionId:EventPredictionSummary' :: Maybe Text
detectorVersionId = forall a. Maybe a
Prelude.Nothing,
      $sel:eventId:EventPredictionSummary' :: Maybe Text
eventId = forall a. Maybe a
Prelude.Nothing,
      $sel:eventTimestamp:EventPredictionSummary' :: Maybe Text
eventTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:eventTypeName:EventPredictionSummary' :: Maybe Text
eventTypeName = forall a. Maybe a
Prelude.Nothing,
      $sel:predictionTimestamp:EventPredictionSummary' :: Maybe Text
predictionTimestamp = forall a. Maybe a
Prelude.Nothing
    }

-- | The detector ID.
eventPredictionSummary_detectorId :: Lens.Lens' EventPredictionSummary (Prelude.Maybe Prelude.Text)
eventPredictionSummary_detectorId :: Lens' EventPredictionSummary (Maybe Text)
eventPredictionSummary_detectorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventPredictionSummary' {Maybe Text
detectorId :: Maybe Text
$sel:detectorId:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
detectorId} -> Maybe Text
detectorId) (\s :: EventPredictionSummary
s@EventPredictionSummary' {} Maybe Text
a -> EventPredictionSummary
s {$sel:detectorId:EventPredictionSummary' :: Maybe Text
detectorId = Maybe Text
a} :: EventPredictionSummary)

-- | The detector version ID.
eventPredictionSummary_detectorVersionId :: Lens.Lens' EventPredictionSummary (Prelude.Maybe Prelude.Text)
eventPredictionSummary_detectorVersionId :: Lens' EventPredictionSummary (Maybe Text)
eventPredictionSummary_detectorVersionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventPredictionSummary' {Maybe Text
detectorVersionId :: Maybe Text
$sel:detectorVersionId:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
detectorVersionId} -> Maybe Text
detectorVersionId) (\s :: EventPredictionSummary
s@EventPredictionSummary' {} Maybe Text
a -> EventPredictionSummary
s {$sel:detectorVersionId:EventPredictionSummary' :: Maybe Text
detectorVersionId = Maybe Text
a} :: EventPredictionSummary)

-- | The event ID.
eventPredictionSummary_eventId :: Lens.Lens' EventPredictionSummary (Prelude.Maybe Prelude.Text)
eventPredictionSummary_eventId :: Lens' EventPredictionSummary (Maybe Text)
eventPredictionSummary_eventId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventPredictionSummary' {Maybe Text
eventId :: Maybe Text
$sel:eventId:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
eventId} -> Maybe Text
eventId) (\s :: EventPredictionSummary
s@EventPredictionSummary' {} Maybe Text
a -> EventPredictionSummary
s {$sel:eventId:EventPredictionSummary' :: Maybe Text
eventId = Maybe Text
a} :: EventPredictionSummary)

-- | The timestamp of the event.
eventPredictionSummary_eventTimestamp :: Lens.Lens' EventPredictionSummary (Prelude.Maybe Prelude.Text)
eventPredictionSummary_eventTimestamp :: Lens' EventPredictionSummary (Maybe Text)
eventPredictionSummary_eventTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventPredictionSummary' {Maybe Text
eventTimestamp :: Maybe Text
$sel:eventTimestamp:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
eventTimestamp} -> Maybe Text
eventTimestamp) (\s :: EventPredictionSummary
s@EventPredictionSummary' {} Maybe Text
a -> EventPredictionSummary
s {$sel:eventTimestamp:EventPredictionSummary' :: Maybe Text
eventTimestamp = Maybe Text
a} :: EventPredictionSummary)

-- | The event type.
eventPredictionSummary_eventTypeName :: Lens.Lens' EventPredictionSummary (Prelude.Maybe Prelude.Text)
eventPredictionSummary_eventTypeName :: Lens' EventPredictionSummary (Maybe Text)
eventPredictionSummary_eventTypeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventPredictionSummary' {Maybe Text
eventTypeName :: Maybe Text
$sel:eventTypeName:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
eventTypeName} -> Maybe Text
eventTypeName) (\s :: EventPredictionSummary
s@EventPredictionSummary' {} Maybe Text
a -> EventPredictionSummary
s {$sel:eventTypeName:EventPredictionSummary' :: Maybe Text
eventTypeName = Maybe Text
a} :: EventPredictionSummary)

-- | The timestamp when the prediction was generated.
eventPredictionSummary_predictionTimestamp :: Lens.Lens' EventPredictionSummary (Prelude.Maybe Prelude.Text)
eventPredictionSummary_predictionTimestamp :: Lens' EventPredictionSummary (Maybe Text)
eventPredictionSummary_predictionTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventPredictionSummary' {Maybe Text
predictionTimestamp :: Maybe Text
$sel:predictionTimestamp:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
predictionTimestamp} -> Maybe Text
predictionTimestamp) (\s :: EventPredictionSummary
s@EventPredictionSummary' {} Maybe Text
a -> EventPredictionSummary
s {$sel:predictionTimestamp:EventPredictionSummary' :: Maybe Text
predictionTimestamp = Maybe Text
a} :: EventPredictionSummary)

instance Data.FromJSON EventPredictionSummary where
  parseJSON :: Value -> Parser EventPredictionSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EventPredictionSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EventPredictionSummary
EventPredictionSummary'
            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
"detectorId")
            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
"detectorVersionId")
            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
"eventId")
            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
"eventTimestamp")
            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
"eventTypeName")
            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
"predictionTimestamp")
      )

instance Prelude.Hashable EventPredictionSummary where
  hashWithSalt :: Int -> EventPredictionSummary -> Int
hashWithSalt Int
_salt EventPredictionSummary' {Maybe Text
predictionTimestamp :: Maybe Text
eventTypeName :: Maybe Text
eventTimestamp :: Maybe Text
eventId :: Maybe Text
detectorVersionId :: Maybe Text
detectorId :: Maybe Text
$sel:predictionTimestamp:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
$sel:eventTypeName:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
$sel:eventTimestamp:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
$sel:eventId:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
$sel:detectorVersionId:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
$sel:detectorId:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
detectorId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
detectorVersionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
eventId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
eventTimestamp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
eventTypeName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
predictionTimestamp

instance Prelude.NFData EventPredictionSummary where
  rnf :: EventPredictionSummary -> ()
rnf EventPredictionSummary' {Maybe Text
predictionTimestamp :: Maybe Text
eventTypeName :: Maybe Text
eventTimestamp :: Maybe Text
eventId :: Maybe Text
detectorVersionId :: Maybe Text
detectorId :: Maybe Text
$sel:predictionTimestamp:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
$sel:eventTypeName:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
$sel:eventTimestamp:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
$sel:eventId:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
$sel:detectorVersionId:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
$sel:detectorId:EventPredictionSummary' :: EventPredictionSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
detectorId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
detectorVersionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eventId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eventTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eventTypeName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
predictionTimestamp