{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AccountTakeoverActionType = AccountTakeoverActionType'
{
AccountTakeoverActionType -> Bool
notify :: Prelude.Bool,
AccountTakeoverActionType -> AccountTakeoverEventActionType
eventAction :: AccountTakeoverEventActionType
}
deriving (AccountTakeoverActionType -> AccountTakeoverActionType -> Bool
(AccountTakeoverActionType -> AccountTakeoverActionType -> Bool)
-> (AccountTakeoverActionType -> AccountTakeoverActionType -> Bool)
-> Eq AccountTakeoverActionType
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]
(Int -> ReadS AccountTakeoverActionType)
-> ReadS [AccountTakeoverActionType]
-> ReadPrec AccountTakeoverActionType
-> ReadPrec [AccountTakeoverActionType]
-> Read 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
(Int -> AccountTakeoverActionType -> ShowS)
-> (AccountTakeoverActionType -> String)
-> ([AccountTakeoverActionType] -> ShowS)
-> Show AccountTakeoverActionType
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.
AccountTakeoverActionType -> Rep AccountTakeoverActionType x)
-> (forall x.
Rep AccountTakeoverActionType x -> AccountTakeoverActionType)
-> Generic AccountTakeoverActionType
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' :: Bool -> AccountTakeoverEventActionType -> AccountTakeoverActionType
AccountTakeoverActionType'
{ $sel:notify:AccountTakeoverActionType' :: Bool
notify = Bool
pNotify_,
$sel:eventAction:AccountTakeoverActionType' :: AccountTakeoverEventActionType
eventAction = AccountTakeoverEventActionType
pEventAction_
}
accountTakeoverActionType_notify :: Lens.Lens' AccountTakeoverActionType Prelude.Bool
accountTakeoverActionType_notify :: (Bool -> f Bool)
-> AccountTakeoverActionType -> f AccountTakeoverActionType
accountTakeoverActionType_notify = (AccountTakeoverActionType -> Bool)
-> (AccountTakeoverActionType -> Bool -> AccountTakeoverActionType)
-> Lens
AccountTakeoverActionType AccountTakeoverActionType Bool Bool
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 :: (AccountTakeoverEventActionType
-> f AccountTakeoverEventActionType)
-> AccountTakeoverActionType -> f AccountTakeoverActionType
accountTakeoverActionType_eventAction = (AccountTakeoverActionType -> AccountTakeoverEventActionType)
-> (AccountTakeoverActionType
-> AccountTakeoverEventActionType -> AccountTakeoverActionType)
-> Lens
AccountTakeoverActionType
AccountTakeoverActionType
AccountTakeoverEventActionType
AccountTakeoverEventActionType
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 Core.FromJSON AccountTakeoverActionType where
parseJSON :: Value -> Parser AccountTakeoverActionType
parseJSON =
String
-> (Object -> Parser AccountTakeoverActionType)
-> Value
-> Parser AccountTakeoverActionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AccountTakeoverActionType"
( \Object
x ->
Bool -> AccountTakeoverEventActionType -> AccountTakeoverActionType
AccountTakeoverActionType'
(Bool
-> AccountTakeoverEventActionType -> AccountTakeoverActionType)
-> Parser Bool
-> Parser
(AccountTakeoverEventActionType -> AccountTakeoverActionType)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Notify")
Parser
(AccountTakeoverEventActionType -> AccountTakeoverActionType)
-> Parser AccountTakeoverEventActionType
-> Parser AccountTakeoverActionType
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AccountTakeoverEventActionType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"EventAction")
)
instance Prelude.Hashable AccountTakeoverActionType
instance Prelude.NFData AccountTakeoverActionType
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Notify" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
notify),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"EventAction" Text -> AccountTakeoverEventActionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AccountTakeoverEventActionType
eventAction)
]
)