{-# 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.Pinpoint.Types.EmailChannelRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EmailChannelRequest = EmailChannelRequest'
{
EmailChannelRequest -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
EmailChannelRequest -> Maybe Text
configurationSet :: Prelude.Maybe Prelude.Text,
EmailChannelRequest -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
EmailChannelRequest -> Text
fromAddress :: Prelude.Text,
EmailChannelRequest -> Text
identity :: Prelude.Text
}
deriving (EmailChannelRequest -> EmailChannelRequest -> Bool
(EmailChannelRequest -> EmailChannelRequest -> Bool)
-> (EmailChannelRequest -> EmailChannelRequest -> Bool)
-> Eq EmailChannelRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EmailChannelRequest -> EmailChannelRequest -> Bool
$c/= :: EmailChannelRequest -> EmailChannelRequest -> Bool
== :: EmailChannelRequest -> EmailChannelRequest -> Bool
$c== :: EmailChannelRequest -> EmailChannelRequest -> Bool
Prelude.Eq, ReadPrec [EmailChannelRequest]
ReadPrec EmailChannelRequest
Int -> ReadS EmailChannelRequest
ReadS [EmailChannelRequest]
(Int -> ReadS EmailChannelRequest)
-> ReadS [EmailChannelRequest]
-> ReadPrec EmailChannelRequest
-> ReadPrec [EmailChannelRequest]
-> Read EmailChannelRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EmailChannelRequest]
$creadListPrec :: ReadPrec [EmailChannelRequest]
readPrec :: ReadPrec EmailChannelRequest
$creadPrec :: ReadPrec EmailChannelRequest
readList :: ReadS [EmailChannelRequest]
$creadList :: ReadS [EmailChannelRequest]
readsPrec :: Int -> ReadS EmailChannelRequest
$creadsPrec :: Int -> ReadS EmailChannelRequest
Prelude.Read, Int -> EmailChannelRequest -> ShowS
[EmailChannelRequest] -> ShowS
EmailChannelRequest -> String
(Int -> EmailChannelRequest -> ShowS)
-> (EmailChannelRequest -> String)
-> ([EmailChannelRequest] -> ShowS)
-> Show EmailChannelRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EmailChannelRequest] -> ShowS
$cshowList :: [EmailChannelRequest] -> ShowS
show :: EmailChannelRequest -> String
$cshow :: EmailChannelRequest -> String
showsPrec :: Int -> EmailChannelRequest -> ShowS
$cshowsPrec :: Int -> EmailChannelRequest -> ShowS
Prelude.Show, (forall x. EmailChannelRequest -> Rep EmailChannelRequest x)
-> (forall x. Rep EmailChannelRequest x -> EmailChannelRequest)
-> Generic EmailChannelRequest
forall x. Rep EmailChannelRequest x -> EmailChannelRequest
forall x. EmailChannelRequest -> Rep EmailChannelRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EmailChannelRequest x -> EmailChannelRequest
$cfrom :: forall x. EmailChannelRequest -> Rep EmailChannelRequest x
Prelude.Generic)
newEmailChannelRequest ::
Prelude.Text ->
Prelude.Text ->
EmailChannelRequest
newEmailChannelRequest :: Text -> Text -> EmailChannelRequest
newEmailChannelRequest Text
pFromAddress_ Text
pIdentity_ =
EmailChannelRequest' :: Maybe Bool
-> Maybe Text -> Maybe Text -> Text -> Text -> EmailChannelRequest
EmailChannelRequest'
{ $sel:enabled:EmailChannelRequest' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:configurationSet:EmailChannelRequest' :: Maybe Text
configurationSet = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:EmailChannelRequest' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fromAddress:EmailChannelRequest' :: Text
fromAddress = Text
pFromAddress_,
$sel:identity:EmailChannelRequest' :: Text
identity = Text
pIdentity_
}
emailChannelRequest_enabled :: Lens.Lens' EmailChannelRequest (Prelude.Maybe Prelude.Bool)
emailChannelRequest_enabled :: (Maybe Bool -> f (Maybe Bool))
-> EmailChannelRequest -> f EmailChannelRequest
emailChannelRequest_enabled = (EmailChannelRequest -> Maybe Bool)
-> (EmailChannelRequest -> Maybe Bool -> EmailChannelRequest)
-> Lens
EmailChannelRequest EmailChannelRequest (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailChannelRequest' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:EmailChannelRequest' :: EmailChannelRequest -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: EmailChannelRequest
s@EmailChannelRequest' {} Maybe Bool
a -> EmailChannelRequest
s {$sel:enabled:EmailChannelRequest' :: Maybe Bool
enabled = Maybe Bool
a} :: EmailChannelRequest)
emailChannelRequest_configurationSet :: Lens.Lens' EmailChannelRequest (Prelude.Maybe Prelude.Text)
emailChannelRequest_configurationSet :: (Maybe Text -> f (Maybe Text))
-> EmailChannelRequest -> f EmailChannelRequest
emailChannelRequest_configurationSet = (EmailChannelRequest -> Maybe Text)
-> (EmailChannelRequest -> Maybe Text -> EmailChannelRequest)
-> Lens
EmailChannelRequest EmailChannelRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailChannelRequest' {Maybe Text
configurationSet :: Maybe Text
$sel:configurationSet:EmailChannelRequest' :: EmailChannelRequest -> Maybe Text
configurationSet} -> Maybe Text
configurationSet) (\s :: EmailChannelRequest
s@EmailChannelRequest' {} Maybe Text
a -> EmailChannelRequest
s {$sel:configurationSet:EmailChannelRequest' :: Maybe Text
configurationSet = Maybe Text
a} :: EmailChannelRequest)
emailChannelRequest_roleArn :: Lens.Lens' EmailChannelRequest (Prelude.Maybe Prelude.Text)
emailChannelRequest_roleArn :: (Maybe Text -> f (Maybe Text))
-> EmailChannelRequest -> f EmailChannelRequest
emailChannelRequest_roleArn = (EmailChannelRequest -> Maybe Text)
-> (EmailChannelRequest -> Maybe Text -> EmailChannelRequest)
-> Lens
EmailChannelRequest EmailChannelRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailChannelRequest' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:EmailChannelRequest' :: EmailChannelRequest -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: EmailChannelRequest
s@EmailChannelRequest' {} Maybe Text
a -> EmailChannelRequest
s {$sel:roleArn:EmailChannelRequest' :: Maybe Text
roleArn = Maybe Text
a} :: EmailChannelRequest)
emailChannelRequest_fromAddress :: Lens.Lens' EmailChannelRequest Prelude.Text
emailChannelRequest_fromAddress :: (Text -> f Text) -> EmailChannelRequest -> f EmailChannelRequest
emailChannelRequest_fromAddress = (EmailChannelRequest -> Text)
-> (EmailChannelRequest -> Text -> EmailChannelRequest)
-> Lens EmailChannelRequest EmailChannelRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailChannelRequest' {Text
fromAddress :: Text
$sel:fromAddress:EmailChannelRequest' :: EmailChannelRequest -> Text
fromAddress} -> Text
fromAddress) (\s :: EmailChannelRequest
s@EmailChannelRequest' {} Text
a -> EmailChannelRequest
s {$sel:fromAddress:EmailChannelRequest' :: Text
fromAddress = Text
a} :: EmailChannelRequest)
emailChannelRequest_identity :: Lens.Lens' EmailChannelRequest Prelude.Text
emailChannelRequest_identity :: (Text -> f Text) -> EmailChannelRequest -> f EmailChannelRequest
emailChannelRequest_identity = (EmailChannelRequest -> Text)
-> (EmailChannelRequest -> Text -> EmailChannelRequest)
-> Lens EmailChannelRequest EmailChannelRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailChannelRequest' {Text
identity :: Text
$sel:identity:EmailChannelRequest' :: EmailChannelRequest -> Text
identity} -> Text
identity) (\s :: EmailChannelRequest
s@EmailChannelRequest' {} Text
a -> EmailChannelRequest
s {$sel:identity:EmailChannelRequest' :: Text
identity = Text
a} :: EmailChannelRequest)
instance Prelude.Hashable EmailChannelRequest
instance Prelude.NFData EmailChannelRequest
instance Core.ToJSON EmailChannelRequest where
toJSON :: EmailChannelRequest -> Value
toJSON EmailChannelRequest' {Maybe Bool
Maybe Text
Text
identity :: Text
fromAddress :: Text
roleArn :: Maybe Text
configurationSet :: Maybe Text
enabled :: Maybe Bool
$sel:identity:EmailChannelRequest' :: EmailChannelRequest -> Text
$sel:fromAddress:EmailChannelRequest' :: EmailChannelRequest -> Text
$sel:roleArn:EmailChannelRequest' :: EmailChannelRequest -> Maybe Text
$sel:configurationSet:EmailChannelRequest' :: EmailChannelRequest -> Maybe Text
$sel:enabled:EmailChannelRequest' :: EmailChannelRequest -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Enabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enabled,
(Text
"ConfigurationSet" 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
configurationSet,
(Text
"RoleArn" 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
roleArn,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FromAddress" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fromAddress),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Identity" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
identity)
]
)