{-# 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.NotifyConfigurationType where
import Amazonka.CognitoIdentityProvider.Types.NotifyEmailType
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 NotifyConfigurationType = NotifyConfigurationType'
{
NotifyConfigurationType -> Maybe NotifyEmailType
blockEmail :: Prelude.Maybe NotifyEmailType,
NotifyConfigurationType -> Maybe Text
from :: Prelude.Maybe Prelude.Text,
NotifyConfigurationType -> Maybe NotifyEmailType
mfaEmail :: Prelude.Maybe NotifyEmailType,
NotifyConfigurationType -> Maybe NotifyEmailType
noActionEmail :: Prelude.Maybe NotifyEmailType,
NotifyConfigurationType -> Maybe Text
replyTo :: Prelude.Maybe Prelude.Text,
NotifyConfigurationType -> Text
sourceArn :: Prelude.Text
}
deriving (NotifyConfigurationType -> NotifyConfigurationType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NotifyConfigurationType -> NotifyConfigurationType -> Bool
$c/= :: NotifyConfigurationType -> NotifyConfigurationType -> Bool
== :: NotifyConfigurationType -> NotifyConfigurationType -> Bool
$c== :: NotifyConfigurationType -> NotifyConfigurationType -> Bool
Prelude.Eq, ReadPrec [NotifyConfigurationType]
ReadPrec NotifyConfigurationType
Int -> ReadS NotifyConfigurationType
ReadS [NotifyConfigurationType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NotifyConfigurationType]
$creadListPrec :: ReadPrec [NotifyConfigurationType]
readPrec :: ReadPrec NotifyConfigurationType
$creadPrec :: ReadPrec NotifyConfigurationType
readList :: ReadS [NotifyConfigurationType]
$creadList :: ReadS [NotifyConfigurationType]
readsPrec :: Int -> ReadS NotifyConfigurationType
$creadsPrec :: Int -> ReadS NotifyConfigurationType
Prelude.Read, Int -> NotifyConfigurationType -> ShowS
[NotifyConfigurationType] -> ShowS
NotifyConfigurationType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotifyConfigurationType] -> ShowS
$cshowList :: [NotifyConfigurationType] -> ShowS
show :: NotifyConfigurationType -> String
$cshow :: NotifyConfigurationType -> String
showsPrec :: Int -> NotifyConfigurationType -> ShowS
$cshowsPrec :: Int -> NotifyConfigurationType -> ShowS
Prelude.Show, forall x. Rep NotifyConfigurationType x -> NotifyConfigurationType
forall x. NotifyConfigurationType -> Rep NotifyConfigurationType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NotifyConfigurationType x -> NotifyConfigurationType
$cfrom :: forall x. NotifyConfigurationType -> Rep NotifyConfigurationType x
Prelude.Generic)
newNotifyConfigurationType ::
Prelude.Text ->
NotifyConfigurationType
newNotifyConfigurationType :: Text -> NotifyConfigurationType
newNotifyConfigurationType Text
pSourceArn_ =
NotifyConfigurationType'
{ $sel:blockEmail:NotifyConfigurationType' :: Maybe NotifyEmailType
blockEmail =
forall a. Maybe a
Prelude.Nothing,
$sel:from:NotifyConfigurationType' :: Maybe Text
from = forall a. Maybe a
Prelude.Nothing,
$sel:mfaEmail:NotifyConfigurationType' :: Maybe NotifyEmailType
mfaEmail = forall a. Maybe a
Prelude.Nothing,
$sel:noActionEmail:NotifyConfigurationType' :: Maybe NotifyEmailType
noActionEmail = forall a. Maybe a
Prelude.Nothing,
$sel:replyTo:NotifyConfigurationType' :: Maybe Text
replyTo = forall a. Maybe a
Prelude.Nothing,
$sel:sourceArn:NotifyConfigurationType' :: Text
sourceArn = Text
pSourceArn_
}
notifyConfigurationType_blockEmail :: Lens.Lens' NotifyConfigurationType (Prelude.Maybe NotifyEmailType)
notifyConfigurationType_blockEmail :: Lens' NotifyConfigurationType (Maybe NotifyEmailType)
notifyConfigurationType_blockEmail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotifyConfigurationType' {Maybe NotifyEmailType
blockEmail :: Maybe NotifyEmailType
$sel:blockEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
blockEmail} -> Maybe NotifyEmailType
blockEmail) (\s :: NotifyConfigurationType
s@NotifyConfigurationType' {} Maybe NotifyEmailType
a -> NotifyConfigurationType
s {$sel:blockEmail:NotifyConfigurationType' :: Maybe NotifyEmailType
blockEmail = Maybe NotifyEmailType
a} :: NotifyConfigurationType)
notifyConfigurationType_from :: Lens.Lens' NotifyConfigurationType (Prelude.Maybe Prelude.Text)
notifyConfigurationType_from :: Lens' NotifyConfigurationType (Maybe Text)
notifyConfigurationType_from = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotifyConfigurationType' {Maybe Text
from :: Maybe Text
$sel:from:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe Text
from} -> Maybe Text
from) (\s :: NotifyConfigurationType
s@NotifyConfigurationType' {} Maybe Text
a -> NotifyConfigurationType
s {$sel:from:NotifyConfigurationType' :: Maybe Text
from = Maybe Text
a} :: NotifyConfigurationType)
notifyConfigurationType_mfaEmail :: Lens.Lens' NotifyConfigurationType (Prelude.Maybe NotifyEmailType)
notifyConfigurationType_mfaEmail :: Lens' NotifyConfigurationType (Maybe NotifyEmailType)
notifyConfigurationType_mfaEmail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotifyConfigurationType' {Maybe NotifyEmailType
mfaEmail :: Maybe NotifyEmailType
$sel:mfaEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
mfaEmail} -> Maybe NotifyEmailType
mfaEmail) (\s :: NotifyConfigurationType
s@NotifyConfigurationType' {} Maybe NotifyEmailType
a -> NotifyConfigurationType
s {$sel:mfaEmail:NotifyConfigurationType' :: Maybe NotifyEmailType
mfaEmail = Maybe NotifyEmailType
a} :: NotifyConfigurationType)
notifyConfigurationType_noActionEmail :: Lens.Lens' NotifyConfigurationType (Prelude.Maybe NotifyEmailType)
notifyConfigurationType_noActionEmail :: Lens' NotifyConfigurationType (Maybe NotifyEmailType)
notifyConfigurationType_noActionEmail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotifyConfigurationType' {Maybe NotifyEmailType
noActionEmail :: Maybe NotifyEmailType
$sel:noActionEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
noActionEmail} -> Maybe NotifyEmailType
noActionEmail) (\s :: NotifyConfigurationType
s@NotifyConfigurationType' {} Maybe NotifyEmailType
a -> NotifyConfigurationType
s {$sel:noActionEmail:NotifyConfigurationType' :: Maybe NotifyEmailType
noActionEmail = Maybe NotifyEmailType
a} :: NotifyConfigurationType)
notifyConfigurationType_replyTo :: Lens.Lens' NotifyConfigurationType (Prelude.Maybe Prelude.Text)
notifyConfigurationType_replyTo :: Lens' NotifyConfigurationType (Maybe Text)
notifyConfigurationType_replyTo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotifyConfigurationType' {Maybe Text
replyTo :: Maybe Text
$sel:replyTo:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe Text
replyTo} -> Maybe Text
replyTo) (\s :: NotifyConfigurationType
s@NotifyConfigurationType' {} Maybe Text
a -> NotifyConfigurationType
s {$sel:replyTo:NotifyConfigurationType' :: Maybe Text
replyTo = Maybe Text
a} :: NotifyConfigurationType)
notifyConfigurationType_sourceArn :: Lens.Lens' NotifyConfigurationType Prelude.Text
notifyConfigurationType_sourceArn :: Lens' NotifyConfigurationType Text
notifyConfigurationType_sourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotifyConfigurationType' {Text
sourceArn :: Text
$sel:sourceArn:NotifyConfigurationType' :: NotifyConfigurationType -> Text
sourceArn} -> Text
sourceArn) (\s :: NotifyConfigurationType
s@NotifyConfigurationType' {} Text
a -> NotifyConfigurationType
s {$sel:sourceArn:NotifyConfigurationType' :: Text
sourceArn = Text
a} :: NotifyConfigurationType)
instance Data.FromJSON NotifyConfigurationType where
parseJSON :: Value -> Parser NotifyConfigurationType
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"NotifyConfigurationType"
( \Object
x ->
Maybe NotifyEmailType
-> Maybe Text
-> Maybe NotifyEmailType
-> Maybe NotifyEmailType
-> Maybe Text
-> Text
-> NotifyConfigurationType
NotifyConfigurationType'
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
"BlockEmail")
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
"From")
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
"MfaEmail")
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
"NoActionEmail")
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
"ReplyTo")
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
"SourceArn")
)
instance Prelude.Hashable NotifyConfigurationType where
hashWithSalt :: Int -> NotifyConfigurationType -> Int
hashWithSalt Int
_salt NotifyConfigurationType' {Maybe Text
Maybe NotifyEmailType
Text
sourceArn :: Text
replyTo :: Maybe Text
noActionEmail :: Maybe NotifyEmailType
mfaEmail :: Maybe NotifyEmailType
from :: Maybe Text
blockEmail :: Maybe NotifyEmailType
$sel:sourceArn:NotifyConfigurationType' :: NotifyConfigurationType -> Text
$sel:replyTo:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe Text
$sel:noActionEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
$sel:mfaEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
$sel:from:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe Text
$sel:blockEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NotifyEmailType
blockEmail
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
from
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NotifyEmailType
mfaEmail
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NotifyEmailType
noActionEmail
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
replyTo
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sourceArn
instance Prelude.NFData NotifyConfigurationType where
rnf :: NotifyConfigurationType -> ()
rnf NotifyConfigurationType' {Maybe Text
Maybe NotifyEmailType
Text
sourceArn :: Text
replyTo :: Maybe Text
noActionEmail :: Maybe NotifyEmailType
mfaEmail :: Maybe NotifyEmailType
from :: Maybe Text
blockEmail :: Maybe NotifyEmailType
$sel:sourceArn:NotifyConfigurationType' :: NotifyConfigurationType -> Text
$sel:replyTo:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe Text
$sel:noActionEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
$sel:mfaEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
$sel:from:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe Text
$sel:blockEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe NotifyEmailType
blockEmail
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
from
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NotifyEmailType
mfaEmail
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NotifyEmailType
noActionEmail
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
replyTo
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sourceArn
instance Data.ToJSON NotifyConfigurationType where
toJSON :: NotifyConfigurationType -> Value
toJSON NotifyConfigurationType' {Maybe Text
Maybe NotifyEmailType
Text
sourceArn :: Text
replyTo :: Maybe Text
noActionEmail :: Maybe NotifyEmailType
mfaEmail :: Maybe NotifyEmailType
from :: Maybe Text
blockEmail :: Maybe NotifyEmailType
$sel:sourceArn:NotifyConfigurationType' :: NotifyConfigurationType -> Text
$sel:replyTo:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe Text
$sel:noActionEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
$sel:mfaEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
$sel:from:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe Text
$sel:blockEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"BlockEmail" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotifyEmailType
blockEmail,
(Key
"From" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
from,
(Key
"MfaEmail" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotifyEmailType
mfaEmail,
(Key
"NoActionEmail" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotifyEmailType
noActionEmail,
(Key
"ReplyTo" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
replyTo,
forall a. a -> Maybe a
Prelude.Just (Key
"SourceArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
sourceArn)
]
)