{-# 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.AccountTakeoverActionType where
import Amazonka.CognitoIdentityProvider.Types.AccountTakeoverEventActionType
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 AccountTakeoverActionType = AccountTakeoverActionType'
{
AccountTakeoverActionType -> Bool
notify :: Prelude.Bool,
AccountTakeoverActionType -> AccountTakeoverEventActionType
eventAction :: AccountTakeoverEventActionType
}
deriving (AccountTakeoverActionType -> AccountTakeoverActionType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountTakeoverActionType -> AccountTakeoverActionType -> Bool
$c/= :: AccountTakeoverActionType -> AccountTakeoverActionType -> Bool
== :: AccountTakeoverActionType -> AccountTakeoverActionType -> Bool
$c== :: AccountTakeoverActionType -> AccountTakeoverActionType -> Bool
Prelude.Eq, ReadPrec [AccountTakeoverActionType]
ReadPrec AccountTakeoverActionType
Int -> ReadS AccountTakeoverActionType
ReadS [AccountTakeoverActionType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountTakeoverActionType]
$creadListPrec :: ReadPrec [AccountTakeoverActionType]
readPrec :: ReadPrec AccountTakeoverActionType
$creadPrec :: ReadPrec AccountTakeoverActionType
readList :: ReadS [AccountTakeoverActionType]
$creadList :: ReadS [AccountTakeoverActionType]
readsPrec :: Int -> ReadS AccountTakeoverActionType
$creadsPrec :: Int -> ReadS AccountTakeoverActionType
Prelude.Read, Int -> AccountTakeoverActionType -> ShowS
[AccountTakeoverActionType] -> ShowS
AccountTakeoverActionType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountTakeoverActionType] -> ShowS
$cshowList :: [AccountTakeoverActionType] -> ShowS
show :: AccountTakeoverActionType -> String
$cshow :: AccountTakeoverActionType -> String
showsPrec :: Int -> AccountTakeoverActionType -> ShowS
$cshowsPrec :: Int -> AccountTakeoverActionType -> ShowS
Prelude.Show, forall x.
Rep AccountTakeoverActionType x -> AccountTakeoverActionType
forall x.
AccountTakeoverActionType -> Rep AccountTakeoverActionType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AccountTakeoverActionType x -> AccountTakeoverActionType
$cfrom :: forall x.
AccountTakeoverActionType -> Rep AccountTakeoverActionType x
Prelude.Generic)
newAccountTakeoverActionType ::
Prelude.Bool ->
AccountTakeoverEventActionType ->
AccountTakeoverActionType
newAccountTakeoverActionType :: Bool -> AccountTakeoverEventActionType -> AccountTakeoverActionType
newAccountTakeoverActionType Bool
pNotify_ AccountTakeoverEventActionType
pEventAction_ =
AccountTakeoverActionType'
{ $sel:notify:AccountTakeoverActionType' :: Bool
notify = Bool
pNotify_,
$sel:eventAction:AccountTakeoverActionType' :: AccountTakeoverEventActionType
eventAction = AccountTakeoverEventActionType
pEventAction_
}
accountTakeoverActionType_notify :: Lens.Lens' AccountTakeoverActionType Prelude.Bool
accountTakeoverActionType_notify :: Lens' AccountTakeoverActionType Bool
accountTakeoverActionType_notify = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountTakeoverActionType' {Bool
notify :: Bool
$sel:notify:AccountTakeoverActionType' :: AccountTakeoverActionType -> Bool
notify} -> Bool
notify) (\s :: AccountTakeoverActionType
s@AccountTakeoverActionType' {} Bool
a -> AccountTakeoverActionType
s {$sel:notify:AccountTakeoverActionType' :: Bool
notify = Bool
a} :: AccountTakeoverActionType)
accountTakeoverActionType_eventAction :: Lens.Lens' AccountTakeoverActionType AccountTakeoverEventActionType
accountTakeoverActionType_eventAction :: Lens' AccountTakeoverActionType AccountTakeoverEventActionType
accountTakeoverActionType_eventAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountTakeoverActionType' {AccountTakeoverEventActionType
eventAction :: AccountTakeoverEventActionType
$sel:eventAction:AccountTakeoverActionType' :: AccountTakeoverActionType -> AccountTakeoverEventActionType
eventAction} -> AccountTakeoverEventActionType
eventAction) (\s :: AccountTakeoverActionType
s@AccountTakeoverActionType' {} AccountTakeoverEventActionType
a -> AccountTakeoverActionType
s {$sel:eventAction:AccountTakeoverActionType' :: AccountTakeoverEventActionType
eventAction = AccountTakeoverEventActionType
a} :: AccountTakeoverActionType)
instance Data.FromJSON AccountTakeoverActionType where
parseJSON :: Value -> Parser AccountTakeoverActionType
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AccountTakeoverActionType"
( \Object
x ->
Bool -> AccountTakeoverEventActionType -> AccountTakeoverActionType
AccountTakeoverActionType'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Notify")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"EventAction")
)
instance Prelude.Hashable AccountTakeoverActionType where
hashWithSalt :: Int -> AccountTakeoverActionType -> Int
hashWithSalt Int
_salt AccountTakeoverActionType' {Bool
AccountTakeoverEventActionType
eventAction :: AccountTakeoverEventActionType
notify :: Bool
$sel:eventAction:AccountTakeoverActionType' :: AccountTakeoverActionType -> AccountTakeoverEventActionType
$sel:notify:AccountTakeoverActionType' :: AccountTakeoverActionType -> Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
notify
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AccountTakeoverEventActionType
eventAction
instance Prelude.NFData AccountTakeoverActionType where
rnf :: AccountTakeoverActionType -> ()
rnf AccountTakeoverActionType' {Bool
AccountTakeoverEventActionType
eventAction :: AccountTakeoverEventActionType
notify :: Bool
$sel:eventAction:AccountTakeoverActionType' :: AccountTakeoverActionType -> AccountTakeoverEventActionType
$sel:notify:AccountTakeoverActionType' :: AccountTakeoverActionType -> Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Bool
notify
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AccountTakeoverEventActionType
eventAction
instance Data.ToJSON AccountTakeoverActionType where
toJSON :: AccountTakeoverActionType -> Value
toJSON AccountTakeoverActionType' {Bool
AccountTakeoverEventActionType
eventAction :: AccountTakeoverEventActionType
notify :: Bool
$sel:eventAction:AccountTakeoverActionType' :: AccountTakeoverActionType -> AccountTakeoverEventActionType
$sel:notify:AccountTakeoverActionType' :: AccountTakeoverActionType -> Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Notify" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
notify),
forall a. a -> Maybe a
Prelude.Just (Key
"EventAction" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AccountTakeoverEventActionType
eventAction)
]
)