{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SES.SendTemplatedEmail
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Composes an email message using an email template and immediately queues
-- it for sending.
--
-- In order to send email using the @SendTemplatedEmail@ operation, your
-- call to the API must meet the following requirements:
--
-- -   The call must refer to an existing email template. You can create
--     email templates using the CreateTemplate operation.
--
-- -   The message must be sent from a verified email address or domain.
--
-- -   If your account is still in the Amazon SES sandbox, you may only
--     send to verified addresses or domains, or to email addresses
--     associated with the Amazon SES Mailbox Simulator. For more
--     information, see
--     <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html Verifying Email Addresses and Domains>
--     in the /Amazon SES Developer Guide./
--
-- -   The maximum message size is 10 MB.
--
-- -   Calls to the @SendTemplatedEmail@ operation may only include one
--     @Destination@ parameter. A destination is a set of recipients who
--     will receive the same version of the email. The @Destination@
--     parameter can include up to 50 recipients, across the To:, CC: and
--     BCC: fields.
--
-- -   The @Destination@ parameter must include at least one recipient
--     email address. The recipient address can be a To: address, a CC:
--     address, or a BCC: address. If a recipient email address is invalid
--     (that is, it is not in the format
--     /UserName\@[SubDomain.]Domain.TopLevelDomain/), the entire message
--     will be rejected, even if the message contains other recipients that
--     are valid.
--
-- If your call to the @SendTemplatedEmail@ operation includes all of the
-- required parameters, Amazon SES accepts it and returns a Message ID.
-- However, if Amazon SES can\'t render the email because the template
-- contains errors, it doesn\'t send the email. Additionally, because it
-- already accepted the message, Amazon SES doesn\'t return a message
-- stating that it was unable to send the email.
--
-- For these reasons, we highly recommend that you set up Amazon SES to
-- send you notifications when Rendering Failure events occur. For more
-- information, see
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-personalized-email-api.html Sending Personalized Email Using the Amazon SES API>
-- in the /Amazon Simple Email Service Developer Guide/.
module Amazonka.SES.SendTemplatedEmail
  ( -- * Creating a Request
    SendTemplatedEmail (..),
    newSendTemplatedEmail,

    -- * Request Lenses
    sendTemplatedEmail_configurationSetName,
    sendTemplatedEmail_replyToAddresses,
    sendTemplatedEmail_returnPath,
    sendTemplatedEmail_returnPathArn,
    sendTemplatedEmail_sourceArn,
    sendTemplatedEmail_tags,
    sendTemplatedEmail_templateArn,
    sendTemplatedEmail_source,
    sendTemplatedEmail_destination,
    sendTemplatedEmail_template,
    sendTemplatedEmail_templateData,

    -- * Destructuring the Response
    SendTemplatedEmailResponse (..),
    newSendTemplatedEmailResponse,

    -- * Response Lenses
    sendTemplatedEmailResponse_httpStatus,
    sendTemplatedEmailResponse_messageId,
  )
where

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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SES.Types

-- | Represents a request to send a templated email using Amazon SES. For
-- more information, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-personalized-email-api.html Amazon SES Developer Guide>.
--
-- /See:/ 'newSendTemplatedEmail' smart constructor.
data SendTemplatedEmail = SendTemplatedEmail'
  { -- | The name of the configuration set to use when you send an email using
    -- @SendTemplatedEmail@.
    SendTemplatedEmail -> Maybe Text
configurationSetName :: Prelude.Maybe Prelude.Text,
    -- | The reply-to email address(es) for the message. If the recipient replies
    -- to the message, each reply-to address will receive the reply.
    SendTemplatedEmail -> Maybe [Text]
replyToAddresses :: Prelude.Maybe [Prelude.Text],
    -- | The email address that bounces and complaints will be forwarded to when
    -- feedback forwarding is enabled. If the message cannot be delivered to
    -- the recipient, then an error message will be returned from the
    -- recipient\'s ISP; this message will then be forwarded to the email
    -- address specified by the @ReturnPath@ parameter. The @ReturnPath@
    -- parameter is never overwritten. This email address must be either
    -- individually verified with Amazon SES, or from a domain that has been
    -- verified with Amazon SES.
    SendTemplatedEmail -> Maybe Text
returnPath :: Prelude.Maybe Prelude.Text,
    -- | This parameter is used only for sending authorization. It is the ARN of
    -- the identity that is associated with the sending authorization policy
    -- that permits you to use the email address specified in the @ReturnPath@
    -- parameter.
    --
    -- For example, if the owner of @example.com@ (which has ARN
    -- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@) attaches a
    -- policy to it that authorizes you to use @feedback\@example.com@, then
    -- you would specify the @ReturnPathArn@ to be
    -- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@, and the
    -- @ReturnPath@ to be @feedback\@example.com@.
    --
    -- For more information about sending authorization, see the
    -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
    SendTemplatedEmail -> Maybe Text
returnPathArn :: Prelude.Maybe Prelude.Text,
    -- | This parameter is used only for sending authorization. It is the ARN of
    -- the identity that is associated with the sending authorization policy
    -- that permits you to send for the email address specified in the @Source@
    -- parameter.
    --
    -- For example, if the owner of @example.com@ (which has ARN
    -- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@) attaches a
    -- policy to it that authorizes you to send from @user\@example.com@, then
    -- you would specify the @SourceArn@ to be
    -- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@, and the
    -- @Source@ to be @user\@example.com@.
    --
    -- For more information about sending authorization, see the
    -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
    SendTemplatedEmail -> Maybe Text
sourceArn :: Prelude.Maybe Prelude.Text,
    -- | A list of tags, in the form of name\/value pairs, to apply to an email
    -- that you send using @SendTemplatedEmail@. Tags correspond to
    -- characteristics of the email that you define, so that you can publish
    -- email sending events.
    SendTemplatedEmail -> Maybe [MessageTag]
tags :: Prelude.Maybe [MessageTag],
    -- | The ARN of the template to use when sending this email.
    SendTemplatedEmail -> Maybe Text
templateArn :: Prelude.Maybe Prelude.Text,
    -- | The email address that is sending the email. This email address must be
    -- either individually verified with Amazon SES, or from a domain that has
    -- been verified with Amazon SES. For information about verifying
    -- identities, see the
    -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html Amazon SES Developer Guide>.
    --
    -- If you are sending on behalf of another user and have been permitted to
    -- do so by a sending authorization policy, then you must also specify the
    -- @SourceArn@ parameter. For more information about sending authorization,
    -- see the
    -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
    --
    -- Amazon SES does not support the SMTPUTF8 extension, as described in
    -- <https://tools.ietf.org/html/rfc6531 RFC6531>. For this reason, the
    -- /local part/ of a source email address (the part of the email address
    -- that precedes the \@ sign) may only contain
    -- <https://en.wikipedia.org/wiki/Email_address#Local-part 7-bit ASCII characters>.
    -- If the /domain part/ of an address (the part after the \@ sign) contains
    -- non-ASCII characters, they must be encoded using Punycode, as described
    -- in <https://tools.ietf.org/html/rfc3492.html RFC3492>. The sender name
    -- (also known as the /friendly name/) may contain non-ASCII characters.
    -- These characters must be encoded using MIME encoded-word syntax, as
    -- described in<https://tools.ietf.org/html/rfc2047 RFC 2047>. MIME
    -- encoded-word syntax uses the following form:
    -- @=?charset?encoding?encoded-text?=@.
    SendTemplatedEmail -> Text
source :: Prelude.Text,
    -- | The destination for this email, composed of To:, CC:, and BCC: fields. A
    -- Destination can include up to 50 recipients across these three fields.
    SendTemplatedEmail -> Destination
destination :: Destination,
    -- | The template to use when sending this email.
    SendTemplatedEmail -> Text
template :: Prelude.Text,
    -- | A list of replacement values to apply to the template. This parameter is
    -- a JSON object, typically consisting of key-value pairs in which the keys
    -- correspond to replacement tags in the email template.
    SendTemplatedEmail -> Text
templateData :: Prelude.Text
  }
  deriving (SendTemplatedEmail -> SendTemplatedEmail -> Bool
(SendTemplatedEmail -> SendTemplatedEmail -> Bool)
-> (SendTemplatedEmail -> SendTemplatedEmail -> Bool)
-> Eq SendTemplatedEmail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SendTemplatedEmail -> SendTemplatedEmail -> Bool
== :: SendTemplatedEmail -> SendTemplatedEmail -> Bool
$c/= :: SendTemplatedEmail -> SendTemplatedEmail -> Bool
/= :: SendTemplatedEmail -> SendTemplatedEmail -> Bool
Prelude.Eq, ReadPrec [SendTemplatedEmail]
ReadPrec SendTemplatedEmail
Int -> ReadS SendTemplatedEmail
ReadS [SendTemplatedEmail]
(Int -> ReadS SendTemplatedEmail)
-> ReadS [SendTemplatedEmail]
-> ReadPrec SendTemplatedEmail
-> ReadPrec [SendTemplatedEmail]
-> Read SendTemplatedEmail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS SendTemplatedEmail
readsPrec :: Int -> ReadS SendTemplatedEmail
$creadList :: ReadS [SendTemplatedEmail]
readList :: ReadS [SendTemplatedEmail]
$creadPrec :: ReadPrec SendTemplatedEmail
readPrec :: ReadPrec SendTemplatedEmail
$creadListPrec :: ReadPrec [SendTemplatedEmail]
readListPrec :: ReadPrec [SendTemplatedEmail]
Prelude.Read, Int -> SendTemplatedEmail -> ShowS
[SendTemplatedEmail] -> ShowS
SendTemplatedEmail -> String
(Int -> SendTemplatedEmail -> ShowS)
-> (SendTemplatedEmail -> String)
-> ([SendTemplatedEmail] -> ShowS)
-> Show SendTemplatedEmail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SendTemplatedEmail -> ShowS
showsPrec :: Int -> SendTemplatedEmail -> ShowS
$cshow :: SendTemplatedEmail -> String
show :: SendTemplatedEmail -> String
$cshowList :: [SendTemplatedEmail] -> ShowS
showList :: [SendTemplatedEmail] -> ShowS
Prelude.Show, (forall x. SendTemplatedEmail -> Rep SendTemplatedEmail x)
-> (forall x. Rep SendTemplatedEmail x -> SendTemplatedEmail)
-> Generic SendTemplatedEmail
forall x. Rep SendTemplatedEmail x -> SendTemplatedEmail
forall x. SendTemplatedEmail -> Rep SendTemplatedEmail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SendTemplatedEmail -> Rep SendTemplatedEmail x
from :: forall x. SendTemplatedEmail -> Rep SendTemplatedEmail x
$cto :: forall x. Rep SendTemplatedEmail x -> SendTemplatedEmail
to :: forall x. Rep SendTemplatedEmail x -> SendTemplatedEmail
Prelude.Generic)

-- |
-- Create a value of 'SendTemplatedEmail' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'configurationSetName', 'sendTemplatedEmail_configurationSetName' - The name of the configuration set to use when you send an email using
-- @SendTemplatedEmail@.
--
-- 'replyToAddresses', 'sendTemplatedEmail_replyToAddresses' - The reply-to email address(es) for the message. If the recipient replies
-- to the message, each reply-to address will receive the reply.
--
-- 'returnPath', 'sendTemplatedEmail_returnPath' - The email address that bounces and complaints will be forwarded to when
-- feedback forwarding is enabled. If the message cannot be delivered to
-- the recipient, then an error message will be returned from the
-- recipient\'s ISP; this message will then be forwarded to the email
-- address specified by the @ReturnPath@ parameter. The @ReturnPath@
-- parameter is never overwritten. This email address must be either
-- individually verified with Amazon SES, or from a domain that has been
-- verified with Amazon SES.
--
-- 'returnPathArn', 'sendTemplatedEmail_returnPathArn' - This parameter is used only for sending authorization. It is the ARN of
-- the identity that is associated with the sending authorization policy
-- that permits you to use the email address specified in the @ReturnPath@
-- parameter.
--
-- For example, if the owner of @example.com@ (which has ARN
-- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@) attaches a
-- policy to it that authorizes you to use @feedback\@example.com@, then
-- you would specify the @ReturnPathArn@ to be
-- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@, and the
-- @ReturnPath@ to be @feedback\@example.com@.
--
-- For more information about sending authorization, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
--
-- 'sourceArn', 'sendTemplatedEmail_sourceArn' - This parameter is used only for sending authorization. It is the ARN of
-- the identity that is associated with the sending authorization policy
-- that permits you to send for the email address specified in the @Source@
-- parameter.
--
-- For example, if the owner of @example.com@ (which has ARN
-- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@) attaches a
-- policy to it that authorizes you to send from @user\@example.com@, then
-- you would specify the @SourceArn@ to be
-- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@, and the
-- @Source@ to be @user\@example.com@.
--
-- For more information about sending authorization, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
--
-- 'tags', 'sendTemplatedEmail_tags' - A list of tags, in the form of name\/value pairs, to apply to an email
-- that you send using @SendTemplatedEmail@. Tags correspond to
-- characteristics of the email that you define, so that you can publish
-- email sending events.
--
-- 'templateArn', 'sendTemplatedEmail_templateArn' - The ARN of the template to use when sending this email.
--
-- 'source', 'sendTemplatedEmail_source' - The email address that is sending the email. This email address must be
-- either individually verified with Amazon SES, or from a domain that has
-- been verified with Amazon SES. For information about verifying
-- identities, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html Amazon SES Developer Guide>.
--
-- If you are sending on behalf of another user and have been permitted to
-- do so by a sending authorization policy, then you must also specify the
-- @SourceArn@ parameter. For more information about sending authorization,
-- see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
--
-- Amazon SES does not support the SMTPUTF8 extension, as described in
-- <https://tools.ietf.org/html/rfc6531 RFC6531>. For this reason, the
-- /local part/ of a source email address (the part of the email address
-- that precedes the \@ sign) may only contain
-- <https://en.wikipedia.org/wiki/Email_address#Local-part 7-bit ASCII characters>.
-- If the /domain part/ of an address (the part after the \@ sign) contains
-- non-ASCII characters, they must be encoded using Punycode, as described
-- in <https://tools.ietf.org/html/rfc3492.html RFC3492>. The sender name
-- (also known as the /friendly name/) may contain non-ASCII characters.
-- These characters must be encoded using MIME encoded-word syntax, as
-- described in<https://tools.ietf.org/html/rfc2047 RFC 2047>. MIME
-- encoded-word syntax uses the following form:
-- @=?charset?encoding?encoded-text?=@.
--
-- 'destination', 'sendTemplatedEmail_destination' - The destination for this email, composed of To:, CC:, and BCC: fields. A
-- Destination can include up to 50 recipients across these three fields.
--
-- 'template', 'sendTemplatedEmail_template' - The template to use when sending this email.
--
-- 'templateData', 'sendTemplatedEmail_templateData' - A list of replacement values to apply to the template. This parameter is
-- a JSON object, typically consisting of key-value pairs in which the keys
-- correspond to replacement tags in the email template.
newSendTemplatedEmail ::
  -- | 'source'
  Prelude.Text ->
  -- | 'destination'
  Destination ->
  -- | 'template'
  Prelude.Text ->
  -- | 'templateData'
  Prelude.Text ->
  SendTemplatedEmail
newSendTemplatedEmail :: Text -> Destination -> Text -> Text -> SendTemplatedEmail
newSendTemplatedEmail
  Text
pSource_
  Destination
pDestination_
  Text
pTemplate_
  Text
pTemplateData_ =
    SendTemplatedEmail'
      { $sel:configurationSetName:SendTemplatedEmail' :: Maybe Text
configurationSetName =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:replyToAddresses:SendTemplatedEmail' :: Maybe [Text]
replyToAddresses = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:returnPath:SendTemplatedEmail' :: Maybe Text
returnPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:returnPathArn:SendTemplatedEmail' :: Maybe Text
returnPathArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:sourceArn:SendTemplatedEmail' :: Maybe Text
sourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:SendTemplatedEmail' :: Maybe [MessageTag]
tags = Maybe [MessageTag]
forall a. Maybe a
Prelude.Nothing,
        $sel:templateArn:SendTemplatedEmail' :: Maybe Text
templateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:source:SendTemplatedEmail' :: Text
source = Text
pSource_,
        $sel:destination:SendTemplatedEmail' :: Destination
destination = Destination
pDestination_,
        $sel:template:SendTemplatedEmail' :: Text
template = Text
pTemplate_,
        $sel:templateData:SendTemplatedEmail' :: Text
templateData = Text
pTemplateData_
      }

-- | The name of the configuration set to use when you send an email using
-- @SendTemplatedEmail@.
sendTemplatedEmail_configurationSetName :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe Prelude.Text)
sendTemplatedEmail_configurationSetName :: Lens' SendTemplatedEmail (Maybe Text)
sendTemplatedEmail_configurationSetName = (SendTemplatedEmail -> Maybe Text)
-> (SendTemplatedEmail -> Maybe Text -> SendTemplatedEmail)
-> Lens' SendTemplatedEmail (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
$sel:configurationSetName:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
configurationSetName :: Maybe Text
configurationSetName} -> Maybe Text
configurationSetName) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {configurationSetName = a} :: SendTemplatedEmail)

-- | The reply-to email address(es) for the message. If the recipient replies
-- to the message, each reply-to address will receive the reply.
sendTemplatedEmail_replyToAddresses :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe [Prelude.Text])
sendTemplatedEmail_replyToAddresses :: Lens' SendTemplatedEmail (Maybe [Text])
sendTemplatedEmail_replyToAddresses = (SendTemplatedEmail -> Maybe [Text])
-> (SendTemplatedEmail -> Maybe [Text] -> SendTemplatedEmail)
-> Lens' SendTemplatedEmail (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe [Text]
$sel:replyToAddresses:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [Text]
replyToAddresses :: Maybe [Text]
replyToAddresses} -> Maybe [Text]
replyToAddresses) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe [Text]
a -> SendTemplatedEmail
s {replyToAddresses = a} :: SendTemplatedEmail) ((Maybe [Text] -> f (Maybe [Text]))
 -> SendTemplatedEmail -> f SendTemplatedEmail)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SendTemplatedEmail
-> f SendTemplatedEmail
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
Iso [Text] [Text] [Text] [Text]
Lens.coerced

-- | The email address that bounces and complaints will be forwarded to when
-- feedback forwarding is enabled. If the message cannot be delivered to
-- the recipient, then an error message will be returned from the
-- recipient\'s ISP; this message will then be forwarded to the email
-- address specified by the @ReturnPath@ parameter. The @ReturnPath@
-- parameter is never overwritten. This email address must be either
-- individually verified with Amazon SES, or from a domain that has been
-- verified with Amazon SES.
sendTemplatedEmail_returnPath :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe Prelude.Text)
sendTemplatedEmail_returnPath :: Lens' SendTemplatedEmail (Maybe Text)
sendTemplatedEmail_returnPath = (SendTemplatedEmail -> Maybe Text)
-> (SendTemplatedEmail -> Maybe Text -> SendTemplatedEmail)
-> Lens' SendTemplatedEmail (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
$sel:returnPath:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
returnPath :: Maybe Text
returnPath} -> Maybe Text
returnPath) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {returnPath = a} :: SendTemplatedEmail)

-- | This parameter is used only for sending authorization. It is the ARN of
-- the identity that is associated with the sending authorization policy
-- that permits you to use the email address specified in the @ReturnPath@
-- parameter.
--
-- For example, if the owner of @example.com@ (which has ARN
-- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@) attaches a
-- policy to it that authorizes you to use @feedback\@example.com@, then
-- you would specify the @ReturnPathArn@ to be
-- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@, and the
-- @ReturnPath@ to be @feedback\@example.com@.
--
-- For more information about sending authorization, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
sendTemplatedEmail_returnPathArn :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe Prelude.Text)
sendTemplatedEmail_returnPathArn :: Lens' SendTemplatedEmail (Maybe Text)
sendTemplatedEmail_returnPathArn = (SendTemplatedEmail -> Maybe Text)
-> (SendTemplatedEmail -> Maybe Text -> SendTemplatedEmail)
-> Lens' SendTemplatedEmail (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
$sel:returnPathArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
returnPathArn :: Maybe Text
returnPathArn} -> Maybe Text
returnPathArn) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {returnPathArn = a} :: SendTemplatedEmail)

-- | This parameter is used only for sending authorization. It is the ARN of
-- the identity that is associated with the sending authorization policy
-- that permits you to send for the email address specified in the @Source@
-- parameter.
--
-- For example, if the owner of @example.com@ (which has ARN
-- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@) attaches a
-- policy to it that authorizes you to send from @user\@example.com@, then
-- you would specify the @SourceArn@ to be
-- @arn:aws:ses:us-east-1:123456789012:identity\/example.com@, and the
-- @Source@ to be @user\@example.com@.
--
-- For more information about sending authorization, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
sendTemplatedEmail_sourceArn :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe Prelude.Text)
sendTemplatedEmail_sourceArn :: Lens' SendTemplatedEmail (Maybe Text)
sendTemplatedEmail_sourceArn = (SendTemplatedEmail -> Maybe Text)
-> (SendTemplatedEmail -> Maybe Text -> SendTemplatedEmail)
-> Lens' SendTemplatedEmail (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
$sel:sourceArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
sourceArn :: Maybe Text
sourceArn} -> Maybe Text
sourceArn) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {sourceArn = a} :: SendTemplatedEmail)

-- | A list of tags, in the form of name\/value pairs, to apply to an email
-- that you send using @SendTemplatedEmail@. Tags correspond to
-- characteristics of the email that you define, so that you can publish
-- email sending events.
sendTemplatedEmail_tags :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe [MessageTag])
sendTemplatedEmail_tags :: Lens' SendTemplatedEmail (Maybe [MessageTag])
sendTemplatedEmail_tags = (SendTemplatedEmail -> Maybe [MessageTag])
-> (SendTemplatedEmail -> Maybe [MessageTag] -> SendTemplatedEmail)
-> Lens' SendTemplatedEmail (Maybe [MessageTag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe [MessageTag]
$sel:tags:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [MessageTag]
tags :: Maybe [MessageTag]
tags} -> Maybe [MessageTag]
tags) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe [MessageTag]
a -> SendTemplatedEmail
s {tags = a} :: SendTemplatedEmail) ((Maybe [MessageTag] -> f (Maybe [MessageTag]))
 -> SendTemplatedEmail -> f SendTemplatedEmail)
-> ((Maybe [MessageTag] -> f (Maybe [MessageTag]))
    -> Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> (Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> SendTemplatedEmail
-> f SendTemplatedEmail
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
Iso [MessageTag] [MessageTag] [MessageTag] [MessageTag]
Lens.coerced

-- | The ARN of the template to use when sending this email.
sendTemplatedEmail_templateArn :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe Prelude.Text)
sendTemplatedEmail_templateArn :: Lens' SendTemplatedEmail (Maybe Text)
sendTemplatedEmail_templateArn = (SendTemplatedEmail -> Maybe Text)
-> (SendTemplatedEmail -> Maybe Text -> SendTemplatedEmail)
-> Lens' SendTemplatedEmail (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
$sel:templateArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
templateArn :: Maybe Text
templateArn} -> Maybe Text
templateArn) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {templateArn = a} :: SendTemplatedEmail)

-- | The email address that is sending the email. This email address must be
-- either individually verified with Amazon SES, or from a domain that has
-- been verified with Amazon SES. For information about verifying
-- identities, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html Amazon SES Developer Guide>.
--
-- If you are sending on behalf of another user and have been permitted to
-- do so by a sending authorization policy, then you must also specify the
-- @SourceArn@ parameter. For more information about sending authorization,
-- see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
--
-- Amazon SES does not support the SMTPUTF8 extension, as described in
-- <https://tools.ietf.org/html/rfc6531 RFC6531>. For this reason, the
-- /local part/ of a source email address (the part of the email address
-- that precedes the \@ sign) may only contain
-- <https://en.wikipedia.org/wiki/Email_address#Local-part 7-bit ASCII characters>.
-- If the /domain part/ of an address (the part after the \@ sign) contains
-- non-ASCII characters, they must be encoded using Punycode, as described
-- in <https://tools.ietf.org/html/rfc3492.html RFC3492>. The sender name
-- (also known as the /friendly name/) may contain non-ASCII characters.
-- These characters must be encoded using MIME encoded-word syntax, as
-- described in<https://tools.ietf.org/html/rfc2047 RFC 2047>. MIME
-- encoded-word syntax uses the following form:
-- @=?charset?encoding?encoded-text?=@.
sendTemplatedEmail_source :: Lens.Lens' SendTemplatedEmail Prelude.Text
sendTemplatedEmail_source :: Lens' SendTemplatedEmail Text
sendTemplatedEmail_source = (SendTemplatedEmail -> Text)
-> (SendTemplatedEmail -> Text -> SendTemplatedEmail)
-> Lens' SendTemplatedEmail Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Text
$sel:source:SendTemplatedEmail' :: SendTemplatedEmail -> Text
source :: Text
source} -> Text
source) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Text
a -> SendTemplatedEmail
s {source = a} :: SendTemplatedEmail)

-- | The destination for this email, composed of To:, CC:, and BCC: fields. A
-- Destination can include up to 50 recipients across these three fields.
sendTemplatedEmail_destination :: Lens.Lens' SendTemplatedEmail Destination
sendTemplatedEmail_destination :: Lens' SendTemplatedEmail Destination
sendTemplatedEmail_destination = (SendTemplatedEmail -> Destination)
-> (SendTemplatedEmail -> Destination -> SendTemplatedEmail)
-> Lens' SendTemplatedEmail Destination
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Destination
$sel:destination:SendTemplatedEmail' :: SendTemplatedEmail -> Destination
destination :: Destination
destination} -> Destination
destination) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Destination
a -> SendTemplatedEmail
s {destination = a} :: SendTemplatedEmail)

-- | The template to use when sending this email.
sendTemplatedEmail_template :: Lens.Lens' SendTemplatedEmail Prelude.Text
sendTemplatedEmail_template :: Lens' SendTemplatedEmail Text
sendTemplatedEmail_template = (SendTemplatedEmail -> Text)
-> (SendTemplatedEmail -> Text -> SendTemplatedEmail)
-> Lens' SendTemplatedEmail Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Text
$sel:template:SendTemplatedEmail' :: SendTemplatedEmail -> Text
template :: Text
template} -> Text
template) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Text
a -> SendTemplatedEmail
s {template = a} :: SendTemplatedEmail)

-- | A list of replacement values to apply to the template. This parameter is
-- a JSON object, typically consisting of key-value pairs in which the keys
-- correspond to replacement tags in the email template.
sendTemplatedEmail_templateData :: Lens.Lens' SendTemplatedEmail Prelude.Text
sendTemplatedEmail_templateData :: Lens' SendTemplatedEmail Text
sendTemplatedEmail_templateData = (SendTemplatedEmail -> Text)
-> (SendTemplatedEmail -> Text -> SendTemplatedEmail)
-> Lens' SendTemplatedEmail Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Text
$sel:templateData:SendTemplatedEmail' :: SendTemplatedEmail -> Text
templateData :: Text
templateData} -> Text
templateData) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Text
a -> SendTemplatedEmail
s {templateData = a} :: SendTemplatedEmail)

instance Core.AWSRequest SendTemplatedEmail where
  type
    AWSResponse SendTemplatedEmail =
      SendTemplatedEmailResponse
  request :: (Service -> Service)
-> SendTemplatedEmail -> Request SendTemplatedEmail
request Service -> Service
overrides =
    Service -> SendTemplatedEmail -> Request SendTemplatedEmail
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy SendTemplatedEmail
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SendTemplatedEmail)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse SendTemplatedEmail))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy SendTemplatedEmail
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SendTemplatedEmail)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"SendTemplatedEmailResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int -> Text -> SendTemplatedEmailResponse
SendTemplatedEmailResponse'
            (Int -> Text -> SendTemplatedEmailResponse)
-> Either String Int
-> Either String (Text -> SendTemplatedEmailResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either String (Text -> SendTemplatedEmailResponse)
-> Either String Text -> Either String SendTemplatedEmailResponse
forall a b.
Either String (a -> b) -> Either String a -> Either String b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"MessageId")
      )

instance Prelude.Hashable SendTemplatedEmail where
  hashWithSalt :: Int -> SendTemplatedEmail -> Int
hashWithSalt Int
_salt SendTemplatedEmail' {Maybe [Text]
Maybe [MessageTag]
Maybe Text
Text
Destination
$sel:configurationSetName:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:replyToAddresses:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [Text]
$sel:returnPath:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:returnPathArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:sourceArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:tags:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [MessageTag]
$sel:templateArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:source:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:destination:SendTemplatedEmail' :: SendTemplatedEmail -> Destination
$sel:template:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:templateData:SendTemplatedEmail' :: SendTemplatedEmail -> Text
configurationSetName :: Maybe Text
replyToAddresses :: Maybe [Text]
returnPath :: Maybe Text
returnPathArn :: Maybe Text
sourceArn :: Maybe Text
tags :: Maybe [MessageTag]
templateArn :: Maybe Text
source :: Text
destination :: Destination
template :: Text
templateData :: Text
..} =
    Int
_salt
      Int -> Maybe Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
configurationSetName
      Int -> Maybe [Text] -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
replyToAddresses
      Int -> Maybe Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
returnPath
      Int -> Maybe Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
returnPathArn
      Int -> Maybe Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceArn
      Int -> Maybe [MessageTag] -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [MessageTag]
tags
      Int -> Maybe Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateArn
      Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
source
      Int -> Destination -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Destination
destination
      Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
template
      Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateData

instance Prelude.NFData SendTemplatedEmail where
  rnf :: SendTemplatedEmail -> ()
rnf SendTemplatedEmail' {Maybe [Text]
Maybe [MessageTag]
Maybe Text
Text
Destination
$sel:configurationSetName:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:replyToAddresses:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [Text]
$sel:returnPath:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:returnPathArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:sourceArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:tags:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [MessageTag]
$sel:templateArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:source:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:destination:SendTemplatedEmail' :: SendTemplatedEmail -> Destination
$sel:template:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:templateData:SendTemplatedEmail' :: SendTemplatedEmail -> Text
configurationSetName :: Maybe Text
replyToAddresses :: Maybe [Text]
returnPath :: Maybe Text
returnPathArn :: Maybe Text
sourceArn :: Maybe Text
tags :: Maybe [MessageTag]
templateArn :: Maybe Text
source :: Text
destination :: Destination
template :: Text
templateData :: Text
..} =
    Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configurationSetName
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe [Text] -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
replyToAddresses
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
returnPath
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
returnPathArn
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceArn
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe [MessageTag] -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe [MessageTag]
tags
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateArn
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
source
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Destination -> ()
forall a. NFData a => a -> ()
Prelude.rnf Destination
destination
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
template
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
templateData

instance Data.ToHeaders SendTemplatedEmail where
  toHeaders :: SendTemplatedEmail -> ResponseHeaders
toHeaders = ResponseHeaders -> SendTemplatedEmail -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath SendTemplatedEmail where
  toPath :: SendTemplatedEmail -> ByteString
toPath = ByteString -> SendTemplatedEmail -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery SendTemplatedEmail where
  toQuery :: SendTemplatedEmail -> QueryString
toQuery SendTemplatedEmail' {Maybe [Text]
Maybe [MessageTag]
Maybe Text
Text
Destination
$sel:configurationSetName:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:replyToAddresses:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [Text]
$sel:returnPath:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:returnPathArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:sourceArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:tags:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [MessageTag]
$sel:templateArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:source:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:destination:SendTemplatedEmail' :: SendTemplatedEmail -> Destination
$sel:template:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:templateData:SendTemplatedEmail' :: SendTemplatedEmail -> Text
configurationSetName :: Maybe Text
replyToAddresses :: Maybe [Text]
returnPath :: Maybe Text
returnPathArn :: Maybe Text
sourceArn :: Maybe Text
tags :: Maybe [MessageTag]
templateArn :: Maybe Text
source :: Text
destination :: Destination
template :: Text
templateData :: Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"SendTemplatedEmail" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"ConfigurationSetName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
configurationSetName,
        ByteString
"ReplyToAddresses"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
replyToAddresses
            ),
        ByteString
"ReturnPath" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
returnPath,
        ByteString
"ReturnPathArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
returnPathArn,
        ByteString
"SourceArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
sourceArn,
        ByteString
"Tags"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Data.toQuery
            (ByteString -> [MessageTag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" ([MessageTag] -> QueryString)
-> Maybe [MessageTag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MessageTag]
tags),
        ByteString
"TemplateArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
templateArn,
        ByteString
"Source" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
source,
        ByteString
"Destination" ByteString -> Destination -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Destination
destination,
        ByteString
"Template" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
template,
        ByteString
"TemplateData" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
templateData
      ]

-- | /See:/ 'newSendTemplatedEmailResponse' smart constructor.
data SendTemplatedEmailResponse = SendTemplatedEmailResponse'
  { -- | The response's http status code.
    SendTemplatedEmailResponse -> Int
httpStatus :: Prelude.Int,
    -- | The unique message identifier returned from the @SendTemplatedEmail@
    -- action.
    SendTemplatedEmailResponse -> Text
messageId :: Prelude.Text
  }
  deriving (SendTemplatedEmailResponse -> SendTemplatedEmailResponse -> Bool
(SendTemplatedEmailResponse -> SendTemplatedEmailResponse -> Bool)
-> (SendTemplatedEmailResponse
    -> SendTemplatedEmailResponse -> Bool)
-> Eq SendTemplatedEmailResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SendTemplatedEmailResponse -> SendTemplatedEmailResponse -> Bool
== :: SendTemplatedEmailResponse -> SendTemplatedEmailResponse -> Bool
$c/= :: SendTemplatedEmailResponse -> SendTemplatedEmailResponse -> Bool
/= :: SendTemplatedEmailResponse -> SendTemplatedEmailResponse -> Bool
Prelude.Eq, ReadPrec [SendTemplatedEmailResponse]
ReadPrec SendTemplatedEmailResponse
Int -> ReadS SendTemplatedEmailResponse
ReadS [SendTemplatedEmailResponse]
(Int -> ReadS SendTemplatedEmailResponse)
-> ReadS [SendTemplatedEmailResponse]
-> ReadPrec SendTemplatedEmailResponse
-> ReadPrec [SendTemplatedEmailResponse]
-> Read SendTemplatedEmailResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS SendTemplatedEmailResponse
readsPrec :: Int -> ReadS SendTemplatedEmailResponse
$creadList :: ReadS [SendTemplatedEmailResponse]
readList :: ReadS [SendTemplatedEmailResponse]
$creadPrec :: ReadPrec SendTemplatedEmailResponse
readPrec :: ReadPrec SendTemplatedEmailResponse
$creadListPrec :: ReadPrec [SendTemplatedEmailResponse]
readListPrec :: ReadPrec [SendTemplatedEmailResponse]
Prelude.Read, Int -> SendTemplatedEmailResponse -> ShowS
[SendTemplatedEmailResponse] -> ShowS
SendTemplatedEmailResponse -> String
(Int -> SendTemplatedEmailResponse -> ShowS)
-> (SendTemplatedEmailResponse -> String)
-> ([SendTemplatedEmailResponse] -> ShowS)
-> Show SendTemplatedEmailResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SendTemplatedEmailResponse -> ShowS
showsPrec :: Int -> SendTemplatedEmailResponse -> ShowS
$cshow :: SendTemplatedEmailResponse -> String
show :: SendTemplatedEmailResponse -> String
$cshowList :: [SendTemplatedEmailResponse] -> ShowS
showList :: [SendTemplatedEmailResponse] -> ShowS
Prelude.Show, (forall x.
 SendTemplatedEmailResponse -> Rep SendTemplatedEmailResponse x)
-> (forall x.
    Rep SendTemplatedEmailResponse x -> SendTemplatedEmailResponse)
-> Generic SendTemplatedEmailResponse
forall x.
Rep SendTemplatedEmailResponse x -> SendTemplatedEmailResponse
forall x.
SendTemplatedEmailResponse -> Rep SendTemplatedEmailResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SendTemplatedEmailResponse -> Rep SendTemplatedEmailResponse x
from :: forall x.
SendTemplatedEmailResponse -> Rep SendTemplatedEmailResponse x
$cto :: forall x.
Rep SendTemplatedEmailResponse x -> SendTemplatedEmailResponse
to :: forall x.
Rep SendTemplatedEmailResponse x -> SendTemplatedEmailResponse
Prelude.Generic)

-- |
-- Create a value of 'SendTemplatedEmailResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'sendTemplatedEmailResponse_httpStatus' - The response's http status code.
--
-- 'messageId', 'sendTemplatedEmailResponse_messageId' - The unique message identifier returned from the @SendTemplatedEmail@
-- action.
newSendTemplatedEmailResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'messageId'
  Prelude.Text ->
  SendTemplatedEmailResponse
newSendTemplatedEmailResponse :: Int -> Text -> SendTemplatedEmailResponse
newSendTemplatedEmailResponse
  Int
pHttpStatus_
  Text
pMessageId_ =
    SendTemplatedEmailResponse'
      { $sel:httpStatus:SendTemplatedEmailResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:messageId:SendTemplatedEmailResponse' :: Text
messageId = Text
pMessageId_
      }

-- | The response's http status code.
sendTemplatedEmailResponse_httpStatus :: Lens.Lens' SendTemplatedEmailResponse Prelude.Int
sendTemplatedEmailResponse_httpStatus :: Lens' SendTemplatedEmailResponse Int
sendTemplatedEmailResponse_httpStatus = (SendTemplatedEmailResponse -> Int)
-> (SendTemplatedEmailResponse
    -> Int -> SendTemplatedEmailResponse)
-> Lens' SendTemplatedEmailResponse Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmailResponse' {Int
$sel:httpStatus:SendTemplatedEmailResponse' :: SendTemplatedEmailResponse -> Int
httpStatus :: Int
httpStatus} -> Int
httpStatus) (\s :: SendTemplatedEmailResponse
s@SendTemplatedEmailResponse' {} Int
a -> SendTemplatedEmailResponse
s {httpStatus = a} :: SendTemplatedEmailResponse)

-- | The unique message identifier returned from the @SendTemplatedEmail@
-- action.
sendTemplatedEmailResponse_messageId :: Lens.Lens' SendTemplatedEmailResponse Prelude.Text
sendTemplatedEmailResponse_messageId :: Lens' SendTemplatedEmailResponse Text
sendTemplatedEmailResponse_messageId = (SendTemplatedEmailResponse -> Text)
-> (SendTemplatedEmailResponse
    -> Text -> SendTemplatedEmailResponse)
-> Lens' SendTemplatedEmailResponse Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmailResponse' {Text
$sel:messageId:SendTemplatedEmailResponse' :: SendTemplatedEmailResponse -> Text
messageId :: Text
messageId} -> Text
messageId) (\s :: SendTemplatedEmailResponse
s@SendTemplatedEmailResponse' {} Text
a -> SendTemplatedEmailResponse
s {messageId = a} :: SendTemplatedEmailResponse)

instance Prelude.NFData SendTemplatedEmailResponse where
  rnf :: SendTemplatedEmailResponse -> ()
rnf SendTemplatedEmailResponse' {Int
Text
$sel:httpStatus:SendTemplatedEmailResponse' :: SendTemplatedEmailResponse -> Int
$sel:messageId:SendTemplatedEmailResponse' :: SendTemplatedEmailResponse -> Text
httpStatus :: Int
messageId :: Text
..} =
    Int -> ()
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
messageId