{-# 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.SendBulkTemplatedEmail
-- 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 to multiple destinations. The message body is
-- created using an email template.
--
-- In order to send email using the @SendBulkTemplatedEmail@ 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.
--
-- -   Each @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.
--
-- -   The message may not include more than 50 recipients, across the To:,
--     CC: and BCC: fields. If you need to send an email message to a
--     larger audience, you can divide your recipient list into groups of
--     50 or fewer, and then call the @SendBulkTemplatedEmail@ operation
--     several times to send the message to each group.
--
-- -   The number of destinations you can contact in a single call to the
--     API may be limited by your account\'s maximum sending rate.
module Amazonka.SES.SendBulkTemplatedEmail
  ( -- * Creating a Request
    SendBulkTemplatedEmail (..),
    newSendBulkTemplatedEmail,

    -- * Request Lenses
    sendBulkTemplatedEmail_configurationSetName,
    sendBulkTemplatedEmail_defaultTags,
    sendBulkTemplatedEmail_defaultTemplateData,
    sendBulkTemplatedEmail_replyToAddresses,
    sendBulkTemplatedEmail_returnPath,
    sendBulkTemplatedEmail_returnPathArn,
    sendBulkTemplatedEmail_sourceArn,
    sendBulkTemplatedEmail_templateArn,
    sendBulkTemplatedEmail_source,
    sendBulkTemplatedEmail_template,
    sendBulkTemplatedEmail_destinations,

    -- * Destructuring the Response
    SendBulkTemplatedEmailResponse (..),
    newSendBulkTemplatedEmailResponse,

    -- * Response Lenses
    sendBulkTemplatedEmailResponse_httpStatus,
    sendBulkTemplatedEmailResponse_status,
  )
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 to multiple destinations
-- 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:/ 'newSendBulkTemplatedEmail' smart constructor.
data SendBulkTemplatedEmail = SendBulkTemplatedEmail'
  { -- | The name of the configuration set to use when you send an email using
    -- @SendBulkTemplatedEmail@.
    SendBulkTemplatedEmail -> Maybe Text
configurationSetName :: Prelude.Maybe Prelude.Text,
    -- | A list of tags, in the form of name\/value pairs, to apply to an email
    -- that you send to a destination using @SendBulkTemplatedEmail@.
    SendBulkTemplatedEmail -> Maybe [MessageTag]
defaultTags :: Prelude.Maybe [MessageTag],
    -- | A list of replacement values to apply to the template when replacement
    -- data is not specified in a Destination object. These values act as a
    -- default or fallback option when no other data is available.
    --
    -- The template data is a JSON object, typically consisting of key-value
    -- pairs in which the keys correspond to replacement tags in the email
    -- template.
    SendBulkTemplatedEmail -> Maybe Text
defaultTemplateData :: 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.
    SendBulkTemplatedEmail -> 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.
    SendBulkTemplatedEmail -> 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>.
    SendBulkTemplatedEmail -> 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>.
    SendBulkTemplatedEmail -> Maybe Text
sourceArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the template to use when sending this email.
    SendBulkTemplatedEmail -> 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?=@.
    SendBulkTemplatedEmail -> Text
source :: Prelude.Text,
    -- | The template to use when sending this email.
    SendBulkTemplatedEmail -> Text
template :: Prelude.Text,
    -- | One or more @Destination@ objects. All of the recipients in a
    -- @Destination@ will receive the same version of the email. You can
    -- specify up to 50 @Destination@ objects within a @Destinations@ array.
    SendBulkTemplatedEmail -> [BulkEmailDestination]
destinations :: [BulkEmailDestination]
  }
  deriving (SendBulkTemplatedEmail -> SendBulkTemplatedEmail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendBulkTemplatedEmail -> SendBulkTemplatedEmail -> Bool
$c/= :: SendBulkTemplatedEmail -> SendBulkTemplatedEmail -> Bool
== :: SendBulkTemplatedEmail -> SendBulkTemplatedEmail -> Bool
$c== :: SendBulkTemplatedEmail -> SendBulkTemplatedEmail -> Bool
Prelude.Eq, ReadPrec [SendBulkTemplatedEmail]
ReadPrec SendBulkTemplatedEmail
Int -> ReadS SendBulkTemplatedEmail
ReadS [SendBulkTemplatedEmail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendBulkTemplatedEmail]
$creadListPrec :: ReadPrec [SendBulkTemplatedEmail]
readPrec :: ReadPrec SendBulkTemplatedEmail
$creadPrec :: ReadPrec SendBulkTemplatedEmail
readList :: ReadS [SendBulkTemplatedEmail]
$creadList :: ReadS [SendBulkTemplatedEmail]
readsPrec :: Int -> ReadS SendBulkTemplatedEmail
$creadsPrec :: Int -> ReadS SendBulkTemplatedEmail
Prelude.Read, Int -> SendBulkTemplatedEmail -> ShowS
[SendBulkTemplatedEmail] -> ShowS
SendBulkTemplatedEmail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendBulkTemplatedEmail] -> ShowS
$cshowList :: [SendBulkTemplatedEmail] -> ShowS
show :: SendBulkTemplatedEmail -> String
$cshow :: SendBulkTemplatedEmail -> String
showsPrec :: Int -> SendBulkTemplatedEmail -> ShowS
$cshowsPrec :: Int -> SendBulkTemplatedEmail -> ShowS
Prelude.Show, forall x. Rep SendBulkTemplatedEmail x -> SendBulkTemplatedEmail
forall x. SendBulkTemplatedEmail -> Rep SendBulkTemplatedEmail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendBulkTemplatedEmail x -> SendBulkTemplatedEmail
$cfrom :: forall x. SendBulkTemplatedEmail -> Rep SendBulkTemplatedEmail x
Prelude.Generic)

-- |
-- Create a value of 'SendBulkTemplatedEmail' 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', 'sendBulkTemplatedEmail_configurationSetName' - The name of the configuration set to use when you send an email using
-- @SendBulkTemplatedEmail@.
--
-- 'defaultTags', 'sendBulkTemplatedEmail_defaultTags' - A list of tags, in the form of name\/value pairs, to apply to an email
-- that you send to a destination using @SendBulkTemplatedEmail@.
--
-- 'defaultTemplateData', 'sendBulkTemplatedEmail_defaultTemplateData' - A list of replacement values to apply to the template when replacement
-- data is not specified in a Destination object. These values act as a
-- default or fallback option when no other data is available.
--
-- The template data is a JSON object, typically consisting of key-value
-- pairs in which the keys correspond to replacement tags in the email
-- template.
--
-- 'replyToAddresses', 'sendBulkTemplatedEmail_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', 'sendBulkTemplatedEmail_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', 'sendBulkTemplatedEmail_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', 'sendBulkTemplatedEmail_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>.
--
-- 'templateArn', 'sendBulkTemplatedEmail_templateArn' - The ARN of the template to use when sending this email.
--
-- 'source', 'sendBulkTemplatedEmail_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?=@.
--
-- 'template', 'sendBulkTemplatedEmail_template' - The template to use when sending this email.
--
-- 'destinations', 'sendBulkTemplatedEmail_destinations' - One or more @Destination@ objects. All of the recipients in a
-- @Destination@ will receive the same version of the email. You can
-- specify up to 50 @Destination@ objects within a @Destinations@ array.
newSendBulkTemplatedEmail ::
  -- | 'source'
  Prelude.Text ->
  -- | 'template'
  Prelude.Text ->
  SendBulkTemplatedEmail
newSendBulkTemplatedEmail :: Text -> Text -> SendBulkTemplatedEmail
newSendBulkTemplatedEmail Text
pSource_ Text
pTemplate_ =
  SendBulkTemplatedEmail'
    { $sel:configurationSetName:SendBulkTemplatedEmail' :: Maybe Text
configurationSetName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:defaultTags:SendBulkTemplatedEmail' :: Maybe [MessageTag]
defaultTags = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultTemplateData:SendBulkTemplatedEmail' :: Maybe Text
defaultTemplateData = forall a. Maybe a
Prelude.Nothing,
      $sel:replyToAddresses:SendBulkTemplatedEmail' :: Maybe [Text]
replyToAddresses = forall a. Maybe a
Prelude.Nothing,
      $sel:returnPath:SendBulkTemplatedEmail' :: Maybe Text
returnPath = forall a. Maybe a
Prelude.Nothing,
      $sel:returnPathArn:SendBulkTemplatedEmail' :: Maybe Text
returnPathArn = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceArn:SendBulkTemplatedEmail' :: Maybe Text
sourceArn = forall a. Maybe a
Prelude.Nothing,
      $sel:templateArn:SendBulkTemplatedEmail' :: Maybe Text
templateArn = forall a. Maybe a
Prelude.Nothing,
      $sel:source:SendBulkTemplatedEmail' :: Text
source = Text
pSource_,
      $sel:template:SendBulkTemplatedEmail' :: Text
template = Text
pTemplate_,
      $sel:destinations:SendBulkTemplatedEmail' :: [BulkEmailDestination]
destinations = forall a. Monoid a => a
Prelude.mempty
    }

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

-- | A list of tags, in the form of name\/value pairs, to apply to an email
-- that you send to a destination using @SendBulkTemplatedEmail@.
sendBulkTemplatedEmail_defaultTags :: Lens.Lens' SendBulkTemplatedEmail (Prelude.Maybe [MessageTag])
sendBulkTemplatedEmail_defaultTags :: Lens' SendBulkTemplatedEmail (Maybe [MessageTag])
sendBulkTemplatedEmail_defaultTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkTemplatedEmail' {Maybe [MessageTag]
defaultTags :: Maybe [MessageTag]
$sel:defaultTags:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [MessageTag]
defaultTags} -> Maybe [MessageTag]
defaultTags) (\s :: SendBulkTemplatedEmail
s@SendBulkTemplatedEmail' {} Maybe [MessageTag]
a -> SendBulkTemplatedEmail
s {$sel:defaultTags:SendBulkTemplatedEmail' :: Maybe [MessageTag]
defaultTags = Maybe [MessageTag]
a} :: SendBulkTemplatedEmail) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of replacement values to apply to the template when replacement
-- data is not specified in a Destination object. These values act as a
-- default or fallback option when no other data is available.
--
-- The template data is a JSON object, typically consisting of key-value
-- pairs in which the keys correspond to replacement tags in the email
-- template.
sendBulkTemplatedEmail_defaultTemplateData :: Lens.Lens' SendBulkTemplatedEmail (Prelude.Maybe Prelude.Text)
sendBulkTemplatedEmail_defaultTemplateData :: Lens' SendBulkTemplatedEmail (Maybe Text)
sendBulkTemplatedEmail_defaultTemplateData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkTemplatedEmail' {Maybe Text
defaultTemplateData :: Maybe Text
$sel:defaultTemplateData:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
defaultTemplateData} -> Maybe Text
defaultTemplateData) (\s :: SendBulkTemplatedEmail
s@SendBulkTemplatedEmail' {} Maybe Text
a -> SendBulkTemplatedEmail
s {$sel:defaultTemplateData:SendBulkTemplatedEmail' :: Maybe Text
defaultTemplateData = Maybe Text
a} :: SendBulkTemplatedEmail)

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

-- | 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>.
sendBulkTemplatedEmail_returnPathArn :: Lens.Lens' SendBulkTemplatedEmail (Prelude.Maybe Prelude.Text)
sendBulkTemplatedEmail_returnPathArn :: Lens' SendBulkTemplatedEmail (Maybe Text)
sendBulkTemplatedEmail_returnPathArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkTemplatedEmail' {Maybe Text
returnPathArn :: Maybe Text
$sel:returnPathArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
returnPathArn} -> Maybe Text
returnPathArn) (\s :: SendBulkTemplatedEmail
s@SendBulkTemplatedEmail' {} Maybe Text
a -> SendBulkTemplatedEmail
s {$sel:returnPathArn:SendBulkTemplatedEmail' :: Maybe Text
returnPathArn = Maybe Text
a} :: SendBulkTemplatedEmail)

-- | 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>.
sendBulkTemplatedEmail_sourceArn :: Lens.Lens' SendBulkTemplatedEmail (Prelude.Maybe Prelude.Text)
sendBulkTemplatedEmail_sourceArn :: Lens' SendBulkTemplatedEmail (Maybe Text)
sendBulkTemplatedEmail_sourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkTemplatedEmail' {Maybe Text
sourceArn :: Maybe Text
$sel:sourceArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
sourceArn} -> Maybe Text
sourceArn) (\s :: SendBulkTemplatedEmail
s@SendBulkTemplatedEmail' {} Maybe Text
a -> SendBulkTemplatedEmail
s {$sel:sourceArn:SendBulkTemplatedEmail' :: Maybe Text
sourceArn = Maybe Text
a} :: SendBulkTemplatedEmail)

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

-- | 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?=@.
sendBulkTemplatedEmail_source :: Lens.Lens' SendBulkTemplatedEmail Prelude.Text
sendBulkTemplatedEmail_source :: Lens' SendBulkTemplatedEmail Text
sendBulkTemplatedEmail_source = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkTemplatedEmail' {Text
source :: Text
$sel:source:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Text
source} -> Text
source) (\s :: SendBulkTemplatedEmail
s@SendBulkTemplatedEmail' {} Text
a -> SendBulkTemplatedEmail
s {$sel:source:SendBulkTemplatedEmail' :: Text
source = Text
a} :: SendBulkTemplatedEmail)

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

-- | One or more @Destination@ objects. All of the recipients in a
-- @Destination@ will receive the same version of the email. You can
-- specify up to 50 @Destination@ objects within a @Destinations@ array.
sendBulkTemplatedEmail_destinations :: Lens.Lens' SendBulkTemplatedEmail [BulkEmailDestination]
sendBulkTemplatedEmail_destinations :: Lens' SendBulkTemplatedEmail [BulkEmailDestination]
sendBulkTemplatedEmail_destinations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkTemplatedEmail' {[BulkEmailDestination]
destinations :: [BulkEmailDestination]
$sel:destinations:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> [BulkEmailDestination]
destinations} -> [BulkEmailDestination]
destinations) (\s :: SendBulkTemplatedEmail
s@SendBulkTemplatedEmail' {} [BulkEmailDestination]
a -> SendBulkTemplatedEmail
s {$sel:destinations:SendBulkTemplatedEmail' :: [BulkEmailDestination]
destinations = [BulkEmailDestination]
a} :: SendBulkTemplatedEmail) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest SendBulkTemplatedEmail where
  type
    AWSResponse SendBulkTemplatedEmail =
      SendBulkTemplatedEmailResponse
  request :: (Service -> Service)
-> SendBulkTemplatedEmail -> Request SendBulkTemplatedEmail
request Service -> Service
overrides =
    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 SendBulkTemplatedEmail
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SendBulkTemplatedEmail)))
response =
    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
"SendBulkTemplatedEmailResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int
-> [BulkEmailDestinationStatus] -> SendBulkTemplatedEmailResponse
SendBulkTemplatedEmailResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Status"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member"
                        )
      )

instance Prelude.Hashable SendBulkTemplatedEmail where
  hashWithSalt :: Int -> SendBulkTemplatedEmail -> Int
hashWithSalt Int
_salt SendBulkTemplatedEmail' {[BulkEmailDestination]
Maybe [Text]
Maybe [MessageTag]
Maybe Text
Text
destinations :: [BulkEmailDestination]
template :: Text
source :: Text
templateArn :: Maybe Text
sourceArn :: Maybe Text
returnPathArn :: Maybe Text
returnPath :: Maybe Text
replyToAddresses :: Maybe [Text]
defaultTemplateData :: Maybe Text
defaultTags :: Maybe [MessageTag]
configurationSetName :: Maybe Text
$sel:destinations:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> [BulkEmailDestination]
$sel:template:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Text
$sel:source:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Text
$sel:templateArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:sourceArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:returnPathArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:returnPath:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:replyToAddresses:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [Text]
$sel:defaultTemplateData:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:defaultTags:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [MessageTag]
$sel:configurationSetName:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
configurationSetName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [MessageTag]
defaultTags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultTemplateData
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
replyToAddresses
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
returnPath
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
returnPathArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
source
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
template
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [BulkEmailDestination]
destinations

instance Prelude.NFData SendBulkTemplatedEmail where
  rnf :: SendBulkTemplatedEmail -> ()
rnf SendBulkTemplatedEmail' {[BulkEmailDestination]
Maybe [Text]
Maybe [MessageTag]
Maybe Text
Text
destinations :: [BulkEmailDestination]
template :: Text
source :: Text
templateArn :: Maybe Text
sourceArn :: Maybe Text
returnPathArn :: Maybe Text
returnPath :: Maybe Text
replyToAddresses :: Maybe [Text]
defaultTemplateData :: Maybe Text
defaultTags :: Maybe [MessageTag]
configurationSetName :: Maybe Text
$sel:destinations:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> [BulkEmailDestination]
$sel:template:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Text
$sel:source:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Text
$sel:templateArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:sourceArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:returnPathArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:returnPath:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:replyToAddresses:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [Text]
$sel:defaultTemplateData:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:defaultTags:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [MessageTag]
$sel:configurationSetName:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configurationSetName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [MessageTag]
defaultTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultTemplateData
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
replyToAddresses
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
returnPath
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
returnPathArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
source
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
template
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [BulkEmailDestination]
destinations

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

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

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

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

-- |
-- Create a value of 'SendBulkTemplatedEmailResponse' 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', 'sendBulkTemplatedEmailResponse_httpStatus' - The response's http status code.
--
-- 'status', 'sendBulkTemplatedEmailResponse_status' - The unique message identifier returned from the @SendBulkTemplatedEmail@
-- action.
newSendBulkTemplatedEmailResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SendBulkTemplatedEmailResponse
newSendBulkTemplatedEmailResponse :: Int -> SendBulkTemplatedEmailResponse
newSendBulkTemplatedEmailResponse Int
pHttpStatus_ =
  SendBulkTemplatedEmailResponse'
    { $sel:httpStatus:SendBulkTemplatedEmailResponse' :: Int
httpStatus =
        Int
pHttpStatus_,
      $sel:status:SendBulkTemplatedEmailResponse' :: [BulkEmailDestinationStatus]
status = forall a. Monoid a => a
Prelude.mempty
    }

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

-- | The unique message identifier returned from the @SendBulkTemplatedEmail@
-- action.
sendBulkTemplatedEmailResponse_status :: Lens.Lens' SendBulkTemplatedEmailResponse [BulkEmailDestinationStatus]
sendBulkTemplatedEmailResponse_status :: Lens' SendBulkTemplatedEmailResponse [BulkEmailDestinationStatus]
sendBulkTemplatedEmailResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkTemplatedEmailResponse' {[BulkEmailDestinationStatus]
status :: [BulkEmailDestinationStatus]
$sel:status:SendBulkTemplatedEmailResponse' :: SendBulkTemplatedEmailResponse -> [BulkEmailDestinationStatus]
status} -> [BulkEmailDestinationStatus]
status) (\s :: SendBulkTemplatedEmailResponse
s@SendBulkTemplatedEmailResponse' {} [BulkEmailDestinationStatus]
a -> SendBulkTemplatedEmailResponse
s {$sel:status:SendBulkTemplatedEmailResponse' :: [BulkEmailDestinationStatus]
status = [BulkEmailDestinationStatus]
a} :: SendBulkTemplatedEmailResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    SendBulkTemplatedEmailResponse
  where
  rnf :: SendBulkTemplatedEmailResponse -> ()
rnf SendBulkTemplatedEmailResponse' {Int
[BulkEmailDestinationStatus]
status :: [BulkEmailDestinationStatus]
httpStatus :: Int
$sel:status:SendBulkTemplatedEmailResponse' :: SendBulkTemplatedEmailResponse -> [BulkEmailDestinationStatus]
$sel:httpStatus:SendBulkTemplatedEmailResponse' :: SendBulkTemplatedEmailResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [BulkEmailDestinationStatus]
status