{-# 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.VoiceId.Types.EnrollmentJobFraudDetectionConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.VoiceId.Types.FraudDetectionAction
data EnrollmentJobFraudDetectionConfig = EnrollmentJobFraudDetectionConfig'
{
EnrollmentJobFraudDetectionConfig -> Maybe Natural
riskThreshold :: Prelude.Maybe Prelude.Natural,
EnrollmentJobFraudDetectionConfig -> Maybe FraudDetectionAction
fraudDetectionAction :: Prelude.Maybe FraudDetectionAction
}
deriving (EnrollmentJobFraudDetectionConfig
-> EnrollmentJobFraudDetectionConfig -> Bool
(EnrollmentJobFraudDetectionConfig
-> EnrollmentJobFraudDetectionConfig -> Bool)
-> (EnrollmentJobFraudDetectionConfig
-> EnrollmentJobFraudDetectionConfig -> Bool)
-> Eq EnrollmentJobFraudDetectionConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnrollmentJobFraudDetectionConfig
-> EnrollmentJobFraudDetectionConfig -> Bool
$c/= :: EnrollmentJobFraudDetectionConfig
-> EnrollmentJobFraudDetectionConfig -> Bool
== :: EnrollmentJobFraudDetectionConfig
-> EnrollmentJobFraudDetectionConfig -> Bool
$c== :: EnrollmentJobFraudDetectionConfig
-> EnrollmentJobFraudDetectionConfig -> Bool
Prelude.Eq, ReadPrec [EnrollmentJobFraudDetectionConfig]
ReadPrec EnrollmentJobFraudDetectionConfig
Int -> ReadS EnrollmentJobFraudDetectionConfig
ReadS [EnrollmentJobFraudDetectionConfig]
(Int -> ReadS EnrollmentJobFraudDetectionConfig)
-> ReadS [EnrollmentJobFraudDetectionConfig]
-> ReadPrec EnrollmentJobFraudDetectionConfig
-> ReadPrec [EnrollmentJobFraudDetectionConfig]
-> Read EnrollmentJobFraudDetectionConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnrollmentJobFraudDetectionConfig]
$creadListPrec :: ReadPrec [EnrollmentJobFraudDetectionConfig]
readPrec :: ReadPrec EnrollmentJobFraudDetectionConfig
$creadPrec :: ReadPrec EnrollmentJobFraudDetectionConfig
readList :: ReadS [EnrollmentJobFraudDetectionConfig]
$creadList :: ReadS [EnrollmentJobFraudDetectionConfig]
readsPrec :: Int -> ReadS EnrollmentJobFraudDetectionConfig
$creadsPrec :: Int -> ReadS EnrollmentJobFraudDetectionConfig
Prelude.Read, Int -> EnrollmentJobFraudDetectionConfig -> ShowS
[EnrollmentJobFraudDetectionConfig] -> ShowS
EnrollmentJobFraudDetectionConfig -> String
(Int -> EnrollmentJobFraudDetectionConfig -> ShowS)
-> (EnrollmentJobFraudDetectionConfig -> String)
-> ([EnrollmentJobFraudDetectionConfig] -> ShowS)
-> Show EnrollmentJobFraudDetectionConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnrollmentJobFraudDetectionConfig] -> ShowS
$cshowList :: [EnrollmentJobFraudDetectionConfig] -> ShowS
show :: EnrollmentJobFraudDetectionConfig -> String
$cshow :: EnrollmentJobFraudDetectionConfig -> String
showsPrec :: Int -> EnrollmentJobFraudDetectionConfig -> ShowS
$cshowsPrec :: Int -> EnrollmentJobFraudDetectionConfig -> ShowS
Prelude.Show, (forall x.
EnrollmentJobFraudDetectionConfig
-> Rep EnrollmentJobFraudDetectionConfig x)
-> (forall x.
Rep EnrollmentJobFraudDetectionConfig x
-> EnrollmentJobFraudDetectionConfig)
-> Generic EnrollmentJobFraudDetectionConfig
forall x.
Rep EnrollmentJobFraudDetectionConfig x
-> EnrollmentJobFraudDetectionConfig
forall x.
EnrollmentJobFraudDetectionConfig
-> Rep EnrollmentJobFraudDetectionConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnrollmentJobFraudDetectionConfig x
-> EnrollmentJobFraudDetectionConfig
$cfrom :: forall x.
EnrollmentJobFraudDetectionConfig
-> Rep EnrollmentJobFraudDetectionConfig x
Prelude.Generic)
newEnrollmentJobFraudDetectionConfig ::
EnrollmentJobFraudDetectionConfig
newEnrollmentJobFraudDetectionConfig :: EnrollmentJobFraudDetectionConfig
newEnrollmentJobFraudDetectionConfig =
EnrollmentJobFraudDetectionConfig' :: Maybe Natural
-> Maybe FraudDetectionAction -> EnrollmentJobFraudDetectionConfig
EnrollmentJobFraudDetectionConfig'
{ $sel:riskThreshold:EnrollmentJobFraudDetectionConfig' :: Maybe Natural
riskThreshold =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:fraudDetectionAction:EnrollmentJobFraudDetectionConfig' :: Maybe FraudDetectionAction
fraudDetectionAction = Maybe FraudDetectionAction
forall a. Maybe a
Prelude.Nothing
}
enrollmentJobFraudDetectionConfig_riskThreshold :: Lens.Lens' EnrollmentJobFraudDetectionConfig (Prelude.Maybe Prelude.Natural)
enrollmentJobFraudDetectionConfig_riskThreshold :: (Maybe Natural -> f (Maybe Natural))
-> EnrollmentJobFraudDetectionConfig
-> f EnrollmentJobFraudDetectionConfig
enrollmentJobFraudDetectionConfig_riskThreshold = (EnrollmentJobFraudDetectionConfig -> Maybe Natural)
-> (EnrollmentJobFraudDetectionConfig
-> Maybe Natural -> EnrollmentJobFraudDetectionConfig)
-> Lens
EnrollmentJobFraudDetectionConfig
EnrollmentJobFraudDetectionConfig
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnrollmentJobFraudDetectionConfig' {Maybe Natural
riskThreshold :: Maybe Natural
$sel:riskThreshold:EnrollmentJobFraudDetectionConfig' :: EnrollmentJobFraudDetectionConfig -> Maybe Natural
riskThreshold} -> Maybe Natural
riskThreshold) (\s :: EnrollmentJobFraudDetectionConfig
s@EnrollmentJobFraudDetectionConfig' {} Maybe Natural
a -> EnrollmentJobFraudDetectionConfig
s {$sel:riskThreshold:EnrollmentJobFraudDetectionConfig' :: Maybe Natural
riskThreshold = Maybe Natural
a} :: EnrollmentJobFraudDetectionConfig)
enrollmentJobFraudDetectionConfig_fraudDetectionAction :: Lens.Lens' EnrollmentJobFraudDetectionConfig (Prelude.Maybe FraudDetectionAction)
enrollmentJobFraudDetectionConfig_fraudDetectionAction :: (Maybe FraudDetectionAction -> f (Maybe FraudDetectionAction))
-> EnrollmentJobFraudDetectionConfig
-> f EnrollmentJobFraudDetectionConfig
enrollmentJobFraudDetectionConfig_fraudDetectionAction = (EnrollmentJobFraudDetectionConfig -> Maybe FraudDetectionAction)
-> (EnrollmentJobFraudDetectionConfig
-> Maybe FraudDetectionAction -> EnrollmentJobFraudDetectionConfig)
-> Lens
EnrollmentJobFraudDetectionConfig
EnrollmentJobFraudDetectionConfig
(Maybe FraudDetectionAction)
(Maybe FraudDetectionAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnrollmentJobFraudDetectionConfig' {Maybe FraudDetectionAction
fraudDetectionAction :: Maybe FraudDetectionAction
$sel:fraudDetectionAction:EnrollmentJobFraudDetectionConfig' :: EnrollmentJobFraudDetectionConfig -> Maybe FraudDetectionAction
fraudDetectionAction} -> Maybe FraudDetectionAction
fraudDetectionAction) (\s :: EnrollmentJobFraudDetectionConfig
s@EnrollmentJobFraudDetectionConfig' {} Maybe FraudDetectionAction
a -> EnrollmentJobFraudDetectionConfig
s {$sel:fraudDetectionAction:EnrollmentJobFraudDetectionConfig' :: Maybe FraudDetectionAction
fraudDetectionAction = Maybe FraudDetectionAction
a} :: EnrollmentJobFraudDetectionConfig)
instance
Core.FromJSON
EnrollmentJobFraudDetectionConfig
where
parseJSON :: Value -> Parser EnrollmentJobFraudDetectionConfig
parseJSON =
String
-> (Object -> Parser EnrollmentJobFraudDetectionConfig)
-> Value
-> Parser EnrollmentJobFraudDetectionConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EnrollmentJobFraudDetectionConfig"
( \Object
x ->
Maybe Natural
-> Maybe FraudDetectionAction -> EnrollmentJobFraudDetectionConfig
EnrollmentJobFraudDetectionConfig'
(Maybe Natural
-> Maybe FraudDetectionAction -> EnrollmentJobFraudDetectionConfig)
-> Parser (Maybe Natural)
-> Parser
(Maybe FraudDetectionAction -> EnrollmentJobFraudDetectionConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RiskThreshold")
Parser
(Maybe FraudDetectionAction -> EnrollmentJobFraudDetectionConfig)
-> Parser (Maybe FraudDetectionAction)
-> Parser EnrollmentJobFraudDetectionConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FraudDetectionAction)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FraudDetectionAction")
)
instance
Prelude.Hashable
EnrollmentJobFraudDetectionConfig
instance
Prelude.NFData
EnrollmentJobFraudDetectionConfig
instance
Core.ToJSON
EnrollmentJobFraudDetectionConfig
where
toJSON :: EnrollmentJobFraudDetectionConfig -> Value
toJSON EnrollmentJobFraudDetectionConfig' {Maybe Natural
Maybe FraudDetectionAction
fraudDetectionAction :: Maybe FraudDetectionAction
riskThreshold :: Maybe Natural
$sel:fraudDetectionAction:EnrollmentJobFraudDetectionConfig' :: EnrollmentJobFraudDetectionConfig -> Maybe FraudDetectionAction
$sel:riskThreshold:EnrollmentJobFraudDetectionConfig' :: EnrollmentJobFraudDetectionConfig -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"RiskThreshold" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
riskThreshold,
(Text
"FraudDetectionAction" Text -> FraudDetectionAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(FraudDetectionAction -> Pair)
-> Maybe FraudDetectionAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FraudDetectionAction
fraudDetectionAction
]
)