{-# 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.CognitoIdentityProvider.Types.EventRiskType where
import Amazonka.CognitoIdentityProvider.Types.RiskDecisionType
import Amazonka.CognitoIdentityProvider.Types.RiskLevelType
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
data EventRiskType = EventRiskType'
{
EventRiskType -> Maybe Bool
compromisedCredentialsDetected :: Prelude.Maybe Prelude.Bool,
EventRiskType -> Maybe RiskDecisionType
riskDecision :: Prelude.Maybe RiskDecisionType,
EventRiskType -> Maybe RiskLevelType
riskLevel :: Prelude.Maybe RiskLevelType
}
deriving (EventRiskType -> EventRiskType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventRiskType -> EventRiskType -> Bool
$c/= :: EventRiskType -> EventRiskType -> Bool
== :: EventRiskType -> EventRiskType -> Bool
$c== :: EventRiskType -> EventRiskType -> Bool
Prelude.Eq, ReadPrec [EventRiskType]
ReadPrec EventRiskType
Int -> ReadS EventRiskType
ReadS [EventRiskType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventRiskType]
$creadListPrec :: ReadPrec [EventRiskType]
readPrec :: ReadPrec EventRiskType
$creadPrec :: ReadPrec EventRiskType
readList :: ReadS [EventRiskType]
$creadList :: ReadS [EventRiskType]
readsPrec :: Int -> ReadS EventRiskType
$creadsPrec :: Int -> ReadS EventRiskType
Prelude.Read, Int -> EventRiskType -> ShowS
[EventRiskType] -> ShowS
EventRiskType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventRiskType] -> ShowS
$cshowList :: [EventRiskType] -> ShowS
show :: EventRiskType -> String
$cshow :: EventRiskType -> String
showsPrec :: Int -> EventRiskType -> ShowS
$cshowsPrec :: Int -> EventRiskType -> ShowS
Prelude.Show, forall x. Rep EventRiskType x -> EventRiskType
forall x. EventRiskType -> Rep EventRiskType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventRiskType x -> EventRiskType
$cfrom :: forall x. EventRiskType -> Rep EventRiskType x
Prelude.Generic)
newEventRiskType ::
EventRiskType
newEventRiskType :: EventRiskType
newEventRiskType =
EventRiskType'
{ $sel:compromisedCredentialsDetected:EventRiskType' :: Maybe Bool
compromisedCredentialsDetected =
forall a. Maybe a
Prelude.Nothing,
$sel:riskDecision:EventRiskType' :: Maybe RiskDecisionType
riskDecision = forall a. Maybe a
Prelude.Nothing,
$sel:riskLevel:EventRiskType' :: Maybe RiskLevelType
riskLevel = forall a. Maybe a
Prelude.Nothing
}
eventRiskType_compromisedCredentialsDetected :: Lens.Lens' EventRiskType (Prelude.Maybe Prelude.Bool)
eventRiskType_compromisedCredentialsDetected :: Lens' EventRiskType (Maybe Bool)
eventRiskType_compromisedCredentialsDetected = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventRiskType' {Maybe Bool
compromisedCredentialsDetected :: Maybe Bool
$sel:compromisedCredentialsDetected:EventRiskType' :: EventRiskType -> Maybe Bool
compromisedCredentialsDetected} -> Maybe Bool
compromisedCredentialsDetected) (\s :: EventRiskType
s@EventRiskType' {} Maybe Bool
a -> EventRiskType
s {$sel:compromisedCredentialsDetected:EventRiskType' :: Maybe Bool
compromisedCredentialsDetected = Maybe Bool
a} :: EventRiskType)
eventRiskType_riskDecision :: Lens.Lens' EventRiskType (Prelude.Maybe RiskDecisionType)
eventRiskType_riskDecision :: Lens' EventRiskType (Maybe RiskDecisionType)
eventRiskType_riskDecision = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventRiskType' {Maybe RiskDecisionType
riskDecision :: Maybe RiskDecisionType
$sel:riskDecision:EventRiskType' :: EventRiskType -> Maybe RiskDecisionType
riskDecision} -> Maybe RiskDecisionType
riskDecision) (\s :: EventRiskType
s@EventRiskType' {} Maybe RiskDecisionType
a -> EventRiskType
s {$sel:riskDecision:EventRiskType' :: Maybe RiskDecisionType
riskDecision = Maybe RiskDecisionType
a} :: EventRiskType)
eventRiskType_riskLevel :: Lens.Lens' EventRiskType (Prelude.Maybe RiskLevelType)
eventRiskType_riskLevel :: Lens' EventRiskType (Maybe RiskLevelType)
eventRiskType_riskLevel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventRiskType' {Maybe RiskLevelType
riskLevel :: Maybe RiskLevelType
$sel:riskLevel:EventRiskType' :: EventRiskType -> Maybe RiskLevelType
riskLevel} -> Maybe RiskLevelType
riskLevel) (\s :: EventRiskType
s@EventRiskType' {} Maybe RiskLevelType
a -> EventRiskType
s {$sel:riskLevel:EventRiskType' :: Maybe RiskLevelType
riskLevel = Maybe RiskLevelType
a} :: EventRiskType)
instance Data.FromJSON EventRiskType where
parseJSON :: Value -> Parser EventRiskType
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EventRiskType"
( \Object
x ->
Maybe Bool
-> Maybe RiskDecisionType -> Maybe RiskLevelType -> EventRiskType
EventRiskType'
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
"CompromisedCredentialsDetected")
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
"RiskDecision")
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
"RiskLevel")
)
instance Prelude.Hashable EventRiskType where
hashWithSalt :: Int -> EventRiskType -> Int
hashWithSalt Int
_salt EventRiskType' {Maybe Bool
Maybe RiskDecisionType
Maybe RiskLevelType
riskLevel :: Maybe RiskLevelType
riskDecision :: Maybe RiskDecisionType
compromisedCredentialsDetected :: Maybe Bool
$sel:riskLevel:EventRiskType' :: EventRiskType -> Maybe RiskLevelType
$sel:riskDecision:EventRiskType' :: EventRiskType -> Maybe RiskDecisionType
$sel:compromisedCredentialsDetected:EventRiskType' :: EventRiskType -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
compromisedCredentialsDetected
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RiskDecisionType
riskDecision
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RiskLevelType
riskLevel
instance Prelude.NFData EventRiskType where
rnf :: EventRiskType -> ()
rnf EventRiskType' {Maybe Bool
Maybe RiskDecisionType
Maybe RiskLevelType
riskLevel :: Maybe RiskLevelType
riskDecision :: Maybe RiskDecisionType
compromisedCredentialsDetected :: Maybe Bool
$sel:riskLevel:EventRiskType' :: EventRiskType -> Maybe RiskLevelType
$sel:riskDecision:EventRiskType' :: EventRiskType -> Maybe RiskDecisionType
$sel:compromisedCredentialsDetected:EventRiskType' :: EventRiskType -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
compromisedCredentialsDetected
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RiskDecisionType
riskDecision
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RiskLevelType
riskLevel