{-# 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.VoiceId.Types.FraudDetectionResult
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.VoiceId.Types.FraudDetectionResult where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.VoiceId.Types.FraudDetectionConfiguration
import Amazonka.VoiceId.Types.FraudDetectionDecision
import Amazonka.VoiceId.Types.FraudDetectionReason
import Amazonka.VoiceId.Types.FraudRiskDetails

-- | The fraud detection result produced by Voice ID, processed against the
-- current session state and streamed audio of the speaker.
--
-- /See:/ 'newFraudDetectionResult' smart constructor.
data FraudDetectionResult = FraudDetectionResult'
  { -- | The reason speaker was flagged by the fraud detection system. This is
    -- only be populated if fraud detection Decision is @HIGH_RISK@, and only
    -- has one possible value: @KNOWN_FRAUDSTER@.
    FraudDetectionResult -> Maybe [FraudDetectionReason]
reasons :: Prelude.Maybe [FraudDetectionReason],
    -- | Details about each risk analyzed for this speaker.
    FraudDetectionResult -> Maybe FraudRiskDetails
riskDetails :: Prelude.Maybe FraudRiskDetails,
    -- | The unique identifier for this fraud detection result. Given there can
    -- be multiple fraud detections for a given session, this field helps in
    -- identifying if the returned result is from previous streaming activity
    -- or a new result. Note that in the absence of any new streaming activity
    -- or risk threshold changes, Voice ID always returns cached Fraud
    -- Detection result for this API.
    FraudDetectionResult -> Maybe Text
fraudDetectionResultId :: Prelude.Maybe Prelude.Text,
    -- | The fraud detection decision produced by Voice ID, processed against the
    -- current session state and streamed audio of the speaker.
    FraudDetectionResult -> Maybe FraudDetectionDecision
decision :: Prelude.Maybe FraudDetectionDecision,
    -- | The @FraudDetectionConfiguration@ used to generate this fraud detection
    -- result.
    FraudDetectionResult -> Maybe FraudDetectionConfiguration
configuration :: Prelude.Maybe FraudDetectionConfiguration,
    -- | A timestamp indicating when audio aggregation started for this fraud
    -- detection result.
    FraudDetectionResult -> Maybe POSIX
audioAggregationStartedAt :: Prelude.Maybe Core.POSIX,
    -- | A timestamp indicating when audio aggregation ended for this fraud
    -- detection result.
    FraudDetectionResult -> Maybe POSIX
audioAggregationEndedAt :: Prelude.Maybe Core.POSIX
  }
  deriving (FraudDetectionResult -> FraudDetectionResult -> Bool
(FraudDetectionResult -> FraudDetectionResult -> Bool)
-> (FraudDetectionResult -> FraudDetectionResult -> Bool)
-> Eq FraudDetectionResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FraudDetectionResult -> FraudDetectionResult -> Bool
$c/= :: FraudDetectionResult -> FraudDetectionResult -> Bool
== :: FraudDetectionResult -> FraudDetectionResult -> Bool
$c== :: FraudDetectionResult -> FraudDetectionResult -> Bool
Prelude.Eq, ReadPrec [FraudDetectionResult]
ReadPrec FraudDetectionResult
Int -> ReadS FraudDetectionResult
ReadS [FraudDetectionResult]
(Int -> ReadS FraudDetectionResult)
-> ReadS [FraudDetectionResult]
-> ReadPrec FraudDetectionResult
-> ReadPrec [FraudDetectionResult]
-> Read FraudDetectionResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FraudDetectionResult]
$creadListPrec :: ReadPrec [FraudDetectionResult]
readPrec :: ReadPrec FraudDetectionResult
$creadPrec :: ReadPrec FraudDetectionResult
readList :: ReadS [FraudDetectionResult]
$creadList :: ReadS [FraudDetectionResult]
readsPrec :: Int -> ReadS FraudDetectionResult
$creadsPrec :: Int -> ReadS FraudDetectionResult
Prelude.Read, Int -> FraudDetectionResult -> ShowS
[FraudDetectionResult] -> ShowS
FraudDetectionResult -> String
(Int -> FraudDetectionResult -> ShowS)
-> (FraudDetectionResult -> String)
-> ([FraudDetectionResult] -> ShowS)
-> Show FraudDetectionResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FraudDetectionResult] -> ShowS
$cshowList :: [FraudDetectionResult] -> ShowS
show :: FraudDetectionResult -> String
$cshow :: FraudDetectionResult -> String
showsPrec :: Int -> FraudDetectionResult -> ShowS
$cshowsPrec :: Int -> FraudDetectionResult -> ShowS
Prelude.Show, (forall x. FraudDetectionResult -> Rep FraudDetectionResult x)
-> (forall x. Rep FraudDetectionResult x -> FraudDetectionResult)
-> Generic FraudDetectionResult
forall x. Rep FraudDetectionResult x -> FraudDetectionResult
forall x. FraudDetectionResult -> Rep FraudDetectionResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FraudDetectionResult x -> FraudDetectionResult
$cfrom :: forall x. FraudDetectionResult -> Rep FraudDetectionResult x
Prelude.Generic)

-- |
-- Create a value of 'FraudDetectionResult' 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:
--
-- 'reasons', 'fraudDetectionResult_reasons' - The reason speaker was flagged by the fraud detection system. This is
-- only be populated if fraud detection Decision is @HIGH_RISK@, and only
-- has one possible value: @KNOWN_FRAUDSTER@.
--
-- 'riskDetails', 'fraudDetectionResult_riskDetails' - Details about each risk analyzed for this speaker.
--
-- 'fraudDetectionResultId', 'fraudDetectionResult_fraudDetectionResultId' - The unique identifier for this fraud detection result. Given there can
-- be multiple fraud detections for a given session, this field helps in
-- identifying if the returned result is from previous streaming activity
-- or a new result. Note that in the absence of any new streaming activity
-- or risk threshold changes, Voice ID always returns cached Fraud
-- Detection result for this API.
--
-- 'decision', 'fraudDetectionResult_decision' - The fraud detection decision produced by Voice ID, processed against the
-- current session state and streamed audio of the speaker.
--
-- 'configuration', 'fraudDetectionResult_configuration' - The @FraudDetectionConfiguration@ used to generate this fraud detection
-- result.
--
-- 'audioAggregationStartedAt', 'fraudDetectionResult_audioAggregationStartedAt' - A timestamp indicating when audio aggregation started for this fraud
-- detection result.
--
-- 'audioAggregationEndedAt', 'fraudDetectionResult_audioAggregationEndedAt' - A timestamp indicating when audio aggregation ended for this fraud
-- detection result.
newFraudDetectionResult ::
  FraudDetectionResult
newFraudDetectionResult :: FraudDetectionResult
newFraudDetectionResult =
  FraudDetectionResult' :: Maybe [FraudDetectionReason]
-> Maybe FraudRiskDetails
-> Maybe Text
-> Maybe FraudDetectionDecision
-> Maybe FraudDetectionConfiguration
-> Maybe POSIX
-> Maybe POSIX
-> FraudDetectionResult
FraudDetectionResult'
    { $sel:reasons:FraudDetectionResult' :: Maybe [FraudDetectionReason]
reasons = Maybe [FraudDetectionReason]
forall a. Maybe a
Prelude.Nothing,
      $sel:riskDetails:FraudDetectionResult' :: Maybe FraudRiskDetails
riskDetails = Maybe FraudRiskDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:fraudDetectionResultId:FraudDetectionResult' :: Maybe Text
fraudDetectionResultId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:decision:FraudDetectionResult' :: Maybe FraudDetectionDecision
decision = Maybe FraudDetectionDecision
forall a. Maybe a
Prelude.Nothing,
      $sel:configuration:FraudDetectionResult' :: Maybe FraudDetectionConfiguration
configuration = Maybe FraudDetectionConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:audioAggregationStartedAt:FraudDetectionResult' :: Maybe POSIX
audioAggregationStartedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:audioAggregationEndedAt:FraudDetectionResult' :: Maybe POSIX
audioAggregationEndedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | The reason speaker was flagged by the fraud detection system. This is
-- only be populated if fraud detection Decision is @HIGH_RISK@, and only
-- has one possible value: @KNOWN_FRAUDSTER@.
fraudDetectionResult_reasons :: Lens.Lens' FraudDetectionResult (Prelude.Maybe [FraudDetectionReason])
fraudDetectionResult_reasons :: (Maybe [FraudDetectionReason] -> f (Maybe [FraudDetectionReason]))
-> FraudDetectionResult -> f FraudDetectionResult
fraudDetectionResult_reasons = (FraudDetectionResult -> Maybe [FraudDetectionReason])
-> (FraudDetectionResult
    -> Maybe [FraudDetectionReason] -> FraudDetectionResult)
-> Lens
     FraudDetectionResult
     FraudDetectionResult
     (Maybe [FraudDetectionReason])
     (Maybe [FraudDetectionReason])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FraudDetectionResult' {Maybe [FraudDetectionReason]
reasons :: Maybe [FraudDetectionReason]
$sel:reasons:FraudDetectionResult' :: FraudDetectionResult -> Maybe [FraudDetectionReason]
reasons} -> Maybe [FraudDetectionReason]
reasons) (\s :: FraudDetectionResult
s@FraudDetectionResult' {} Maybe [FraudDetectionReason]
a -> FraudDetectionResult
s {$sel:reasons:FraudDetectionResult' :: Maybe [FraudDetectionReason]
reasons = Maybe [FraudDetectionReason]
a} :: FraudDetectionResult) ((Maybe [FraudDetectionReason] -> f (Maybe [FraudDetectionReason]))
 -> FraudDetectionResult -> f FraudDetectionResult)
-> ((Maybe [FraudDetectionReason]
     -> f (Maybe [FraudDetectionReason]))
    -> Maybe [FraudDetectionReason]
    -> f (Maybe [FraudDetectionReason]))
-> (Maybe [FraudDetectionReason]
    -> f (Maybe [FraudDetectionReason]))
-> FraudDetectionResult
-> f FraudDetectionResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FraudDetectionReason]
  [FraudDetectionReason]
  [FraudDetectionReason]
  [FraudDetectionReason]
-> Iso
     (Maybe [FraudDetectionReason])
     (Maybe [FraudDetectionReason])
     (Maybe [FraudDetectionReason])
     (Maybe [FraudDetectionReason])
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
  [FraudDetectionReason]
  [FraudDetectionReason]
  [FraudDetectionReason]
  [FraudDetectionReason]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Details about each risk analyzed for this speaker.
fraudDetectionResult_riskDetails :: Lens.Lens' FraudDetectionResult (Prelude.Maybe FraudRiskDetails)
fraudDetectionResult_riskDetails :: (Maybe FraudRiskDetails -> f (Maybe FraudRiskDetails))
-> FraudDetectionResult -> f FraudDetectionResult
fraudDetectionResult_riskDetails = (FraudDetectionResult -> Maybe FraudRiskDetails)
-> (FraudDetectionResult
    -> Maybe FraudRiskDetails -> FraudDetectionResult)
-> Lens
     FraudDetectionResult
     FraudDetectionResult
     (Maybe FraudRiskDetails)
     (Maybe FraudRiskDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FraudDetectionResult' {Maybe FraudRiskDetails
riskDetails :: Maybe FraudRiskDetails
$sel:riskDetails:FraudDetectionResult' :: FraudDetectionResult -> Maybe FraudRiskDetails
riskDetails} -> Maybe FraudRiskDetails
riskDetails) (\s :: FraudDetectionResult
s@FraudDetectionResult' {} Maybe FraudRiskDetails
a -> FraudDetectionResult
s {$sel:riskDetails:FraudDetectionResult' :: Maybe FraudRiskDetails
riskDetails = Maybe FraudRiskDetails
a} :: FraudDetectionResult)

-- | The unique identifier for this fraud detection result. Given there can
-- be multiple fraud detections for a given session, this field helps in
-- identifying if the returned result is from previous streaming activity
-- or a new result. Note that in the absence of any new streaming activity
-- or risk threshold changes, Voice ID always returns cached Fraud
-- Detection result for this API.
fraudDetectionResult_fraudDetectionResultId :: Lens.Lens' FraudDetectionResult (Prelude.Maybe Prelude.Text)
fraudDetectionResult_fraudDetectionResultId :: (Maybe Text -> f (Maybe Text))
-> FraudDetectionResult -> f FraudDetectionResult
fraudDetectionResult_fraudDetectionResultId = (FraudDetectionResult -> Maybe Text)
-> (FraudDetectionResult -> Maybe Text -> FraudDetectionResult)
-> Lens
     FraudDetectionResult FraudDetectionResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FraudDetectionResult' {Maybe Text
fraudDetectionResultId :: Maybe Text
$sel:fraudDetectionResultId:FraudDetectionResult' :: FraudDetectionResult -> Maybe Text
fraudDetectionResultId} -> Maybe Text
fraudDetectionResultId) (\s :: FraudDetectionResult
s@FraudDetectionResult' {} Maybe Text
a -> FraudDetectionResult
s {$sel:fraudDetectionResultId:FraudDetectionResult' :: Maybe Text
fraudDetectionResultId = Maybe Text
a} :: FraudDetectionResult)

-- | The fraud detection decision produced by Voice ID, processed against the
-- current session state and streamed audio of the speaker.
fraudDetectionResult_decision :: Lens.Lens' FraudDetectionResult (Prelude.Maybe FraudDetectionDecision)
fraudDetectionResult_decision :: (Maybe FraudDetectionDecision -> f (Maybe FraudDetectionDecision))
-> FraudDetectionResult -> f FraudDetectionResult
fraudDetectionResult_decision = (FraudDetectionResult -> Maybe FraudDetectionDecision)
-> (FraudDetectionResult
    -> Maybe FraudDetectionDecision -> FraudDetectionResult)
-> Lens
     FraudDetectionResult
     FraudDetectionResult
     (Maybe FraudDetectionDecision)
     (Maybe FraudDetectionDecision)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FraudDetectionResult' {Maybe FraudDetectionDecision
decision :: Maybe FraudDetectionDecision
$sel:decision:FraudDetectionResult' :: FraudDetectionResult -> Maybe FraudDetectionDecision
decision} -> Maybe FraudDetectionDecision
decision) (\s :: FraudDetectionResult
s@FraudDetectionResult' {} Maybe FraudDetectionDecision
a -> FraudDetectionResult
s {$sel:decision:FraudDetectionResult' :: Maybe FraudDetectionDecision
decision = Maybe FraudDetectionDecision
a} :: FraudDetectionResult)

-- | The @FraudDetectionConfiguration@ used to generate this fraud detection
-- result.
fraudDetectionResult_configuration :: Lens.Lens' FraudDetectionResult (Prelude.Maybe FraudDetectionConfiguration)
fraudDetectionResult_configuration :: (Maybe FraudDetectionConfiguration
 -> f (Maybe FraudDetectionConfiguration))
-> FraudDetectionResult -> f FraudDetectionResult
fraudDetectionResult_configuration = (FraudDetectionResult -> Maybe FraudDetectionConfiguration)
-> (FraudDetectionResult
    -> Maybe FraudDetectionConfiguration -> FraudDetectionResult)
-> Lens
     FraudDetectionResult
     FraudDetectionResult
     (Maybe FraudDetectionConfiguration)
     (Maybe FraudDetectionConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FraudDetectionResult' {Maybe FraudDetectionConfiguration
configuration :: Maybe FraudDetectionConfiguration
$sel:configuration:FraudDetectionResult' :: FraudDetectionResult -> Maybe FraudDetectionConfiguration
configuration} -> Maybe FraudDetectionConfiguration
configuration) (\s :: FraudDetectionResult
s@FraudDetectionResult' {} Maybe FraudDetectionConfiguration
a -> FraudDetectionResult
s {$sel:configuration:FraudDetectionResult' :: Maybe FraudDetectionConfiguration
configuration = Maybe FraudDetectionConfiguration
a} :: FraudDetectionResult)

-- | A timestamp indicating when audio aggregation started for this fraud
-- detection result.
fraudDetectionResult_audioAggregationStartedAt :: Lens.Lens' FraudDetectionResult (Prelude.Maybe Prelude.UTCTime)
fraudDetectionResult_audioAggregationStartedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> FraudDetectionResult -> f FraudDetectionResult
fraudDetectionResult_audioAggregationStartedAt = (FraudDetectionResult -> Maybe POSIX)
-> (FraudDetectionResult -> Maybe POSIX -> FraudDetectionResult)
-> Lens
     FraudDetectionResult
     FraudDetectionResult
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FraudDetectionResult' {Maybe POSIX
audioAggregationStartedAt :: Maybe POSIX
$sel:audioAggregationStartedAt:FraudDetectionResult' :: FraudDetectionResult -> Maybe POSIX
audioAggregationStartedAt} -> Maybe POSIX
audioAggregationStartedAt) (\s :: FraudDetectionResult
s@FraudDetectionResult' {} Maybe POSIX
a -> FraudDetectionResult
s {$sel:audioAggregationStartedAt:FraudDetectionResult' :: Maybe POSIX
audioAggregationStartedAt = Maybe POSIX
a} :: FraudDetectionResult) ((Maybe POSIX -> f (Maybe POSIX))
 -> FraudDetectionResult -> f FraudDetectionResult)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> FraudDetectionResult
-> f FraudDetectionResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A timestamp indicating when audio aggregation ended for this fraud
-- detection result.
fraudDetectionResult_audioAggregationEndedAt :: Lens.Lens' FraudDetectionResult (Prelude.Maybe Prelude.UTCTime)
fraudDetectionResult_audioAggregationEndedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> FraudDetectionResult -> f FraudDetectionResult
fraudDetectionResult_audioAggregationEndedAt = (FraudDetectionResult -> Maybe POSIX)
-> (FraudDetectionResult -> Maybe POSIX -> FraudDetectionResult)
-> Lens
     FraudDetectionResult
     FraudDetectionResult
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FraudDetectionResult' {Maybe POSIX
audioAggregationEndedAt :: Maybe POSIX
$sel:audioAggregationEndedAt:FraudDetectionResult' :: FraudDetectionResult -> Maybe POSIX
audioAggregationEndedAt} -> Maybe POSIX
audioAggregationEndedAt) (\s :: FraudDetectionResult
s@FraudDetectionResult' {} Maybe POSIX
a -> FraudDetectionResult
s {$sel:audioAggregationEndedAt:FraudDetectionResult' :: Maybe POSIX
audioAggregationEndedAt = Maybe POSIX
a} :: FraudDetectionResult) ((Maybe POSIX -> f (Maybe POSIX))
 -> FraudDetectionResult -> f FraudDetectionResult)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> FraudDetectionResult
-> f FraudDetectionResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.FromJSON FraudDetectionResult where
  parseJSON :: Value -> Parser FraudDetectionResult
parseJSON =
    String
-> (Object -> Parser FraudDetectionResult)
-> Value
-> Parser FraudDetectionResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FraudDetectionResult"
      ( \Object
x ->
          Maybe [FraudDetectionReason]
-> Maybe FraudRiskDetails
-> Maybe Text
-> Maybe FraudDetectionDecision
-> Maybe FraudDetectionConfiguration
-> Maybe POSIX
-> Maybe POSIX
-> FraudDetectionResult
FraudDetectionResult'
            (Maybe [FraudDetectionReason]
 -> Maybe FraudRiskDetails
 -> Maybe Text
 -> Maybe FraudDetectionDecision
 -> Maybe FraudDetectionConfiguration
 -> Maybe POSIX
 -> Maybe POSIX
 -> FraudDetectionResult)
-> Parser (Maybe [FraudDetectionReason])
-> Parser
     (Maybe FraudRiskDetails
      -> Maybe Text
      -> Maybe FraudDetectionDecision
      -> Maybe FraudDetectionConfiguration
      -> Maybe POSIX
      -> Maybe POSIX
      -> FraudDetectionResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [FraudDetectionReason]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Reasons" Parser (Maybe (Maybe [FraudDetectionReason]))
-> Maybe [FraudDetectionReason]
-> Parser (Maybe [FraudDetectionReason])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [FraudDetectionReason]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe FraudRiskDetails
   -> Maybe Text
   -> Maybe FraudDetectionDecision
   -> Maybe FraudDetectionConfiguration
   -> Maybe POSIX
   -> Maybe POSIX
   -> FraudDetectionResult)
-> Parser (Maybe FraudRiskDetails)
-> Parser
     (Maybe Text
      -> Maybe FraudDetectionDecision
      -> Maybe FraudDetectionConfiguration
      -> Maybe POSIX
      -> Maybe POSIX
      -> FraudDetectionResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FraudRiskDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RiskDetails")
            Parser
  (Maybe Text
   -> Maybe FraudDetectionDecision
   -> Maybe FraudDetectionConfiguration
   -> Maybe POSIX
   -> Maybe POSIX
   -> FraudDetectionResult)
-> Parser (Maybe Text)
-> Parser
     (Maybe FraudDetectionDecision
      -> Maybe FraudDetectionConfiguration
      -> Maybe POSIX
      -> Maybe POSIX
      -> FraudDetectionResult)
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
"FraudDetectionResultId")
            Parser
  (Maybe FraudDetectionDecision
   -> Maybe FraudDetectionConfiguration
   -> Maybe POSIX
   -> Maybe POSIX
   -> FraudDetectionResult)
-> Parser (Maybe FraudDetectionDecision)
-> Parser
     (Maybe FraudDetectionConfiguration
      -> Maybe POSIX -> Maybe POSIX -> FraudDetectionResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FraudDetectionDecision)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Decision")
            Parser
  (Maybe FraudDetectionConfiguration
   -> Maybe POSIX -> Maybe POSIX -> FraudDetectionResult)
-> Parser (Maybe FraudDetectionConfiguration)
-> Parser (Maybe POSIX -> Maybe POSIX -> FraudDetectionResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FraudDetectionConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Configuration")
            Parser (Maybe POSIX -> Maybe POSIX -> FraudDetectionResult)
-> Parser (Maybe POSIX)
-> Parser (Maybe POSIX -> FraudDetectionResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AudioAggregationStartedAt")
            Parser (Maybe POSIX -> FraudDetectionResult)
-> Parser (Maybe POSIX) -> Parser FraudDetectionResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AudioAggregationEndedAt")
      )

instance Prelude.Hashable FraudDetectionResult

instance Prelude.NFData FraudDetectionResult