{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data NotifyConfigurationType = NotifyConfigurationType'
{
NotifyConfigurationType -> Maybe NotifyEmailType
noActionEmail :: Prelude.Maybe NotifyEmailType,
NotifyConfigurationType -> Maybe Text
from :: Prelude.Maybe Prelude.Text,
NotifyConfigurationType -> Maybe Text
replyTo :: Prelude.Maybe Prelude.Text,
NotifyConfigurationType -> Maybe NotifyEmailType
blockEmail :: Prelude.Maybe NotifyEmailType,
NotifyConfigurationType -> Maybe NotifyEmailType
mfaEmail :: Prelude.Maybe NotifyEmailType,
NotifyConfigurationType -> Text
sourceArn :: Prelude.Text
}
deriving (NotifyConfigurationType -> NotifyConfigurationType -> Bool
(NotifyConfigurationType -> NotifyConfigurationType -> Bool)
-> (NotifyConfigurationType -> NotifyConfigurationType -> Bool)
-> Eq NotifyConfigurationType
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]
(Int -> ReadS NotifyConfigurationType)
-> ReadS [NotifyConfigurationType]
-> ReadPrec NotifyConfigurationType
-> ReadPrec [NotifyConfigurationType]
-> Read 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
(Int -> NotifyConfigurationType -> ShowS)
-> (NotifyConfigurationType -> String)
-> ([NotifyConfigurationType] -> ShowS)
-> Show NotifyConfigurationType
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.
NotifyConfigurationType -> Rep NotifyConfigurationType x)
-> (forall x.
Rep NotifyConfigurationType x -> NotifyConfigurationType)
-> Generic NotifyConfigurationType
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' :: Maybe NotifyEmailType
-> Maybe Text
-> Maybe Text
-> Maybe NotifyEmailType
-> Maybe NotifyEmailType
-> Text
-> NotifyConfigurationType
NotifyConfigurationType'
{ $sel:noActionEmail:NotifyConfigurationType' :: Maybe NotifyEmailType
noActionEmail =
Maybe NotifyEmailType
forall a. Maybe a
Prelude.Nothing,
$sel:from:NotifyConfigurationType' :: Maybe Text
from = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:replyTo:NotifyConfigurationType' :: Maybe Text
replyTo = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:blockEmail:NotifyConfigurationType' :: Maybe NotifyEmailType
blockEmail = Maybe NotifyEmailType
forall a. Maybe a
Prelude.Nothing,
$sel:mfaEmail:NotifyConfigurationType' :: Maybe NotifyEmailType
mfaEmail = Maybe NotifyEmailType
forall a. Maybe a
Prelude.Nothing,
$sel:sourceArn:NotifyConfigurationType' :: Text
sourceArn = Text
pSourceArn_
}
notifyConfigurationType_noActionEmail :: Lens.Lens' NotifyConfigurationType (Prelude.Maybe NotifyEmailType)
notifyConfigurationType_noActionEmail :: (Maybe NotifyEmailType -> f (Maybe NotifyEmailType))
-> NotifyConfigurationType -> f NotifyConfigurationType
notifyConfigurationType_noActionEmail = (NotifyConfigurationType -> Maybe NotifyEmailType)
-> (NotifyConfigurationType
-> Maybe NotifyEmailType -> NotifyConfigurationType)
-> Lens
NotifyConfigurationType
NotifyConfigurationType
(Maybe NotifyEmailType)
(Maybe NotifyEmailType)
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_from :: Lens.Lens' NotifyConfigurationType (Prelude.Maybe Prelude.Text)
notifyConfigurationType_from :: (Maybe Text -> f (Maybe Text))
-> NotifyConfigurationType -> f NotifyConfigurationType
notifyConfigurationType_from = (NotifyConfigurationType -> Maybe Text)
-> (NotifyConfigurationType
-> Maybe Text -> NotifyConfigurationType)
-> Lens
NotifyConfigurationType
NotifyConfigurationType
(Maybe Text)
(Maybe Text)
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_replyTo :: Lens.Lens' NotifyConfigurationType (Prelude.Maybe Prelude.Text)
notifyConfigurationType_replyTo :: (Maybe Text -> f (Maybe Text))
-> NotifyConfigurationType -> f NotifyConfigurationType
notifyConfigurationType_replyTo = (NotifyConfigurationType -> Maybe Text)
-> (NotifyConfigurationType
-> Maybe Text -> NotifyConfigurationType)
-> Lens
NotifyConfigurationType
NotifyConfigurationType
(Maybe Text)
(Maybe Text)
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_blockEmail :: Lens.Lens' NotifyConfigurationType (Prelude.Maybe NotifyEmailType)
notifyConfigurationType_blockEmail :: (Maybe NotifyEmailType -> f (Maybe NotifyEmailType))
-> NotifyConfigurationType -> f NotifyConfigurationType
notifyConfigurationType_blockEmail = (NotifyConfigurationType -> Maybe NotifyEmailType)
-> (NotifyConfigurationType
-> Maybe NotifyEmailType -> NotifyConfigurationType)
-> Lens
NotifyConfigurationType
NotifyConfigurationType
(Maybe NotifyEmailType)
(Maybe NotifyEmailType)
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_mfaEmail :: Lens.Lens' NotifyConfigurationType (Prelude.Maybe NotifyEmailType)
notifyConfigurationType_mfaEmail :: (Maybe NotifyEmailType -> f (Maybe NotifyEmailType))
-> NotifyConfigurationType -> f NotifyConfigurationType
notifyConfigurationType_mfaEmail = (NotifyConfigurationType -> Maybe NotifyEmailType)
-> (NotifyConfigurationType
-> Maybe NotifyEmailType -> NotifyConfigurationType)
-> Lens
NotifyConfigurationType
NotifyConfigurationType
(Maybe NotifyEmailType)
(Maybe NotifyEmailType)
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_sourceArn :: Lens.Lens' NotifyConfigurationType Prelude.Text
notifyConfigurationType_sourceArn :: (Text -> f Text)
-> NotifyConfigurationType -> f NotifyConfigurationType
notifyConfigurationType_sourceArn = (NotifyConfigurationType -> Text)
-> (NotifyConfigurationType -> Text -> NotifyConfigurationType)
-> Lens NotifyConfigurationType NotifyConfigurationType Text Text
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 Core.FromJSON NotifyConfigurationType where
parseJSON :: Value -> Parser NotifyConfigurationType
parseJSON =
String
-> (Object -> Parser NotifyConfigurationType)
-> Value
-> Parser NotifyConfigurationType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"NotifyConfigurationType"
( \Object
x ->
Maybe NotifyEmailType
-> Maybe Text
-> Maybe Text
-> Maybe NotifyEmailType
-> Maybe NotifyEmailType
-> Text
-> NotifyConfigurationType
NotifyConfigurationType'
(Maybe NotifyEmailType
-> Maybe Text
-> Maybe Text
-> Maybe NotifyEmailType
-> Maybe NotifyEmailType
-> Text
-> NotifyConfigurationType)
-> Parser (Maybe NotifyEmailType)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe NotifyEmailType
-> Maybe NotifyEmailType
-> Text
-> NotifyConfigurationType)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe NotifyEmailType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NoActionEmail")
Parser
(Maybe Text
-> Maybe Text
-> Maybe NotifyEmailType
-> Maybe NotifyEmailType
-> Text
-> NotifyConfigurationType)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe NotifyEmailType
-> Maybe NotifyEmailType
-> Text
-> NotifyConfigurationType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"From")
Parser
(Maybe Text
-> Maybe NotifyEmailType
-> Maybe NotifyEmailType
-> Text
-> NotifyConfigurationType)
-> Parser (Maybe Text)
-> Parser
(Maybe NotifyEmailType
-> Maybe NotifyEmailType -> Text -> NotifyConfigurationType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReplyTo")
Parser
(Maybe NotifyEmailType
-> Maybe NotifyEmailType -> Text -> NotifyConfigurationType)
-> Parser (Maybe NotifyEmailType)
-> Parser
(Maybe NotifyEmailType -> Text -> NotifyConfigurationType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NotifyEmailType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BlockEmail")
Parser (Maybe NotifyEmailType -> Text -> NotifyConfigurationType)
-> Parser (Maybe NotifyEmailType)
-> Parser (Text -> NotifyConfigurationType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NotifyEmailType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MfaEmail")
Parser (Text -> NotifyConfigurationType)
-> Parser Text -> Parser NotifyConfigurationType
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SourceArn")
)
instance Prelude.Hashable NotifyConfigurationType
instance Prelude.NFData NotifyConfigurationType
instance Core.ToJSON NotifyConfigurationType where
toJSON :: NotifyConfigurationType -> Value
toJSON NotifyConfigurationType' {Maybe Text
Maybe NotifyEmailType
Text
sourceArn :: Text
mfaEmail :: Maybe NotifyEmailType
blockEmail :: Maybe NotifyEmailType
replyTo :: Maybe Text
from :: Maybe Text
noActionEmail :: Maybe NotifyEmailType
$sel:sourceArn:NotifyConfigurationType' :: NotifyConfigurationType -> Text
$sel:mfaEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
$sel:blockEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
$sel:replyTo:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe Text
$sel:from:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe Text
$sel:noActionEmail:NotifyConfigurationType' :: NotifyConfigurationType -> Maybe NotifyEmailType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"NoActionEmail" Text -> NotifyEmailType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NotifyEmailType -> Pair) -> Maybe NotifyEmailType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotifyEmailType
noActionEmail,
(Text
"From" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
from,
(Text
"ReplyTo" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
replyTo,
(Text
"BlockEmail" Text -> NotifyEmailType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NotifyEmailType -> Pair) -> Maybe NotifyEmailType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotifyEmailType
blockEmail,
(Text
"MfaEmail" Text -> NotifyEmailType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NotifyEmailType -> Pair) -> Maybe NotifyEmailType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotifyEmailType
mfaEmail,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SourceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceArn)
]
)