{-# 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.ModelVersionEvaluation
-- 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.ModelVersionEvaluation 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.PredictionExplanations
import qualified Amazonka.Prelude as Prelude

-- | The model version evalutions.
--
-- /See:/ 'newModelVersionEvaluation' smart constructor.
data ModelVersionEvaluation = ModelVersionEvaluation'
  { -- | The evaluation score generated for the model version.
    ModelVersionEvaluation -> Maybe Text
evaluationScore :: Prelude.Maybe Prelude.Text,
    -- | The output variable name.
    ModelVersionEvaluation -> Maybe Text
outputVariableName :: Prelude.Maybe Prelude.Text,
    -- | The prediction explanations generated for the model version.
    ModelVersionEvaluation -> Maybe PredictionExplanations
predictionExplanations :: Prelude.Maybe PredictionExplanations
  }
  deriving (ModelVersionEvaluation -> ModelVersionEvaluation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelVersionEvaluation -> ModelVersionEvaluation -> Bool
$c/= :: ModelVersionEvaluation -> ModelVersionEvaluation -> Bool
== :: ModelVersionEvaluation -> ModelVersionEvaluation -> Bool
$c== :: ModelVersionEvaluation -> ModelVersionEvaluation -> Bool
Prelude.Eq, ReadPrec [ModelVersionEvaluation]
ReadPrec ModelVersionEvaluation
Int -> ReadS ModelVersionEvaluation
ReadS [ModelVersionEvaluation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelVersionEvaluation]
$creadListPrec :: ReadPrec [ModelVersionEvaluation]
readPrec :: ReadPrec ModelVersionEvaluation
$creadPrec :: ReadPrec ModelVersionEvaluation
readList :: ReadS [ModelVersionEvaluation]
$creadList :: ReadS [ModelVersionEvaluation]
readsPrec :: Int -> ReadS ModelVersionEvaluation
$creadsPrec :: Int -> ReadS ModelVersionEvaluation
Prelude.Read, Int -> ModelVersionEvaluation -> ShowS
[ModelVersionEvaluation] -> ShowS
ModelVersionEvaluation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelVersionEvaluation] -> ShowS
$cshowList :: [ModelVersionEvaluation] -> ShowS
show :: ModelVersionEvaluation -> String
$cshow :: ModelVersionEvaluation -> String
showsPrec :: Int -> ModelVersionEvaluation -> ShowS
$cshowsPrec :: Int -> ModelVersionEvaluation -> ShowS
Prelude.Show, forall x. Rep ModelVersionEvaluation x -> ModelVersionEvaluation
forall x. ModelVersionEvaluation -> Rep ModelVersionEvaluation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModelVersionEvaluation x -> ModelVersionEvaluation
$cfrom :: forall x. ModelVersionEvaluation -> Rep ModelVersionEvaluation x
Prelude.Generic)

-- |
-- Create a value of 'ModelVersionEvaluation' 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:
--
-- 'evaluationScore', 'modelVersionEvaluation_evaluationScore' - The evaluation score generated for the model version.
--
-- 'outputVariableName', 'modelVersionEvaluation_outputVariableName' - The output variable name.
--
-- 'predictionExplanations', 'modelVersionEvaluation_predictionExplanations' - The prediction explanations generated for the model version.
newModelVersionEvaluation ::
  ModelVersionEvaluation
newModelVersionEvaluation :: ModelVersionEvaluation
newModelVersionEvaluation =
  ModelVersionEvaluation'
    { $sel:evaluationScore:ModelVersionEvaluation' :: Maybe Text
evaluationScore =
        forall a. Maybe a
Prelude.Nothing,
      $sel:outputVariableName:ModelVersionEvaluation' :: Maybe Text
outputVariableName = forall a. Maybe a
Prelude.Nothing,
      $sel:predictionExplanations:ModelVersionEvaluation' :: Maybe PredictionExplanations
predictionExplanations = forall a. Maybe a
Prelude.Nothing
    }

-- | The evaluation score generated for the model version.
modelVersionEvaluation_evaluationScore :: Lens.Lens' ModelVersionEvaluation (Prelude.Maybe Prelude.Text)
modelVersionEvaluation_evaluationScore :: Lens' ModelVersionEvaluation (Maybe Text)
modelVersionEvaluation_evaluationScore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelVersionEvaluation' {Maybe Text
evaluationScore :: Maybe Text
$sel:evaluationScore:ModelVersionEvaluation' :: ModelVersionEvaluation -> Maybe Text
evaluationScore} -> Maybe Text
evaluationScore) (\s :: ModelVersionEvaluation
s@ModelVersionEvaluation' {} Maybe Text
a -> ModelVersionEvaluation
s {$sel:evaluationScore:ModelVersionEvaluation' :: Maybe Text
evaluationScore = Maybe Text
a} :: ModelVersionEvaluation)

-- | The output variable name.
modelVersionEvaluation_outputVariableName :: Lens.Lens' ModelVersionEvaluation (Prelude.Maybe Prelude.Text)
modelVersionEvaluation_outputVariableName :: Lens' ModelVersionEvaluation (Maybe Text)
modelVersionEvaluation_outputVariableName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelVersionEvaluation' {Maybe Text
outputVariableName :: Maybe Text
$sel:outputVariableName:ModelVersionEvaluation' :: ModelVersionEvaluation -> Maybe Text
outputVariableName} -> Maybe Text
outputVariableName) (\s :: ModelVersionEvaluation
s@ModelVersionEvaluation' {} Maybe Text
a -> ModelVersionEvaluation
s {$sel:outputVariableName:ModelVersionEvaluation' :: Maybe Text
outputVariableName = Maybe Text
a} :: ModelVersionEvaluation)

-- | The prediction explanations generated for the model version.
modelVersionEvaluation_predictionExplanations :: Lens.Lens' ModelVersionEvaluation (Prelude.Maybe PredictionExplanations)
modelVersionEvaluation_predictionExplanations :: Lens' ModelVersionEvaluation (Maybe PredictionExplanations)
modelVersionEvaluation_predictionExplanations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelVersionEvaluation' {Maybe PredictionExplanations
predictionExplanations :: Maybe PredictionExplanations
$sel:predictionExplanations:ModelVersionEvaluation' :: ModelVersionEvaluation -> Maybe PredictionExplanations
predictionExplanations} -> Maybe PredictionExplanations
predictionExplanations) (\s :: ModelVersionEvaluation
s@ModelVersionEvaluation' {} Maybe PredictionExplanations
a -> ModelVersionEvaluation
s {$sel:predictionExplanations:ModelVersionEvaluation' :: Maybe PredictionExplanations
predictionExplanations = Maybe PredictionExplanations
a} :: ModelVersionEvaluation)

instance Data.FromJSON ModelVersionEvaluation where
  parseJSON :: Value -> Parser ModelVersionEvaluation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ModelVersionEvaluation"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe PredictionExplanations
-> ModelVersionEvaluation
ModelVersionEvaluation'
            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
"evaluationScore")
            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
"outputVariableName")
            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
"predictionExplanations")
      )

instance Prelude.Hashable ModelVersionEvaluation where
  hashWithSalt :: Int -> ModelVersionEvaluation -> Int
hashWithSalt Int
_salt ModelVersionEvaluation' {Maybe Text
Maybe PredictionExplanations
predictionExplanations :: Maybe PredictionExplanations
outputVariableName :: Maybe Text
evaluationScore :: Maybe Text
$sel:predictionExplanations:ModelVersionEvaluation' :: ModelVersionEvaluation -> Maybe PredictionExplanations
$sel:outputVariableName:ModelVersionEvaluation' :: ModelVersionEvaluation -> Maybe Text
$sel:evaluationScore:ModelVersionEvaluation' :: ModelVersionEvaluation -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
evaluationScore
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outputVariableName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PredictionExplanations
predictionExplanations

instance Prelude.NFData ModelVersionEvaluation where
  rnf :: ModelVersionEvaluation -> ()
rnf ModelVersionEvaluation' {Maybe Text
Maybe PredictionExplanations
predictionExplanations :: Maybe PredictionExplanations
outputVariableName :: Maybe Text
evaluationScore :: Maybe Text
$sel:predictionExplanations:ModelVersionEvaluation' :: ModelVersionEvaluation -> Maybe PredictionExplanations
$sel:outputVariableName:ModelVersionEvaluation' :: ModelVersionEvaluation -> Maybe Text
$sel:evaluationScore:ModelVersionEvaluation' :: ModelVersionEvaluation -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
evaluationScore
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outputVariableName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PredictionExplanations
predictionExplanations