{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- 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_returnPath,
    sendTemplatedEmail_configurationSetName,
    sendTemplatedEmail_sourceArn,
    sendTemplatedEmail_returnPathArn,
    sendTemplatedEmail_templateArn,
    sendTemplatedEmail_tags,
    sendTemplatedEmail_replyToAddresses,
    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.Lens as Lens
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 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,
    -- | The name of the configuration set to use when you send an email using
    -- @SendTemplatedEmail@.
    SendTemplatedEmail -> Maybe Text
configurationSetName :: 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,
    -- | 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,
    -- | The ARN of the template to use when sending this email.
    SendTemplatedEmail -> Maybe Text
templateArn :: 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 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 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
/= :: SendTemplatedEmail -> SendTemplatedEmail -> Bool
$c/= :: SendTemplatedEmail -> SendTemplatedEmail -> Bool
== :: SendTemplatedEmail -> SendTemplatedEmail -> Bool
$c== :: 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
readListPrec :: ReadPrec [SendTemplatedEmail]
$creadListPrec :: ReadPrec [SendTemplatedEmail]
readPrec :: ReadPrec SendTemplatedEmail
$creadPrec :: ReadPrec SendTemplatedEmail
readList :: ReadS [SendTemplatedEmail]
$creadList :: ReadS [SendTemplatedEmail]
readsPrec :: Int -> ReadS SendTemplatedEmail
$creadsPrec :: Int -> ReadS 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
showList :: [SendTemplatedEmail] -> ShowS
$cshowList :: [SendTemplatedEmail] -> ShowS
show :: SendTemplatedEmail -> String
$cshow :: SendTemplatedEmail -> String
showsPrec :: Int -> SendTemplatedEmail -> ShowS
$cshowsPrec :: Int -> 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
$cto :: forall x. Rep SendTemplatedEmail x -> SendTemplatedEmail
$cfrom :: forall x. SendTemplatedEmail -> Rep SendTemplatedEmail x
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:
--
-- '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.
--
-- 'configurationSetName', 'sendTemplatedEmail_configurationSetName' - The name of the configuration set to use when you send an email using
-- @SendTemplatedEmail@.
--
-- '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>.
--
-- '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>.
--
-- 'templateArn', 'sendTemplatedEmail_templateArn' - The ARN of the template to use when sending this email.
--
-- '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.
--
-- '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.
--
-- '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' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [MessageTag]
-> Maybe [Text]
-> Text
-> Destination
-> Text
-> Text
-> SendTemplatedEmail
SendTemplatedEmail'
      { $sel:returnPath:SendTemplatedEmail' :: Maybe Text
returnPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:configurationSetName:SendTemplatedEmail' :: Maybe Text
configurationSetName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:sourceArn:SendTemplatedEmail' :: Maybe Text
sourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:returnPathArn:SendTemplatedEmail' :: Maybe Text
returnPathArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:templateArn:SendTemplatedEmail' :: Maybe Text
templateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:SendTemplatedEmail' :: Maybe [MessageTag]
tags = Maybe [MessageTag]
forall a. Maybe a
Prelude.Nothing,
        $sel:replyToAddresses:SendTemplatedEmail' :: Maybe [Text]
replyToAddresses = 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 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 :: (Maybe Text -> f (Maybe Text))
-> SendTemplatedEmail -> f SendTemplatedEmail
sendTemplatedEmail_returnPath = (SendTemplatedEmail -> Maybe Text)
-> (SendTemplatedEmail -> Maybe Text -> SendTemplatedEmail)
-> Lens
     SendTemplatedEmail SendTemplatedEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
returnPath :: Maybe Text
$sel:returnPath:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
returnPath} -> Maybe Text
returnPath) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {$sel:returnPath:SendTemplatedEmail' :: Maybe Text
returnPath = Maybe Text
a} :: SendTemplatedEmail)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> SendTemplatedEmail -> f SendTemplatedEmail
sendTemplatedEmail_configurationSetName = (SendTemplatedEmail -> Maybe Text)
-> (SendTemplatedEmail -> Maybe Text -> SendTemplatedEmail)
-> Lens
     SendTemplatedEmail SendTemplatedEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
configurationSetName :: Maybe Text
$sel:configurationSetName:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
configurationSetName} -> Maybe Text
configurationSetName) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {$sel:configurationSetName:SendTemplatedEmail' :: Maybe Text
configurationSetName = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> SendTemplatedEmail -> f SendTemplatedEmail
sendTemplatedEmail_sourceArn = (SendTemplatedEmail -> Maybe Text)
-> (SendTemplatedEmail -> Maybe Text -> SendTemplatedEmail)
-> Lens
     SendTemplatedEmail SendTemplatedEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
sourceArn :: Maybe Text
$sel:sourceArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
sourceArn} -> Maybe Text
sourceArn) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {$sel:sourceArn:SendTemplatedEmail' :: Maybe Text
sourceArn = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> SendTemplatedEmail -> f SendTemplatedEmail
sendTemplatedEmail_returnPathArn = (SendTemplatedEmail -> Maybe Text)
-> (SendTemplatedEmail -> Maybe Text -> SendTemplatedEmail)
-> Lens
     SendTemplatedEmail SendTemplatedEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
returnPathArn :: Maybe Text
$sel:returnPathArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
returnPathArn} -> Maybe Text
returnPathArn) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {$sel:returnPathArn:SendTemplatedEmail' :: Maybe Text
returnPathArn = Maybe Text
a} :: SendTemplatedEmail)

-- | The ARN of the template to use when sending this email.
sendTemplatedEmail_templateArn :: Lens.Lens' SendTemplatedEmail (Prelude.Maybe Prelude.Text)
sendTemplatedEmail_templateArn :: (Maybe Text -> f (Maybe Text))
-> SendTemplatedEmail -> f SendTemplatedEmail
sendTemplatedEmail_templateArn = (SendTemplatedEmail -> Maybe Text)
-> (SendTemplatedEmail -> Maybe Text -> SendTemplatedEmail)
-> Lens
     SendTemplatedEmail SendTemplatedEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe Text
templateArn :: Maybe Text
$sel:templateArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
templateArn} -> Maybe Text
templateArn) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe Text
a -> SendTemplatedEmail
s {$sel:templateArn:SendTemplatedEmail' :: Maybe Text
templateArn = Maybe Text
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 :: (Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> SendTemplatedEmail -> f SendTemplatedEmail
sendTemplatedEmail_tags = (SendTemplatedEmail -> Maybe [MessageTag])
-> (SendTemplatedEmail -> Maybe [MessageTag] -> SendTemplatedEmail)
-> Lens
     SendTemplatedEmail
     SendTemplatedEmail
     (Maybe [MessageTag])
     (Maybe [MessageTag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe [MessageTag]
tags :: Maybe [MessageTag]
$sel:tags:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [MessageTag]
tags} -> Maybe [MessageTag]
tags) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe [MessageTag]
a -> SendTemplatedEmail
s {$sel:tags:SendTemplatedEmail' :: Maybe [MessageTag]
tags = Maybe [MessageTag]
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
Lens.coerced

-- | 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 :: (Maybe [Text] -> f (Maybe [Text]))
-> SendTemplatedEmail -> f SendTemplatedEmail
sendTemplatedEmail_replyToAddresses = (SendTemplatedEmail -> Maybe [Text])
-> (SendTemplatedEmail -> Maybe [Text] -> SendTemplatedEmail)
-> Lens
     SendTemplatedEmail SendTemplatedEmail (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Maybe [Text]
replyToAddresses :: Maybe [Text]
$sel:replyToAddresses:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [Text]
replyToAddresses} -> Maybe [Text]
replyToAddresses) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Maybe [Text]
a -> SendTemplatedEmail
s {$sel:replyToAddresses:SendTemplatedEmail' :: Maybe [Text]
replyToAddresses = Maybe [Text]
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
Lens.coerced

-- | 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 :: (Text -> f Text) -> SendTemplatedEmail -> f SendTemplatedEmail
sendTemplatedEmail_source = (SendTemplatedEmail -> Text)
-> (SendTemplatedEmail -> Text -> SendTemplatedEmail)
-> Lens SendTemplatedEmail SendTemplatedEmail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Text
source :: Text
$sel:source:SendTemplatedEmail' :: SendTemplatedEmail -> Text
source} -> Text
source) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Text
a -> SendTemplatedEmail
s {$sel:source:SendTemplatedEmail' :: Text
source = Text
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 :: (Destination -> f Destination)
-> SendTemplatedEmail -> f SendTemplatedEmail
sendTemplatedEmail_destination = (SendTemplatedEmail -> Destination)
-> (SendTemplatedEmail -> Destination -> SendTemplatedEmail)
-> Lens
     SendTemplatedEmail SendTemplatedEmail Destination Destination
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmail' {Destination
destination :: Destination
$sel:destination:SendTemplatedEmail' :: SendTemplatedEmail -> Destination
destination} -> Destination
destination) (\s :: SendTemplatedEmail
s@SendTemplatedEmail' {} Destination
a -> SendTemplatedEmail
s {$sel:destination:SendTemplatedEmail' :: Destination
destination = Destination
a} :: SendTemplatedEmail)

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

instance Core.AWSRequest SendTemplatedEmail where
  type
    AWSResponse SendTemplatedEmail =
      SendTemplatedEmailResponse
  request :: SendTemplatedEmail -> Request SendTemplatedEmail
request = Service -> SendTemplatedEmail -> Request SendTemplatedEmail
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy SendTemplatedEmail
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SendTemplatedEmail)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse SendTemplatedEmail))
-> Logger
-> Service
-> Proxy SendTemplatedEmail
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SendTemplatedEmail)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> 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 (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 (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
Core..@ Text
"MessageId")
      )

instance Prelude.Hashable SendTemplatedEmail

instance Prelude.NFData SendTemplatedEmail

instance Core.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 Core.ToPath SendTemplatedEmail where
  toPath :: SendTemplatedEmail -> ByteString
toPath = ByteString -> SendTemplatedEmail -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery SendTemplatedEmail where
  toQuery :: SendTemplatedEmail -> QueryString
toQuery SendTemplatedEmail' {Maybe [Text]
Maybe [MessageTag]
Maybe Text
Text
Destination
templateData :: Text
template :: Text
destination :: Destination
source :: Text
replyToAddresses :: Maybe [Text]
tags :: Maybe [MessageTag]
templateArn :: Maybe Text
returnPathArn :: Maybe Text
sourceArn :: Maybe Text
configurationSetName :: Maybe Text
returnPath :: Maybe Text
$sel:templateData:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:template:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:destination:SendTemplatedEmail' :: SendTemplatedEmail -> Destination
$sel:source:SendTemplatedEmail' :: SendTemplatedEmail -> Text
$sel:replyToAddresses:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [Text]
$sel:tags:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe [MessageTag]
$sel:templateArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:returnPathArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:sourceArn:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:configurationSetName:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
$sel:returnPath:SendTemplatedEmail' :: SendTemplatedEmail -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"SendTemplatedEmail" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"ReturnPath" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
returnPath,
        ByteString
"ConfigurationSetName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
configurationSetName,
        ByteString
"SourceArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
sourceArn,
        ByteString
"ReturnPathArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
returnPathArn,
        ByteString
"TemplateArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
templateArn,
        ByteString
"Tags"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [MessageTag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.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
"ReplyToAddresses"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.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
"Source" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
source,
        ByteString
"Destination" ByteString -> Destination -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Destination
destination,
        ByteString
"Template" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
template,
        ByteString
"TemplateData" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: 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
/= :: SendTemplatedEmailResponse -> SendTemplatedEmailResponse -> Bool
$c/= :: SendTemplatedEmailResponse -> SendTemplatedEmailResponse -> Bool
== :: SendTemplatedEmailResponse -> SendTemplatedEmailResponse -> Bool
$c== :: 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
readListPrec :: ReadPrec [SendTemplatedEmailResponse]
$creadListPrec :: ReadPrec [SendTemplatedEmailResponse]
readPrec :: ReadPrec SendTemplatedEmailResponse
$creadPrec :: ReadPrec SendTemplatedEmailResponse
readList :: ReadS [SendTemplatedEmailResponse]
$creadList :: ReadS [SendTemplatedEmailResponse]
readsPrec :: Int -> ReadS SendTemplatedEmailResponse
$creadsPrec :: Int -> ReadS 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
showList :: [SendTemplatedEmailResponse] -> ShowS
$cshowList :: [SendTemplatedEmailResponse] -> ShowS
show :: SendTemplatedEmailResponse -> String
$cshow :: SendTemplatedEmailResponse -> String
showsPrec :: Int -> SendTemplatedEmailResponse -> ShowS
$cshowsPrec :: Int -> 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
$cto :: forall x.
Rep SendTemplatedEmailResponse x -> SendTemplatedEmailResponse
$cfrom :: forall x.
SendTemplatedEmailResponse -> Rep SendTemplatedEmailResponse x
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' :: Int -> Text -> SendTemplatedEmailResponse
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 :: (Int -> f Int)
-> SendTemplatedEmailResponse -> f SendTemplatedEmailResponse
sendTemplatedEmailResponse_httpStatus = (SendTemplatedEmailResponse -> Int)
-> (SendTemplatedEmailResponse
    -> Int -> SendTemplatedEmailResponse)
-> Lens
     SendTemplatedEmailResponse SendTemplatedEmailResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTemplatedEmailResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendTemplatedEmailResponse' :: SendTemplatedEmailResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendTemplatedEmailResponse
s@SendTemplatedEmailResponse' {} Int
a -> SendTemplatedEmailResponse
s {$sel:httpStatus:SendTemplatedEmailResponse' :: Int
httpStatus = Int
a} :: SendTemplatedEmailResponse)

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

instance Prelude.NFData SendTemplatedEmailResponse