{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.SESV2.SendEmail
(
SendEmail (..),
newSendEmail,
sendEmail_fromEmailAddress,
sendEmail_destination,
sendEmail_fromEmailAddressIdentityArn,
sendEmail_configurationSetName,
sendEmail_listManagementOptions,
sendEmail_emailTags,
sendEmail_feedbackForwardingEmailAddress,
sendEmail_feedbackForwardingEmailAddressIdentityArn,
sendEmail_replyToAddresses,
sendEmail_content,
SendEmailResponse (..),
newSendEmailResponse,
sendEmailResponse_messageId,
sendEmailResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SESV2.Types
data SendEmail = SendEmail'
{
SendEmail -> Maybe Text
fromEmailAddress :: Prelude.Maybe Prelude.Text,
SendEmail -> Maybe Destination
destination :: Prelude.Maybe Destination,
SendEmail -> Maybe Text
fromEmailAddressIdentityArn :: Prelude.Maybe Prelude.Text,
SendEmail -> Maybe Text
configurationSetName :: Prelude.Maybe Prelude.Text,
SendEmail -> Maybe ListManagementOptions
listManagementOptions :: Prelude.Maybe ListManagementOptions,
SendEmail -> Maybe [MessageTag]
emailTags :: Prelude.Maybe [MessageTag],
SendEmail -> Maybe Text
feedbackForwardingEmailAddress :: Prelude.Maybe Prelude.Text,
SendEmail -> Maybe Text
feedbackForwardingEmailAddressIdentityArn :: Prelude.Maybe Prelude.Text,
SendEmail -> Maybe [Text]
replyToAddresses :: Prelude.Maybe [Prelude.Text],
SendEmail -> EmailContent
content :: EmailContent
}
deriving (SendEmail -> SendEmail -> Bool
(SendEmail -> SendEmail -> Bool)
-> (SendEmail -> SendEmail -> Bool) -> Eq SendEmail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendEmail -> SendEmail -> Bool
$c/= :: SendEmail -> SendEmail -> Bool
== :: SendEmail -> SendEmail -> Bool
$c== :: SendEmail -> SendEmail -> Bool
Prelude.Eq, ReadPrec [SendEmail]
ReadPrec SendEmail
Int -> ReadS SendEmail
ReadS [SendEmail]
(Int -> ReadS SendEmail)
-> ReadS [SendEmail]
-> ReadPrec SendEmail
-> ReadPrec [SendEmail]
-> Read SendEmail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendEmail]
$creadListPrec :: ReadPrec [SendEmail]
readPrec :: ReadPrec SendEmail
$creadPrec :: ReadPrec SendEmail
readList :: ReadS [SendEmail]
$creadList :: ReadS [SendEmail]
readsPrec :: Int -> ReadS SendEmail
$creadsPrec :: Int -> ReadS SendEmail
Prelude.Read, Int -> SendEmail -> ShowS
[SendEmail] -> ShowS
SendEmail -> String
(Int -> SendEmail -> ShowS)
-> (SendEmail -> String)
-> ([SendEmail] -> ShowS)
-> Show SendEmail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendEmail] -> ShowS
$cshowList :: [SendEmail] -> ShowS
show :: SendEmail -> String
$cshow :: SendEmail -> String
showsPrec :: Int -> SendEmail -> ShowS
$cshowsPrec :: Int -> SendEmail -> ShowS
Prelude.Show, (forall x. SendEmail -> Rep SendEmail x)
-> (forall x. Rep SendEmail x -> SendEmail) -> Generic SendEmail
forall x. Rep SendEmail x -> SendEmail
forall x. SendEmail -> Rep SendEmail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendEmail x -> SendEmail
$cfrom :: forall x. SendEmail -> Rep SendEmail x
Prelude.Generic)
newSendEmail ::
EmailContent ->
SendEmail
newSendEmail :: EmailContent -> SendEmail
newSendEmail EmailContent
pContent_ =
SendEmail' :: Maybe Text
-> Maybe Destination
-> Maybe Text
-> Maybe Text
-> Maybe ListManagementOptions
-> Maybe [MessageTag]
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> EmailContent
-> SendEmail
SendEmail'
{ $sel:fromEmailAddress:SendEmail' :: Maybe Text
fromEmailAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:destination:SendEmail' :: Maybe Destination
destination = Maybe Destination
forall a. Maybe a
Prelude.Nothing,
$sel:fromEmailAddressIdentityArn:SendEmail' :: Maybe Text
fromEmailAddressIdentityArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:configurationSetName:SendEmail' :: Maybe Text
configurationSetName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:listManagementOptions:SendEmail' :: Maybe ListManagementOptions
listManagementOptions = Maybe ListManagementOptions
forall a. Maybe a
Prelude.Nothing,
$sel:emailTags:SendEmail' :: Maybe [MessageTag]
emailTags = Maybe [MessageTag]
forall a. Maybe a
Prelude.Nothing,
$sel:feedbackForwardingEmailAddress:SendEmail' :: Maybe Text
feedbackForwardingEmailAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:feedbackForwardingEmailAddressIdentityArn:SendEmail' :: Maybe Text
feedbackForwardingEmailAddressIdentityArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:replyToAddresses:SendEmail' :: Maybe [Text]
replyToAddresses = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:content:SendEmail' :: EmailContent
content = EmailContent
pContent_
}
sendEmail_fromEmailAddress :: Lens.Lens' SendEmail (Prelude.Maybe Prelude.Text)
sendEmail_fromEmailAddress :: (Maybe Text -> f (Maybe Text)) -> SendEmail -> f SendEmail
sendEmail_fromEmailAddress = (SendEmail -> Maybe Text)
-> (SendEmail -> Maybe Text -> SendEmail)
-> Lens SendEmail SendEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEmail' {Maybe Text
fromEmailAddress :: Maybe Text
$sel:fromEmailAddress:SendEmail' :: SendEmail -> Maybe Text
fromEmailAddress} -> Maybe Text
fromEmailAddress) (\s :: SendEmail
s@SendEmail' {} Maybe Text
a -> SendEmail
s {$sel:fromEmailAddress:SendEmail' :: Maybe Text
fromEmailAddress = Maybe Text
a} :: SendEmail)
sendEmail_destination :: Lens.Lens' SendEmail (Prelude.Maybe Destination)
sendEmail_destination :: (Maybe Destination -> f (Maybe Destination))
-> SendEmail -> f SendEmail
sendEmail_destination = (SendEmail -> Maybe Destination)
-> (SendEmail -> Maybe Destination -> SendEmail)
-> Lens SendEmail SendEmail (Maybe Destination) (Maybe Destination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEmail' {Maybe Destination
destination :: Maybe Destination
$sel:destination:SendEmail' :: SendEmail -> Maybe Destination
destination} -> Maybe Destination
destination) (\s :: SendEmail
s@SendEmail' {} Maybe Destination
a -> SendEmail
s {$sel:destination:SendEmail' :: Maybe Destination
destination = Maybe Destination
a} :: SendEmail)
sendEmail_fromEmailAddressIdentityArn :: Lens.Lens' SendEmail (Prelude.Maybe Prelude.Text)
sendEmail_fromEmailAddressIdentityArn :: (Maybe Text -> f (Maybe Text)) -> SendEmail -> f SendEmail
sendEmail_fromEmailAddressIdentityArn = (SendEmail -> Maybe Text)
-> (SendEmail -> Maybe Text -> SendEmail)
-> Lens SendEmail SendEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEmail' {Maybe Text
fromEmailAddressIdentityArn :: Maybe Text
$sel:fromEmailAddressIdentityArn:SendEmail' :: SendEmail -> Maybe Text
fromEmailAddressIdentityArn} -> Maybe Text
fromEmailAddressIdentityArn) (\s :: SendEmail
s@SendEmail' {} Maybe Text
a -> SendEmail
s {$sel:fromEmailAddressIdentityArn:SendEmail' :: Maybe Text
fromEmailAddressIdentityArn = Maybe Text
a} :: SendEmail)
sendEmail_configurationSetName :: Lens.Lens' SendEmail (Prelude.Maybe Prelude.Text)
sendEmail_configurationSetName :: (Maybe Text -> f (Maybe Text)) -> SendEmail -> f SendEmail
sendEmail_configurationSetName = (SendEmail -> Maybe Text)
-> (SendEmail -> Maybe Text -> SendEmail)
-> Lens SendEmail SendEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEmail' {Maybe Text
configurationSetName :: Maybe Text
$sel:configurationSetName:SendEmail' :: SendEmail -> Maybe Text
configurationSetName} -> Maybe Text
configurationSetName) (\s :: SendEmail
s@SendEmail' {} Maybe Text
a -> SendEmail
s {$sel:configurationSetName:SendEmail' :: Maybe Text
configurationSetName = Maybe Text
a} :: SendEmail)
sendEmail_listManagementOptions :: Lens.Lens' SendEmail (Prelude.Maybe ListManagementOptions)
sendEmail_listManagementOptions :: (Maybe ListManagementOptions -> f (Maybe ListManagementOptions))
-> SendEmail -> f SendEmail
sendEmail_listManagementOptions = (SendEmail -> Maybe ListManagementOptions)
-> (SendEmail -> Maybe ListManagementOptions -> SendEmail)
-> Lens
SendEmail
SendEmail
(Maybe ListManagementOptions)
(Maybe ListManagementOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEmail' {Maybe ListManagementOptions
listManagementOptions :: Maybe ListManagementOptions
$sel:listManagementOptions:SendEmail' :: SendEmail -> Maybe ListManagementOptions
listManagementOptions} -> Maybe ListManagementOptions
listManagementOptions) (\s :: SendEmail
s@SendEmail' {} Maybe ListManagementOptions
a -> SendEmail
s {$sel:listManagementOptions:SendEmail' :: Maybe ListManagementOptions
listManagementOptions = Maybe ListManagementOptions
a} :: SendEmail)
sendEmail_emailTags :: Lens.Lens' SendEmail (Prelude.Maybe [MessageTag])
sendEmail_emailTags :: (Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> SendEmail -> f SendEmail
sendEmail_emailTags = (SendEmail -> Maybe [MessageTag])
-> (SendEmail -> Maybe [MessageTag] -> SendEmail)
-> Lens
SendEmail SendEmail (Maybe [MessageTag]) (Maybe [MessageTag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEmail' {Maybe [MessageTag]
emailTags :: Maybe [MessageTag]
$sel:emailTags:SendEmail' :: SendEmail -> Maybe [MessageTag]
emailTags} -> Maybe [MessageTag]
emailTags) (\s :: SendEmail
s@SendEmail' {} Maybe [MessageTag]
a -> SendEmail
s {$sel:emailTags:SendEmail' :: Maybe [MessageTag]
emailTags = Maybe [MessageTag]
a} :: SendEmail) ((Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> SendEmail -> f SendEmail)
-> ((Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> (Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> SendEmail
-> f SendEmail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [MessageTag] [MessageTag] [MessageTag] [MessageTag]
-> Iso
(Maybe [MessageTag])
(Maybe [MessageTag])
(Maybe [MessageTag])
(Maybe [MessageTag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [MessageTag] [MessageTag] [MessageTag] [MessageTag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
sendEmail_feedbackForwardingEmailAddress :: Lens.Lens' SendEmail (Prelude.Maybe Prelude.Text)
sendEmail_feedbackForwardingEmailAddress :: (Maybe Text -> f (Maybe Text)) -> SendEmail -> f SendEmail
sendEmail_feedbackForwardingEmailAddress = (SendEmail -> Maybe Text)
-> (SendEmail -> Maybe Text -> SendEmail)
-> Lens SendEmail SendEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEmail' {Maybe Text
feedbackForwardingEmailAddress :: Maybe Text
$sel:feedbackForwardingEmailAddress:SendEmail' :: SendEmail -> Maybe Text
feedbackForwardingEmailAddress} -> Maybe Text
feedbackForwardingEmailAddress) (\s :: SendEmail
s@SendEmail' {} Maybe Text
a -> SendEmail
s {$sel:feedbackForwardingEmailAddress:SendEmail' :: Maybe Text
feedbackForwardingEmailAddress = Maybe Text
a} :: SendEmail)
sendEmail_feedbackForwardingEmailAddressIdentityArn :: Lens.Lens' SendEmail (Prelude.Maybe Prelude.Text)
sendEmail_feedbackForwardingEmailAddressIdentityArn :: (Maybe Text -> f (Maybe Text)) -> SendEmail -> f SendEmail
sendEmail_feedbackForwardingEmailAddressIdentityArn = (SendEmail -> Maybe Text)
-> (SendEmail -> Maybe Text -> SendEmail)
-> Lens SendEmail SendEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEmail' {Maybe Text
feedbackForwardingEmailAddressIdentityArn :: Maybe Text
$sel:feedbackForwardingEmailAddressIdentityArn:SendEmail' :: SendEmail -> Maybe Text
feedbackForwardingEmailAddressIdentityArn} -> Maybe Text
feedbackForwardingEmailAddressIdentityArn) (\s :: SendEmail
s@SendEmail' {} Maybe Text
a -> SendEmail
s {$sel:feedbackForwardingEmailAddressIdentityArn:SendEmail' :: Maybe Text
feedbackForwardingEmailAddressIdentityArn = Maybe Text
a} :: SendEmail)
sendEmail_replyToAddresses :: Lens.Lens' SendEmail (Prelude.Maybe [Prelude.Text])
sendEmail_replyToAddresses :: (Maybe [Text] -> f (Maybe [Text])) -> SendEmail -> f SendEmail
sendEmail_replyToAddresses = (SendEmail -> Maybe [Text])
-> (SendEmail -> Maybe [Text] -> SendEmail)
-> Lens SendEmail SendEmail (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEmail' {Maybe [Text]
replyToAddresses :: Maybe [Text]
$sel:replyToAddresses:SendEmail' :: SendEmail -> Maybe [Text]
replyToAddresses} -> Maybe [Text]
replyToAddresses) (\s :: SendEmail
s@SendEmail' {} Maybe [Text]
a -> SendEmail
s {$sel:replyToAddresses:SendEmail' :: Maybe [Text]
replyToAddresses = Maybe [Text]
a} :: SendEmail) ((Maybe [Text] -> f (Maybe [Text])) -> SendEmail -> f SendEmail)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SendEmail
-> f SendEmail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
sendEmail_content :: Lens.Lens' SendEmail EmailContent
sendEmail_content :: (EmailContent -> f EmailContent) -> SendEmail -> f SendEmail
sendEmail_content = (SendEmail -> EmailContent)
-> (SendEmail -> EmailContent -> SendEmail)
-> Lens SendEmail SendEmail EmailContent EmailContent
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEmail' {EmailContent
content :: EmailContent
$sel:content:SendEmail' :: SendEmail -> EmailContent
content} -> EmailContent
content) (\s :: SendEmail
s@SendEmail' {} EmailContent
a -> SendEmail
s {$sel:content:SendEmail' :: EmailContent
content = EmailContent
a} :: SendEmail)
instance Core.AWSRequest SendEmail where
type AWSResponse SendEmail = SendEmailResponse
request :: SendEmail -> Request SendEmail
request = Service -> SendEmail -> Request SendEmail
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SendEmail
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendEmail)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse SendEmail))
-> Logger
-> Service
-> Proxy SendEmail
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendEmail)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> SendEmailResponse
SendEmailResponse'
(Maybe Text -> Int -> SendEmailResponse)
-> Either String (Maybe Text)
-> Either String (Int -> SendEmailResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"MessageId")
Either String (Int -> SendEmailResponse)
-> Either String Int -> Either String SendEmailResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable SendEmail
instance Prelude.NFData SendEmail
instance Core.ToHeaders SendEmail where
toHeaders :: SendEmail -> ResponseHeaders
toHeaders =
ResponseHeaders -> SendEmail -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON SendEmail where
toJSON :: SendEmail -> Value
toJSON SendEmail' {Maybe [Text]
Maybe [MessageTag]
Maybe Text
Maybe Destination
Maybe ListManagementOptions
EmailContent
content :: EmailContent
replyToAddresses :: Maybe [Text]
feedbackForwardingEmailAddressIdentityArn :: Maybe Text
feedbackForwardingEmailAddress :: Maybe Text
emailTags :: Maybe [MessageTag]
listManagementOptions :: Maybe ListManagementOptions
configurationSetName :: Maybe Text
fromEmailAddressIdentityArn :: Maybe Text
destination :: Maybe Destination
fromEmailAddress :: Maybe Text
$sel:content:SendEmail' :: SendEmail -> EmailContent
$sel:replyToAddresses:SendEmail' :: SendEmail -> Maybe [Text]
$sel:feedbackForwardingEmailAddressIdentityArn:SendEmail' :: SendEmail -> Maybe Text
$sel:feedbackForwardingEmailAddress:SendEmail' :: SendEmail -> Maybe Text
$sel:emailTags:SendEmail' :: SendEmail -> Maybe [MessageTag]
$sel:listManagementOptions:SendEmail' :: SendEmail -> Maybe ListManagementOptions
$sel:configurationSetName:SendEmail' :: SendEmail -> Maybe Text
$sel:fromEmailAddressIdentityArn:SendEmail' :: SendEmail -> Maybe Text
$sel:destination:SendEmail' :: SendEmail -> Maybe Destination
$sel:fromEmailAddress:SendEmail' :: SendEmail -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"FromEmailAddress" 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
fromEmailAddress,
(Text
"Destination" Text -> Destination -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Destination -> Pair) -> Maybe Destination -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Destination
destination,
(Text
"FromEmailAddressIdentityArn" 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
fromEmailAddressIdentityArn,
(Text
"ConfigurationSetName" 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
configurationSetName,
(Text
"ListManagementOptions" Text -> ListManagementOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ListManagementOptions -> Pair)
-> Maybe ListManagementOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ListManagementOptions
listManagementOptions,
(Text
"EmailTags" Text -> [MessageTag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([MessageTag] -> Pair) -> Maybe [MessageTag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MessageTag]
emailTags,
(Text
"FeedbackForwardingEmailAddress" 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
feedbackForwardingEmailAddress,
(Text
"FeedbackForwardingEmailAddressIdentityArn" 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
feedbackForwardingEmailAddressIdentityArn,
(Text
"ReplyToAddresses" 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]
replyToAddresses,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Content" Text -> EmailContent -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= EmailContent
content)
]
)
instance Core.ToPath SendEmail where
toPath :: SendEmail -> ByteString
toPath = ByteString -> SendEmail -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v2/email/outbound-emails"
instance Core.ToQuery SendEmail where
toQuery :: SendEmail -> QueryString
toQuery = QueryString -> SendEmail -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SendEmailResponse = SendEmailResponse'
{
SendEmailResponse -> Maybe Text
messageId :: Prelude.Maybe Prelude.Text,
SendEmailResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SendEmailResponse -> SendEmailResponse -> Bool
(SendEmailResponse -> SendEmailResponse -> Bool)
-> (SendEmailResponse -> SendEmailResponse -> Bool)
-> Eq SendEmailResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendEmailResponse -> SendEmailResponse -> Bool
$c/= :: SendEmailResponse -> SendEmailResponse -> Bool
== :: SendEmailResponse -> SendEmailResponse -> Bool
$c== :: SendEmailResponse -> SendEmailResponse -> Bool
Prelude.Eq, ReadPrec [SendEmailResponse]
ReadPrec SendEmailResponse
Int -> ReadS SendEmailResponse
ReadS [SendEmailResponse]
(Int -> ReadS SendEmailResponse)
-> ReadS [SendEmailResponse]
-> ReadPrec SendEmailResponse
-> ReadPrec [SendEmailResponse]
-> Read SendEmailResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendEmailResponse]
$creadListPrec :: ReadPrec [SendEmailResponse]
readPrec :: ReadPrec SendEmailResponse
$creadPrec :: ReadPrec SendEmailResponse
readList :: ReadS [SendEmailResponse]
$creadList :: ReadS [SendEmailResponse]
readsPrec :: Int -> ReadS SendEmailResponse
$creadsPrec :: Int -> ReadS SendEmailResponse
Prelude.Read, Int -> SendEmailResponse -> ShowS
[SendEmailResponse] -> ShowS
SendEmailResponse -> String
(Int -> SendEmailResponse -> ShowS)
-> (SendEmailResponse -> String)
-> ([SendEmailResponse] -> ShowS)
-> Show SendEmailResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendEmailResponse] -> ShowS
$cshowList :: [SendEmailResponse] -> ShowS
show :: SendEmailResponse -> String
$cshow :: SendEmailResponse -> String
showsPrec :: Int -> SendEmailResponse -> ShowS
$cshowsPrec :: Int -> SendEmailResponse -> ShowS
Prelude.Show, (forall x. SendEmailResponse -> Rep SendEmailResponse x)
-> (forall x. Rep SendEmailResponse x -> SendEmailResponse)
-> Generic SendEmailResponse
forall x. Rep SendEmailResponse x -> SendEmailResponse
forall x. SendEmailResponse -> Rep SendEmailResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendEmailResponse x -> SendEmailResponse
$cfrom :: forall x. SendEmailResponse -> Rep SendEmailResponse x
Prelude.Generic)
newSendEmailResponse ::
Prelude.Int ->
SendEmailResponse
newSendEmailResponse :: Int -> SendEmailResponse
newSendEmailResponse Int
pHttpStatus_ =
SendEmailResponse' :: Maybe Text -> Int -> SendEmailResponse
SendEmailResponse'
{ $sel:messageId:SendEmailResponse' :: Maybe Text
messageId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SendEmailResponse' :: Int
httpStatus = Int
pHttpStatus_
}
sendEmailResponse_messageId :: Lens.Lens' SendEmailResponse (Prelude.Maybe Prelude.Text)
sendEmailResponse_messageId :: (Maybe Text -> f (Maybe Text))
-> SendEmailResponse -> f SendEmailResponse
sendEmailResponse_messageId = (SendEmailResponse -> Maybe Text)
-> (SendEmailResponse -> Maybe Text -> SendEmailResponse)
-> Lens
SendEmailResponse SendEmailResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEmailResponse' {Maybe Text
messageId :: Maybe Text
$sel:messageId:SendEmailResponse' :: SendEmailResponse -> Maybe Text
messageId} -> Maybe Text
messageId) (\s :: SendEmailResponse
s@SendEmailResponse' {} Maybe Text
a -> SendEmailResponse
s {$sel:messageId:SendEmailResponse' :: Maybe Text
messageId = Maybe Text
a} :: SendEmailResponse)
sendEmailResponse_httpStatus :: Lens.Lens' SendEmailResponse Prelude.Int
sendEmailResponse_httpStatus :: (Int -> f Int) -> SendEmailResponse -> f SendEmailResponse
sendEmailResponse_httpStatus = (SendEmailResponse -> Int)
-> (SendEmailResponse -> Int -> SendEmailResponse)
-> Lens SendEmailResponse SendEmailResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEmailResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendEmailResponse' :: SendEmailResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendEmailResponse
s@SendEmailResponse' {} Int
a -> SendEmailResponse
s {$sel:httpStatus:SendEmailResponse' :: Int
httpStatus = Int
a} :: SendEmailResponse)
instance Prelude.NFData SendEmailResponse