{-# 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.ATIMetricDataPoint
-- 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.ATIMetricDataPoint where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The Account Takeover Insights (ATI) model performance metrics data
-- points.
--
-- /See:/ 'newATIMetricDataPoint' smart constructor.
data ATIMetricDataPoint = ATIMetricDataPoint'
  { -- | The anomaly discovery rate. This metric quantifies the percentage of
    -- anomalies that can be detected by the model at the selected score
    -- threshold. A lower score threshold increases the percentage of anomalies
    -- captured by the model, but would also require challenging a larger
    -- percentage of login events, leading to a higher customer friction.
    ATIMetricDataPoint -> Maybe Double
adr :: Prelude.Maybe Prelude.Double,
    -- | The account takeover discovery rate. This metric quantifies the
    -- percentage of account compromise events that can be detected by the
    -- model at the selected score threshold. This metric is only available if
    -- 50 or more entities with at-least one labeled account takeover event is
    -- present in the ingested dataset.
    ATIMetricDataPoint -> Maybe Double
atodr :: Prelude.Maybe Prelude.Double,
    -- | The challenge rate. This indicates the percentage of login events that
    -- the model recommends to challenge such as one-time password,
    -- multi-factor authentication, and investigations.
    ATIMetricDataPoint -> Maybe Double
cr :: Prelude.Maybe Prelude.Double,
    -- | The model\'s threshold that specifies an acceptable fraud capture rate.
    -- For example, a threshold of 500 means any model score 500 or above is
    -- labeled as fraud.
    ATIMetricDataPoint -> Maybe Double
threshold :: Prelude.Maybe Prelude.Double
  }
  deriving (ATIMetricDataPoint -> ATIMetricDataPoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ATIMetricDataPoint -> ATIMetricDataPoint -> Bool
$c/= :: ATIMetricDataPoint -> ATIMetricDataPoint -> Bool
== :: ATIMetricDataPoint -> ATIMetricDataPoint -> Bool
$c== :: ATIMetricDataPoint -> ATIMetricDataPoint -> Bool
Prelude.Eq, ReadPrec [ATIMetricDataPoint]
ReadPrec ATIMetricDataPoint
Int -> ReadS ATIMetricDataPoint
ReadS [ATIMetricDataPoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ATIMetricDataPoint]
$creadListPrec :: ReadPrec [ATIMetricDataPoint]
readPrec :: ReadPrec ATIMetricDataPoint
$creadPrec :: ReadPrec ATIMetricDataPoint
readList :: ReadS [ATIMetricDataPoint]
$creadList :: ReadS [ATIMetricDataPoint]
readsPrec :: Int -> ReadS ATIMetricDataPoint
$creadsPrec :: Int -> ReadS ATIMetricDataPoint
Prelude.Read, Int -> ATIMetricDataPoint -> ShowS
[ATIMetricDataPoint] -> ShowS
ATIMetricDataPoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ATIMetricDataPoint] -> ShowS
$cshowList :: [ATIMetricDataPoint] -> ShowS
show :: ATIMetricDataPoint -> String
$cshow :: ATIMetricDataPoint -> String
showsPrec :: Int -> ATIMetricDataPoint -> ShowS
$cshowsPrec :: Int -> ATIMetricDataPoint -> ShowS
Prelude.Show, forall x. Rep ATIMetricDataPoint x -> ATIMetricDataPoint
forall x. ATIMetricDataPoint -> Rep ATIMetricDataPoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ATIMetricDataPoint x -> ATIMetricDataPoint
$cfrom :: forall x. ATIMetricDataPoint -> Rep ATIMetricDataPoint x
Prelude.Generic)

-- |
-- Create a value of 'ATIMetricDataPoint' 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:
--
-- 'adr', 'aTIMetricDataPoint_adr' - The anomaly discovery rate. This metric quantifies the percentage of
-- anomalies that can be detected by the model at the selected score
-- threshold. A lower score threshold increases the percentage of anomalies
-- captured by the model, but would also require challenging a larger
-- percentage of login events, leading to a higher customer friction.
--
-- 'atodr', 'aTIMetricDataPoint_atodr' - The account takeover discovery rate. This metric quantifies the
-- percentage of account compromise events that can be detected by the
-- model at the selected score threshold. This metric is only available if
-- 50 or more entities with at-least one labeled account takeover event is
-- present in the ingested dataset.
--
-- 'cr', 'aTIMetricDataPoint_cr' - The challenge rate. This indicates the percentage of login events that
-- the model recommends to challenge such as one-time password,
-- multi-factor authentication, and investigations.
--
-- 'threshold', 'aTIMetricDataPoint_threshold' - The model\'s threshold that specifies an acceptable fraud capture rate.
-- For example, a threshold of 500 means any model score 500 or above is
-- labeled as fraud.
newATIMetricDataPoint ::
  ATIMetricDataPoint
newATIMetricDataPoint :: ATIMetricDataPoint
newATIMetricDataPoint =
  ATIMetricDataPoint'
    { $sel:adr:ATIMetricDataPoint' :: Maybe Double
adr = forall a. Maybe a
Prelude.Nothing,
      $sel:atodr:ATIMetricDataPoint' :: Maybe Double
atodr = forall a. Maybe a
Prelude.Nothing,
      $sel:cr:ATIMetricDataPoint' :: Maybe Double
cr = forall a. Maybe a
Prelude.Nothing,
      $sel:threshold:ATIMetricDataPoint' :: Maybe Double
threshold = forall a. Maybe a
Prelude.Nothing
    }

-- | The anomaly discovery rate. This metric quantifies the percentage of
-- anomalies that can be detected by the model at the selected score
-- threshold. A lower score threshold increases the percentage of anomalies
-- captured by the model, but would also require challenging a larger
-- percentage of login events, leading to a higher customer friction.
aTIMetricDataPoint_adr :: Lens.Lens' ATIMetricDataPoint (Prelude.Maybe Prelude.Double)
aTIMetricDataPoint_adr :: Lens' ATIMetricDataPoint (Maybe Double)
aTIMetricDataPoint_adr = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ATIMetricDataPoint' {Maybe Double
adr :: Maybe Double
$sel:adr:ATIMetricDataPoint' :: ATIMetricDataPoint -> Maybe Double
adr} -> Maybe Double
adr) (\s :: ATIMetricDataPoint
s@ATIMetricDataPoint' {} Maybe Double
a -> ATIMetricDataPoint
s {$sel:adr:ATIMetricDataPoint' :: Maybe Double
adr = Maybe Double
a} :: ATIMetricDataPoint)

-- | The account takeover discovery rate. This metric quantifies the
-- percentage of account compromise events that can be detected by the
-- model at the selected score threshold. This metric is only available if
-- 50 or more entities with at-least one labeled account takeover event is
-- present in the ingested dataset.
aTIMetricDataPoint_atodr :: Lens.Lens' ATIMetricDataPoint (Prelude.Maybe Prelude.Double)
aTIMetricDataPoint_atodr :: Lens' ATIMetricDataPoint (Maybe Double)
aTIMetricDataPoint_atodr = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ATIMetricDataPoint' {Maybe Double
atodr :: Maybe Double
$sel:atodr:ATIMetricDataPoint' :: ATIMetricDataPoint -> Maybe Double
atodr} -> Maybe Double
atodr) (\s :: ATIMetricDataPoint
s@ATIMetricDataPoint' {} Maybe Double
a -> ATIMetricDataPoint
s {$sel:atodr:ATIMetricDataPoint' :: Maybe Double
atodr = Maybe Double
a} :: ATIMetricDataPoint)

-- | The challenge rate. This indicates the percentage of login events that
-- the model recommends to challenge such as one-time password,
-- multi-factor authentication, and investigations.
aTIMetricDataPoint_cr :: Lens.Lens' ATIMetricDataPoint (Prelude.Maybe Prelude.Double)
aTIMetricDataPoint_cr :: Lens' ATIMetricDataPoint (Maybe Double)
aTIMetricDataPoint_cr = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ATIMetricDataPoint' {Maybe Double
cr :: Maybe Double
$sel:cr:ATIMetricDataPoint' :: ATIMetricDataPoint -> Maybe Double
cr} -> Maybe Double
cr) (\s :: ATIMetricDataPoint
s@ATIMetricDataPoint' {} Maybe Double
a -> ATIMetricDataPoint
s {$sel:cr:ATIMetricDataPoint' :: Maybe Double
cr = Maybe Double
a} :: ATIMetricDataPoint)

-- | The model\'s threshold that specifies an acceptable fraud capture rate.
-- For example, a threshold of 500 means any model score 500 or above is
-- labeled as fraud.
aTIMetricDataPoint_threshold :: Lens.Lens' ATIMetricDataPoint (Prelude.Maybe Prelude.Double)
aTIMetricDataPoint_threshold :: Lens' ATIMetricDataPoint (Maybe Double)
aTIMetricDataPoint_threshold = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ATIMetricDataPoint' {Maybe Double
threshold :: Maybe Double
$sel:threshold:ATIMetricDataPoint' :: ATIMetricDataPoint -> Maybe Double
threshold} -> Maybe Double
threshold) (\s :: ATIMetricDataPoint
s@ATIMetricDataPoint' {} Maybe Double
a -> ATIMetricDataPoint
s {$sel:threshold:ATIMetricDataPoint' :: Maybe Double
threshold = Maybe Double
a} :: ATIMetricDataPoint)

instance Data.FromJSON ATIMetricDataPoint where
  parseJSON :: Value -> Parser ATIMetricDataPoint
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ATIMetricDataPoint"
      ( \Object
x ->
          Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> ATIMetricDataPoint
ATIMetricDataPoint'
            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
"adr")
            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
"atodr")
            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
"cr")
            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
"threshold")
      )

instance Prelude.Hashable ATIMetricDataPoint where
  hashWithSalt :: Int -> ATIMetricDataPoint -> Int
hashWithSalt Int
_salt ATIMetricDataPoint' {Maybe Double
threshold :: Maybe Double
cr :: Maybe Double
atodr :: Maybe Double
adr :: Maybe Double
$sel:threshold:ATIMetricDataPoint' :: ATIMetricDataPoint -> Maybe Double
$sel:cr:ATIMetricDataPoint' :: ATIMetricDataPoint -> Maybe Double
$sel:atodr:ATIMetricDataPoint' :: ATIMetricDataPoint -> Maybe Double
$sel:adr:ATIMetricDataPoint' :: ATIMetricDataPoint -> Maybe Double
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
adr
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
atodr
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
cr
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
threshold

instance Prelude.NFData ATIMetricDataPoint where
  rnf :: ATIMetricDataPoint -> ()
rnf ATIMetricDataPoint' {Maybe Double
threshold :: Maybe Double
cr :: Maybe Double
atodr :: Maybe Double
adr :: Maybe Double
$sel:threshold:ATIMetricDataPoint' :: ATIMetricDataPoint -> Maybe Double
$sel:cr:ATIMetricDataPoint' :: ATIMetricDataPoint -> Maybe Double
$sel:atodr:ATIMetricDataPoint' :: ATIMetricDataPoint -> Maybe Double
$sel:adr:ATIMetricDataPoint' :: ATIMetricDataPoint -> Maybe Double
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
adr
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
atodr
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
cr
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
threshold