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

-- | The details of the relative importance of the aggregated variables.
--
-- Account Takeover Insights (ATI) model uses event variables from the
-- login data you provide to continuously calculate a set of variables
-- (aggregated variables) based on historical events. For example, your ATI
-- model might calculate the number of times an user has logged in using
-- the same IP address. In this case, event variables used to derive the
-- aggregated variables are @IP address@ and @user@.
--
-- /See:/ 'newAggregatedVariablesImportanceMetrics' smart constructor.
data AggregatedVariablesImportanceMetrics = AggregatedVariablesImportanceMetrics'
  { -- | List of variables\' metrics.
    AggregatedVariablesImportanceMetrics
-> Maybe [AggregatedLogOddsMetric]
logOddsMetrics :: Prelude.Maybe [AggregatedLogOddsMetric]
  }
  deriving (AggregatedVariablesImportanceMetrics
-> AggregatedVariablesImportanceMetrics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AggregatedVariablesImportanceMetrics
-> AggregatedVariablesImportanceMetrics -> Bool
$c/= :: AggregatedVariablesImportanceMetrics
-> AggregatedVariablesImportanceMetrics -> Bool
== :: AggregatedVariablesImportanceMetrics
-> AggregatedVariablesImportanceMetrics -> Bool
$c== :: AggregatedVariablesImportanceMetrics
-> AggregatedVariablesImportanceMetrics -> Bool
Prelude.Eq, ReadPrec [AggregatedVariablesImportanceMetrics]
ReadPrec AggregatedVariablesImportanceMetrics
Int -> ReadS AggregatedVariablesImportanceMetrics
ReadS [AggregatedVariablesImportanceMetrics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AggregatedVariablesImportanceMetrics]
$creadListPrec :: ReadPrec [AggregatedVariablesImportanceMetrics]
readPrec :: ReadPrec AggregatedVariablesImportanceMetrics
$creadPrec :: ReadPrec AggregatedVariablesImportanceMetrics
readList :: ReadS [AggregatedVariablesImportanceMetrics]
$creadList :: ReadS [AggregatedVariablesImportanceMetrics]
readsPrec :: Int -> ReadS AggregatedVariablesImportanceMetrics
$creadsPrec :: Int -> ReadS AggregatedVariablesImportanceMetrics
Prelude.Read, Int -> AggregatedVariablesImportanceMetrics -> ShowS
[AggregatedVariablesImportanceMetrics] -> ShowS
AggregatedVariablesImportanceMetrics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AggregatedVariablesImportanceMetrics] -> ShowS
$cshowList :: [AggregatedVariablesImportanceMetrics] -> ShowS
show :: AggregatedVariablesImportanceMetrics -> String
$cshow :: AggregatedVariablesImportanceMetrics -> String
showsPrec :: Int -> AggregatedVariablesImportanceMetrics -> ShowS
$cshowsPrec :: Int -> AggregatedVariablesImportanceMetrics -> ShowS
Prelude.Show, forall x.
Rep AggregatedVariablesImportanceMetrics x
-> AggregatedVariablesImportanceMetrics
forall x.
AggregatedVariablesImportanceMetrics
-> Rep AggregatedVariablesImportanceMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AggregatedVariablesImportanceMetrics x
-> AggregatedVariablesImportanceMetrics
$cfrom :: forall x.
AggregatedVariablesImportanceMetrics
-> Rep AggregatedVariablesImportanceMetrics x
Prelude.Generic)

-- |
-- Create a value of 'AggregatedVariablesImportanceMetrics' 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', 'aggregatedVariablesImportanceMetrics_logOddsMetrics' - List of variables\' metrics.
newAggregatedVariablesImportanceMetrics ::
  AggregatedVariablesImportanceMetrics
newAggregatedVariablesImportanceMetrics :: AggregatedVariablesImportanceMetrics
newAggregatedVariablesImportanceMetrics =
  AggregatedVariablesImportanceMetrics'
    { $sel:logOddsMetrics:AggregatedVariablesImportanceMetrics' :: Maybe [AggregatedLogOddsMetric]
logOddsMetrics =
        forall a. Maybe a
Prelude.Nothing
    }

-- | List of variables\' metrics.
aggregatedVariablesImportanceMetrics_logOddsMetrics :: Lens.Lens' AggregatedVariablesImportanceMetrics (Prelude.Maybe [AggregatedLogOddsMetric])
aggregatedVariablesImportanceMetrics_logOddsMetrics :: Lens'
  AggregatedVariablesImportanceMetrics
  (Maybe [AggregatedLogOddsMetric])
aggregatedVariablesImportanceMetrics_logOddsMetrics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AggregatedVariablesImportanceMetrics' {Maybe [AggregatedLogOddsMetric]
logOddsMetrics :: Maybe [AggregatedLogOddsMetric]
$sel:logOddsMetrics:AggregatedVariablesImportanceMetrics' :: AggregatedVariablesImportanceMetrics
-> Maybe [AggregatedLogOddsMetric]
logOddsMetrics} -> Maybe [AggregatedLogOddsMetric]
logOddsMetrics) (\s :: AggregatedVariablesImportanceMetrics
s@AggregatedVariablesImportanceMetrics' {} Maybe [AggregatedLogOddsMetric]
a -> AggregatedVariablesImportanceMetrics
s {$sel:logOddsMetrics:AggregatedVariablesImportanceMetrics' :: Maybe [AggregatedLogOddsMetric]
logOddsMetrics = Maybe [AggregatedLogOddsMetric]
a} :: AggregatedVariablesImportanceMetrics) 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
    AggregatedVariablesImportanceMetrics
  where
  parseJSON :: Value -> Parser AggregatedVariablesImportanceMetrics
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AggregatedVariablesImportanceMetrics"
      ( \Object
x ->
          Maybe [AggregatedLogOddsMetric]
-> AggregatedVariablesImportanceMetrics
AggregatedVariablesImportanceMetrics'
            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
"logOddsMetrics"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance
  Prelude.Hashable
    AggregatedVariablesImportanceMetrics
  where
  hashWithSalt :: Int -> AggregatedVariablesImportanceMetrics -> Int
hashWithSalt
    Int
_salt
    AggregatedVariablesImportanceMetrics' {Maybe [AggregatedLogOddsMetric]
logOddsMetrics :: Maybe [AggregatedLogOddsMetric]
$sel:logOddsMetrics:AggregatedVariablesImportanceMetrics' :: AggregatedVariablesImportanceMetrics
-> Maybe [AggregatedLogOddsMetric]
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AggregatedLogOddsMetric]
logOddsMetrics

instance
  Prelude.NFData
    AggregatedVariablesImportanceMetrics
  where
  rnf :: AggregatedVariablesImportanceMetrics -> ()
rnf AggregatedVariablesImportanceMetrics' {Maybe [AggregatedLogOddsMetric]
logOddsMetrics :: Maybe [AggregatedLogOddsMetric]
$sel:logOddsMetrics:AggregatedVariablesImportanceMetrics' :: AggregatedVariablesImportanceMetrics
-> Maybe [AggregatedLogOddsMetric]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [AggregatedLogOddsMetric]
logOddsMetrics