{-# 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.VariableImportanceMetrics
-- 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.FraudDetector.Types.VariableImportanceMetrics where

import qualified Amazonka.Core as Core
import Amazonka.FraudDetector.Types.LogOddsMetric
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The variable importance metrics details.
--
-- /See:/ 'newVariableImportanceMetrics' smart constructor.
data VariableImportanceMetrics = VariableImportanceMetrics'
  { -- | List of variable metrics.
    VariableImportanceMetrics -> Maybe [LogOddsMetric]
logOddsMetrics :: Prelude.Maybe [LogOddsMetric]
  }
  deriving (VariableImportanceMetrics -> VariableImportanceMetrics -> Bool
(VariableImportanceMetrics -> VariableImportanceMetrics -> Bool)
-> (VariableImportanceMetrics -> VariableImportanceMetrics -> Bool)
-> Eq VariableImportanceMetrics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VariableImportanceMetrics -> VariableImportanceMetrics -> Bool
$c/= :: VariableImportanceMetrics -> VariableImportanceMetrics -> Bool
== :: VariableImportanceMetrics -> VariableImportanceMetrics -> Bool
$c== :: VariableImportanceMetrics -> VariableImportanceMetrics -> Bool
Prelude.Eq, ReadPrec [VariableImportanceMetrics]
ReadPrec VariableImportanceMetrics
Int -> ReadS VariableImportanceMetrics
ReadS [VariableImportanceMetrics]
(Int -> ReadS VariableImportanceMetrics)
-> ReadS [VariableImportanceMetrics]
-> ReadPrec VariableImportanceMetrics
-> ReadPrec [VariableImportanceMetrics]
-> Read VariableImportanceMetrics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VariableImportanceMetrics]
$creadListPrec :: ReadPrec [VariableImportanceMetrics]
readPrec :: ReadPrec VariableImportanceMetrics
$creadPrec :: ReadPrec VariableImportanceMetrics
readList :: ReadS [VariableImportanceMetrics]
$creadList :: ReadS [VariableImportanceMetrics]
readsPrec :: Int -> ReadS VariableImportanceMetrics
$creadsPrec :: Int -> ReadS VariableImportanceMetrics
Prelude.Read, Int -> VariableImportanceMetrics -> ShowS
[VariableImportanceMetrics] -> ShowS
VariableImportanceMetrics -> String
(Int -> VariableImportanceMetrics -> ShowS)
-> (VariableImportanceMetrics -> String)
-> ([VariableImportanceMetrics] -> ShowS)
-> Show VariableImportanceMetrics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VariableImportanceMetrics] -> ShowS
$cshowList :: [VariableImportanceMetrics] -> ShowS
show :: VariableImportanceMetrics -> String
$cshow :: VariableImportanceMetrics -> String
showsPrec :: Int -> VariableImportanceMetrics -> ShowS
$cshowsPrec :: Int -> VariableImportanceMetrics -> ShowS
Prelude.Show, (forall x.
 VariableImportanceMetrics -> Rep VariableImportanceMetrics x)
-> (forall x.
    Rep VariableImportanceMetrics x -> VariableImportanceMetrics)
-> Generic VariableImportanceMetrics
forall x.
Rep VariableImportanceMetrics x -> VariableImportanceMetrics
forall x.
VariableImportanceMetrics -> Rep VariableImportanceMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VariableImportanceMetrics x -> VariableImportanceMetrics
$cfrom :: forall x.
VariableImportanceMetrics -> Rep VariableImportanceMetrics x
Prelude.Generic)

-- |
-- Create a value of 'VariableImportanceMetrics' 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:
--
-- 'logOddsMetrics', 'variableImportanceMetrics_logOddsMetrics' - List of variable metrics.
newVariableImportanceMetrics ::
  VariableImportanceMetrics
newVariableImportanceMetrics :: VariableImportanceMetrics
newVariableImportanceMetrics =
  VariableImportanceMetrics' :: Maybe [LogOddsMetric] -> VariableImportanceMetrics
VariableImportanceMetrics'
    { $sel:logOddsMetrics:VariableImportanceMetrics' :: Maybe [LogOddsMetric]
logOddsMetrics =
        Maybe [LogOddsMetric]
forall a. Maybe a
Prelude.Nothing
    }

-- | List of variable metrics.
variableImportanceMetrics_logOddsMetrics :: Lens.Lens' VariableImportanceMetrics (Prelude.Maybe [LogOddsMetric])
variableImportanceMetrics_logOddsMetrics :: (Maybe [LogOddsMetric] -> f (Maybe [LogOddsMetric]))
-> VariableImportanceMetrics -> f VariableImportanceMetrics
variableImportanceMetrics_logOddsMetrics = (VariableImportanceMetrics -> Maybe [LogOddsMetric])
-> (VariableImportanceMetrics
    -> Maybe [LogOddsMetric] -> VariableImportanceMetrics)
-> Lens
     VariableImportanceMetrics
     VariableImportanceMetrics
     (Maybe [LogOddsMetric])
     (Maybe [LogOddsMetric])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VariableImportanceMetrics' {Maybe [LogOddsMetric]
logOddsMetrics :: Maybe [LogOddsMetric]
$sel:logOddsMetrics:VariableImportanceMetrics' :: VariableImportanceMetrics -> Maybe [LogOddsMetric]
logOddsMetrics} -> Maybe [LogOddsMetric]
logOddsMetrics) (\s :: VariableImportanceMetrics
s@VariableImportanceMetrics' {} Maybe [LogOddsMetric]
a -> VariableImportanceMetrics
s {$sel:logOddsMetrics:VariableImportanceMetrics' :: Maybe [LogOddsMetric]
logOddsMetrics = Maybe [LogOddsMetric]
a} :: VariableImportanceMetrics) ((Maybe [LogOddsMetric] -> f (Maybe [LogOddsMetric]))
 -> VariableImportanceMetrics -> f VariableImportanceMetrics)
-> ((Maybe [LogOddsMetric] -> f (Maybe [LogOddsMetric]))
    -> Maybe [LogOddsMetric] -> f (Maybe [LogOddsMetric]))
-> (Maybe [LogOddsMetric] -> f (Maybe [LogOddsMetric]))
-> VariableImportanceMetrics
-> f VariableImportanceMetrics
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LogOddsMetric] [LogOddsMetric] [LogOddsMetric] [LogOddsMetric]
-> Iso
     (Maybe [LogOddsMetric])
     (Maybe [LogOddsMetric])
     (Maybe [LogOddsMetric])
     (Maybe [LogOddsMetric])
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
  [LogOddsMetric] [LogOddsMetric] [LogOddsMetric] [LogOddsMetric]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON VariableImportanceMetrics where
  parseJSON :: Value -> Parser VariableImportanceMetrics
parseJSON =
    String
-> (Object -> Parser VariableImportanceMetrics)
-> Value
-> Parser VariableImportanceMetrics
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VariableImportanceMetrics"
      ( \Object
x ->
          Maybe [LogOddsMetric] -> VariableImportanceMetrics
VariableImportanceMetrics'
            (Maybe [LogOddsMetric] -> VariableImportanceMetrics)
-> Parser (Maybe [LogOddsMetric])
-> Parser VariableImportanceMetrics
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [LogOddsMetric]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"logOddsMetrics"
                            Parser (Maybe (Maybe [LogOddsMetric]))
-> Maybe [LogOddsMetric] -> Parser (Maybe [LogOddsMetric])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [LogOddsMetric]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable VariableImportanceMetrics

instance Prelude.NFData VariableImportanceMetrics