{-# 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.FraudRiskDetails
-- 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.FraudRiskDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.VoiceId.Types.KnownFraudsterRisk

-- | Details regarding various fraud risk analyses performed against the
-- current session state and streamed audio of the speaker.
--
-- /See:/ 'newFraudRiskDetails' smart constructor.
data FraudRiskDetails = FraudRiskDetails'
  { -- | The details resulting from \'Known Fraudster Risk\' analysis of the
    -- speaker.
    FraudRiskDetails -> KnownFraudsterRisk
knownFraudsterRisk :: KnownFraudsterRisk
  }
  deriving (FraudRiskDetails -> FraudRiskDetails -> Bool
(FraudRiskDetails -> FraudRiskDetails -> Bool)
-> (FraudRiskDetails -> FraudRiskDetails -> Bool)
-> Eq FraudRiskDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FraudRiskDetails -> FraudRiskDetails -> Bool
$c/= :: FraudRiskDetails -> FraudRiskDetails -> Bool
== :: FraudRiskDetails -> FraudRiskDetails -> Bool
$c== :: FraudRiskDetails -> FraudRiskDetails -> Bool
Prelude.Eq, ReadPrec [FraudRiskDetails]
ReadPrec FraudRiskDetails
Int -> ReadS FraudRiskDetails
ReadS [FraudRiskDetails]
(Int -> ReadS FraudRiskDetails)
-> ReadS [FraudRiskDetails]
-> ReadPrec FraudRiskDetails
-> ReadPrec [FraudRiskDetails]
-> Read FraudRiskDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FraudRiskDetails]
$creadListPrec :: ReadPrec [FraudRiskDetails]
readPrec :: ReadPrec FraudRiskDetails
$creadPrec :: ReadPrec FraudRiskDetails
readList :: ReadS [FraudRiskDetails]
$creadList :: ReadS [FraudRiskDetails]
readsPrec :: Int -> ReadS FraudRiskDetails
$creadsPrec :: Int -> ReadS FraudRiskDetails
Prelude.Read, Int -> FraudRiskDetails -> ShowS
[FraudRiskDetails] -> ShowS
FraudRiskDetails -> String
(Int -> FraudRiskDetails -> ShowS)
-> (FraudRiskDetails -> String)
-> ([FraudRiskDetails] -> ShowS)
-> Show FraudRiskDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FraudRiskDetails] -> ShowS
$cshowList :: [FraudRiskDetails] -> ShowS
show :: FraudRiskDetails -> String
$cshow :: FraudRiskDetails -> String
showsPrec :: Int -> FraudRiskDetails -> ShowS
$cshowsPrec :: Int -> FraudRiskDetails -> ShowS
Prelude.Show, (forall x. FraudRiskDetails -> Rep FraudRiskDetails x)
-> (forall x. Rep FraudRiskDetails x -> FraudRiskDetails)
-> Generic FraudRiskDetails
forall x. Rep FraudRiskDetails x -> FraudRiskDetails
forall x. FraudRiskDetails -> Rep FraudRiskDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FraudRiskDetails x -> FraudRiskDetails
$cfrom :: forall x. FraudRiskDetails -> Rep FraudRiskDetails x
Prelude.Generic)

-- |
-- Create a value of 'FraudRiskDetails' 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:
--
-- 'knownFraudsterRisk', 'fraudRiskDetails_knownFraudsterRisk' - The details resulting from \'Known Fraudster Risk\' analysis of the
-- speaker.
newFraudRiskDetails ::
  -- | 'knownFraudsterRisk'
  KnownFraudsterRisk ->
  FraudRiskDetails
newFraudRiskDetails :: KnownFraudsterRisk -> FraudRiskDetails
newFraudRiskDetails KnownFraudsterRisk
pKnownFraudsterRisk_ =
  FraudRiskDetails' :: KnownFraudsterRisk -> FraudRiskDetails
FraudRiskDetails'
    { $sel:knownFraudsterRisk:FraudRiskDetails' :: KnownFraudsterRisk
knownFraudsterRisk =
        KnownFraudsterRisk
pKnownFraudsterRisk_
    }

-- | The details resulting from \'Known Fraudster Risk\' analysis of the
-- speaker.
fraudRiskDetails_knownFraudsterRisk :: Lens.Lens' FraudRiskDetails KnownFraudsterRisk
fraudRiskDetails_knownFraudsterRisk :: (KnownFraudsterRisk -> f KnownFraudsterRisk)
-> FraudRiskDetails -> f FraudRiskDetails
fraudRiskDetails_knownFraudsterRisk = (FraudRiskDetails -> KnownFraudsterRisk)
-> (FraudRiskDetails -> KnownFraudsterRisk -> FraudRiskDetails)
-> Lens
     FraudRiskDetails
     FraudRiskDetails
     KnownFraudsterRisk
     KnownFraudsterRisk
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FraudRiskDetails' {KnownFraudsterRisk
knownFraudsterRisk :: KnownFraudsterRisk
$sel:knownFraudsterRisk:FraudRiskDetails' :: FraudRiskDetails -> KnownFraudsterRisk
knownFraudsterRisk} -> KnownFraudsterRisk
knownFraudsterRisk) (\s :: FraudRiskDetails
s@FraudRiskDetails' {} KnownFraudsterRisk
a -> FraudRiskDetails
s {$sel:knownFraudsterRisk:FraudRiskDetails' :: KnownFraudsterRisk
knownFraudsterRisk = KnownFraudsterRisk
a} :: FraudRiskDetails)

instance Core.FromJSON FraudRiskDetails where
  parseJSON :: Value -> Parser FraudRiskDetails
parseJSON =
    String
-> (Object -> Parser FraudRiskDetails)
-> Value
-> Parser FraudRiskDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FraudRiskDetails"
      ( \Object
x ->
          KnownFraudsterRisk -> FraudRiskDetails
FraudRiskDetails'
            (KnownFraudsterRisk -> FraudRiskDetails)
-> Parser KnownFraudsterRisk -> Parser FraudRiskDetails
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser KnownFraudsterRisk
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"KnownFraudsterRisk")
      )

instance Prelude.Hashable FraudRiskDetails

instance Prelude.NFData FraudRiskDetails