{-# 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.PredictionExplanations where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FraudDetector.Types.AggregatedVariablesImpactExplanation
import Amazonka.FraudDetector.Types.VariableImpactExplanation
import qualified Amazonka.Prelude as Prelude
data PredictionExplanations = PredictionExplanations'
{
PredictionExplanations
-> Maybe [AggregatedVariablesImpactExplanation]
aggregatedVariablesImpactExplanations :: Prelude.Maybe [AggregatedVariablesImpactExplanation],
PredictionExplanations -> Maybe [VariableImpactExplanation]
variableImpactExplanations :: Prelude.Maybe [VariableImpactExplanation]
}
deriving (PredictionExplanations -> PredictionExplanations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PredictionExplanations -> PredictionExplanations -> Bool
$c/= :: PredictionExplanations -> PredictionExplanations -> Bool
== :: PredictionExplanations -> PredictionExplanations -> Bool
$c== :: PredictionExplanations -> PredictionExplanations -> Bool
Prelude.Eq, ReadPrec [PredictionExplanations]
ReadPrec PredictionExplanations
Int -> ReadS PredictionExplanations
ReadS [PredictionExplanations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PredictionExplanations]
$creadListPrec :: ReadPrec [PredictionExplanations]
readPrec :: ReadPrec PredictionExplanations
$creadPrec :: ReadPrec PredictionExplanations
readList :: ReadS [PredictionExplanations]
$creadList :: ReadS [PredictionExplanations]
readsPrec :: Int -> ReadS PredictionExplanations
$creadsPrec :: Int -> ReadS PredictionExplanations
Prelude.Read, Int -> PredictionExplanations -> ShowS
[PredictionExplanations] -> ShowS
PredictionExplanations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PredictionExplanations] -> ShowS
$cshowList :: [PredictionExplanations] -> ShowS
show :: PredictionExplanations -> String
$cshow :: PredictionExplanations -> String
showsPrec :: Int -> PredictionExplanations -> ShowS
$cshowsPrec :: Int -> PredictionExplanations -> ShowS
Prelude.Show, forall x. Rep PredictionExplanations x -> PredictionExplanations
forall x. PredictionExplanations -> Rep PredictionExplanations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PredictionExplanations x -> PredictionExplanations
$cfrom :: forall x. PredictionExplanations -> Rep PredictionExplanations x
Prelude.Generic)
newPredictionExplanations ::
PredictionExplanations
newPredictionExplanations :: PredictionExplanations
newPredictionExplanations =
PredictionExplanations'
{ $sel:aggregatedVariablesImpactExplanations:PredictionExplanations' :: Maybe [AggregatedVariablesImpactExplanation]
aggregatedVariablesImpactExplanations =
forall a. Maybe a
Prelude.Nothing,
$sel:variableImpactExplanations:PredictionExplanations' :: Maybe [VariableImpactExplanation]
variableImpactExplanations = forall a. Maybe a
Prelude.Nothing
}
predictionExplanations_aggregatedVariablesImpactExplanations :: Lens.Lens' PredictionExplanations (Prelude.Maybe [AggregatedVariablesImpactExplanation])
predictionExplanations_aggregatedVariablesImpactExplanations :: Lens'
PredictionExplanations
(Maybe [AggregatedVariablesImpactExplanation])
predictionExplanations_aggregatedVariablesImpactExplanations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictionExplanations' {Maybe [AggregatedVariablesImpactExplanation]
aggregatedVariablesImpactExplanations :: Maybe [AggregatedVariablesImpactExplanation]
$sel:aggregatedVariablesImpactExplanations:PredictionExplanations' :: PredictionExplanations
-> Maybe [AggregatedVariablesImpactExplanation]
aggregatedVariablesImpactExplanations} -> Maybe [AggregatedVariablesImpactExplanation]
aggregatedVariablesImpactExplanations) (\s :: PredictionExplanations
s@PredictionExplanations' {} Maybe [AggregatedVariablesImpactExplanation]
a -> PredictionExplanations
s {$sel:aggregatedVariablesImpactExplanations:PredictionExplanations' :: Maybe [AggregatedVariablesImpactExplanation]
aggregatedVariablesImpactExplanations = Maybe [AggregatedVariablesImpactExplanation]
a} :: PredictionExplanations) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
predictionExplanations_variableImpactExplanations :: Lens.Lens' PredictionExplanations (Prelude.Maybe [VariableImpactExplanation])
predictionExplanations_variableImpactExplanations :: Lens' PredictionExplanations (Maybe [VariableImpactExplanation])
predictionExplanations_variableImpactExplanations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictionExplanations' {Maybe [VariableImpactExplanation]
variableImpactExplanations :: Maybe [VariableImpactExplanation]
$sel:variableImpactExplanations:PredictionExplanations' :: PredictionExplanations -> Maybe [VariableImpactExplanation]
variableImpactExplanations} -> Maybe [VariableImpactExplanation]
variableImpactExplanations) (\s :: PredictionExplanations
s@PredictionExplanations' {} Maybe [VariableImpactExplanation]
a -> PredictionExplanations
s {$sel:variableImpactExplanations:PredictionExplanations' :: Maybe [VariableImpactExplanation]
variableImpactExplanations = Maybe [VariableImpactExplanation]
a} :: PredictionExplanations) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON PredictionExplanations where
parseJSON :: Value -> Parser PredictionExplanations
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PredictionExplanations"
( \Object
x ->
Maybe [AggregatedVariablesImpactExplanation]
-> Maybe [VariableImpactExplanation] -> PredictionExplanations
PredictionExplanations'
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
"aggregatedVariablesImpactExplanations"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"variableImpactExplanations"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable PredictionExplanations where
hashWithSalt :: Int -> PredictionExplanations -> Int
hashWithSalt Int
_salt PredictionExplanations' {Maybe [AggregatedVariablesImpactExplanation]
Maybe [VariableImpactExplanation]
variableImpactExplanations :: Maybe [VariableImpactExplanation]
aggregatedVariablesImpactExplanations :: Maybe [AggregatedVariablesImpactExplanation]
$sel:variableImpactExplanations:PredictionExplanations' :: PredictionExplanations -> Maybe [VariableImpactExplanation]
$sel:aggregatedVariablesImpactExplanations:PredictionExplanations' :: PredictionExplanations
-> Maybe [AggregatedVariablesImpactExplanation]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AggregatedVariablesImpactExplanation]
aggregatedVariablesImpactExplanations
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [VariableImpactExplanation]
variableImpactExplanations
instance Prelude.NFData PredictionExplanations where
rnf :: PredictionExplanations -> ()
rnf PredictionExplanations' {Maybe [AggregatedVariablesImpactExplanation]
Maybe [VariableImpactExplanation]
variableImpactExplanations :: Maybe [VariableImpactExplanation]
aggregatedVariablesImpactExplanations :: Maybe [AggregatedVariablesImpactExplanation]
$sel:variableImpactExplanations:PredictionExplanations' :: PredictionExplanations -> Maybe [VariableImpactExplanation]
$sel:aggregatedVariablesImpactExplanations:PredictionExplanations' :: PredictionExplanations
-> Maybe [AggregatedVariablesImpactExplanation]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AggregatedVariablesImpactExplanation]
aggregatedVariablesImpactExplanations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [VariableImpactExplanation]
variableImpactExplanations