{-# 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-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 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_returnPath,
    sendBulkTemplatedEmail_configurationSetName,
    sendBulkTemplatedEmail_sourceArn,
    sendBulkTemplatedEmail_defaultTags,
    sendBulkTemplatedEmail_returnPathArn,
    sendBulkTemplatedEmail_templateArn,
    sendBulkTemplatedEmail_defaultTemplateData,
    sendBulkTemplatedEmail_replyToAddresses,
    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.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 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 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,
    -- | The name of the configuration set to use when you send an email using
    -- @SendBulkTemplatedEmail@.
    SendBulkTemplatedEmail -> 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>.
    SendBulkTemplatedEmail -> Maybe Text
sourceArn :: Prelude.Maybe Prelude.Text,
    -- | A list of tags, in the form of name\/value pairs, to apply to an email
    -- that you send to a destination using @SendBulkTemplatedEmail@.
    SendBulkTemplatedEmail -> Maybe [MessageTag]
defaultTags :: Prelude.Maybe [MessageTag],
    -- | 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,
    -- | The ARN of the template to use when sending this email.
    SendBulkTemplatedEmail -> Maybe Text
templateArn :: Prelude.Maybe Prelude.Text,
    -- | 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 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
(SendBulkTemplatedEmail -> SendBulkTemplatedEmail -> Bool)
-> (SendBulkTemplatedEmail -> SendBulkTemplatedEmail -> Bool)
-> Eq SendBulkTemplatedEmail
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]
(Int -> ReadS SendBulkTemplatedEmail)
-> ReadS [SendBulkTemplatedEmail]
-> ReadPrec SendBulkTemplatedEmail
-> ReadPrec [SendBulkTemplatedEmail]
-> Read 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
(Int -> SendBulkTemplatedEmail -> ShowS)
-> (SendBulkTemplatedEmail -> String)
-> ([SendBulkTemplatedEmail] -> ShowS)
-> Show SendBulkTemplatedEmail
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. SendBulkTemplatedEmail -> Rep SendBulkTemplatedEmail x)
-> (forall x.
    Rep SendBulkTemplatedEmail x -> SendBulkTemplatedEmail)
-> Generic SendBulkTemplatedEmail
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:
--
-- '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.
--
-- 'configurationSetName', 'sendBulkTemplatedEmail_configurationSetName' - The name of the configuration set to use when you send an email using
-- @SendBulkTemplatedEmail@.
--
-- '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>.
--
-- '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@.
--
-- '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>.
--
-- 'templateArn', 'sendBulkTemplatedEmail_templateArn' - The ARN of the template to use when sending this email.
--
-- '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.
--
-- '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' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [MessageTag]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Text
-> Text
-> [BulkEmailDestination]
-> SendBulkTemplatedEmail
SendBulkTemplatedEmail'
    { $sel:returnPath:SendBulkTemplatedEmail' :: Maybe Text
returnPath =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:configurationSetName:SendBulkTemplatedEmail' :: Maybe Text
configurationSetName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceArn:SendBulkTemplatedEmail' :: Maybe Text
sourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultTags:SendBulkTemplatedEmail' :: Maybe [MessageTag]
defaultTags = Maybe [MessageTag]
forall a. Maybe a
Prelude.Nothing,
      $sel:returnPathArn:SendBulkTemplatedEmail' :: Maybe Text
returnPathArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateArn:SendBulkTemplatedEmail' :: Maybe Text
templateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultTemplateData:SendBulkTemplatedEmail' :: Maybe Text
defaultTemplateData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:replyToAddresses:SendBulkTemplatedEmail' :: Maybe [Text]
replyToAddresses = Maybe [Text]
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 = [BulkEmailDestination]
forall a. Monoid a => a
Prelude.mempty
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> SendBulkTemplatedEmail -> f SendBulkTemplatedEmail
sendBulkTemplatedEmail_returnPath = (SendBulkTemplatedEmail -> Maybe Text)
-> (SendBulkTemplatedEmail -> Maybe Text -> SendBulkTemplatedEmail)
-> Lens
     SendBulkTemplatedEmail
     SendBulkTemplatedEmail
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> SendBulkTemplatedEmail -> f SendBulkTemplatedEmail
sendBulkTemplatedEmail_configurationSetName = (SendBulkTemplatedEmail -> Maybe Text)
-> (SendBulkTemplatedEmail -> Maybe Text -> SendBulkTemplatedEmail)
-> Lens
     SendBulkTemplatedEmail
     SendBulkTemplatedEmail
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> SendBulkTemplatedEmail -> f SendBulkTemplatedEmail
sendBulkTemplatedEmail_sourceArn = (SendBulkTemplatedEmail -> Maybe Text)
-> (SendBulkTemplatedEmail -> Maybe Text -> SendBulkTemplatedEmail)
-> Lens
     SendBulkTemplatedEmail
     SendBulkTemplatedEmail
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> SendBulkTemplatedEmail -> f SendBulkTemplatedEmail
sendBulkTemplatedEmail_defaultTags = (SendBulkTemplatedEmail -> Maybe [MessageTag])
-> (SendBulkTemplatedEmail
    -> Maybe [MessageTag] -> SendBulkTemplatedEmail)
-> Lens
     SendBulkTemplatedEmail
     SendBulkTemplatedEmail
     (Maybe [MessageTag])
     (Maybe [MessageTag])
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) ((Maybe [MessageTag] -> f (Maybe [MessageTag]))
 -> SendBulkTemplatedEmail -> f SendBulkTemplatedEmail)
-> ((Maybe [MessageTag] -> f (Maybe [MessageTag]))
    -> Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> (Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> SendBulkTemplatedEmail
-> f SendBulkTemplatedEmail
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

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> SendBulkTemplatedEmail -> f SendBulkTemplatedEmail
sendBulkTemplatedEmail_returnPathArn = (SendBulkTemplatedEmail -> Maybe Text)
-> (SendBulkTemplatedEmail -> Maybe Text -> SendBulkTemplatedEmail)
-> Lens
     SendBulkTemplatedEmail
     SendBulkTemplatedEmail
     (Maybe Text)
     (Maybe Text)
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)

-- | The ARN of the template to use when sending this email.
sendBulkTemplatedEmail_templateArn :: Lens.Lens' SendBulkTemplatedEmail (Prelude.Maybe Prelude.Text)
sendBulkTemplatedEmail_templateArn :: (Maybe Text -> f (Maybe Text))
-> SendBulkTemplatedEmail -> f SendBulkTemplatedEmail
sendBulkTemplatedEmail_templateArn = (SendBulkTemplatedEmail -> Maybe Text)
-> (SendBulkTemplatedEmail -> Maybe Text -> SendBulkTemplatedEmail)
-> Lens
     SendBulkTemplatedEmail
     SendBulkTemplatedEmail
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> SendBulkTemplatedEmail -> f SendBulkTemplatedEmail
sendBulkTemplatedEmail_defaultTemplateData = (SendBulkTemplatedEmail -> Maybe Text)
-> (SendBulkTemplatedEmail -> Maybe Text -> SendBulkTemplatedEmail)
-> Lens
     SendBulkTemplatedEmail
     SendBulkTemplatedEmail
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe [Text] -> f (Maybe [Text]))
-> SendBulkTemplatedEmail -> f SendBulkTemplatedEmail
sendBulkTemplatedEmail_replyToAddresses = (SendBulkTemplatedEmail -> Maybe [Text])
-> (SendBulkTemplatedEmail
    -> Maybe [Text] -> SendBulkTemplatedEmail)
-> Lens
     SendBulkTemplatedEmail
     SendBulkTemplatedEmail
     (Maybe [Text])
     (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> SendBulkTemplatedEmail -> f SendBulkTemplatedEmail)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SendBulkTemplatedEmail
-> f SendBulkTemplatedEmail
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?=@.
sendBulkTemplatedEmail_source :: Lens.Lens' SendBulkTemplatedEmail Prelude.Text
sendBulkTemplatedEmail_source :: (Text -> f Text)
-> SendBulkTemplatedEmail -> f SendBulkTemplatedEmail
sendBulkTemplatedEmail_source = (SendBulkTemplatedEmail -> Text)
-> (SendBulkTemplatedEmail -> Text -> SendBulkTemplatedEmail)
-> Lens SendBulkTemplatedEmail SendBulkTemplatedEmail Text Text
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 :: (Text -> f Text)
-> SendBulkTemplatedEmail -> f SendBulkTemplatedEmail
sendBulkTemplatedEmail_template = (SendBulkTemplatedEmail -> Text)
-> (SendBulkTemplatedEmail -> Text -> SendBulkTemplatedEmail)
-> Lens SendBulkTemplatedEmail SendBulkTemplatedEmail Text Text
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 :: ([BulkEmailDestination] -> f [BulkEmailDestination])
-> SendBulkTemplatedEmail -> f SendBulkTemplatedEmail
sendBulkTemplatedEmail_destinations = (SendBulkTemplatedEmail -> [BulkEmailDestination])
-> (SendBulkTemplatedEmail
    -> [BulkEmailDestination] -> SendBulkTemplatedEmail)
-> Lens
     SendBulkTemplatedEmail
     SendBulkTemplatedEmail
     [BulkEmailDestination]
     [BulkEmailDestination]
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) (([BulkEmailDestination] -> f [BulkEmailDestination])
 -> SendBulkTemplatedEmail -> f SendBulkTemplatedEmail)
-> (([BulkEmailDestination] -> f [BulkEmailDestination])
    -> [BulkEmailDestination] -> f [BulkEmailDestination])
-> ([BulkEmailDestination] -> f [BulkEmailDestination])
-> SendBulkTemplatedEmail
-> f SendBulkTemplatedEmail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BulkEmailDestination] -> f [BulkEmailDestination])
-> [BulkEmailDestination] -> f [BulkEmailDestination]
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 :: SendBulkTemplatedEmail -> Request SendBulkTemplatedEmail
request = Service -> SendBulkTemplatedEmail -> Request SendBulkTemplatedEmail
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy SendBulkTemplatedEmail
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SendBulkTemplatedEmail)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse SendBulkTemplatedEmail))
-> Logger
-> Service
-> Proxy SendBulkTemplatedEmail
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SendBulkTemplatedEmail)))
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
"SendBulkTemplatedEmailResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int
-> [BulkEmailDestinationStatus] -> SendBulkTemplatedEmailResponse
SendBulkTemplatedEmailResponse'
            (Int
 -> [BulkEmailDestinationStatus] -> SendBulkTemplatedEmailResponse)
-> Either String Int
-> Either
     String
     ([BulkEmailDestinationStatus] -> SendBulkTemplatedEmailResponse)
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
  ([BulkEmailDestinationStatus] -> SendBulkTemplatedEmailResponse)
-> Either String [BulkEmailDestinationStatus]
-> Either String SendBulkTemplatedEmailResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String [BulkEmailDestinationStatus])
-> Either String [BulkEmailDestinationStatus]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [BulkEmailDestinationStatus]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
                        )
      )

instance Prelude.Hashable SendBulkTemplatedEmail

instance Prelude.NFData SendBulkTemplatedEmail

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

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

instance Core.ToQuery SendBulkTemplatedEmail where
  toQuery :: SendBulkTemplatedEmail -> QueryString
toQuery SendBulkTemplatedEmail' {[BulkEmailDestination]
Maybe [Text]
Maybe [MessageTag]
Maybe Text
Text
destinations :: [BulkEmailDestination]
template :: Text
source :: Text
replyToAddresses :: Maybe [Text]
defaultTemplateData :: Maybe Text
templateArn :: Maybe Text
returnPathArn :: Maybe Text
defaultTags :: Maybe [MessageTag]
sourceArn :: Maybe Text
configurationSetName :: Maybe Text
returnPath :: Maybe Text
$sel:destinations:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> [BulkEmailDestination]
$sel:template:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Text
$sel:source:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Text
$sel:replyToAddresses:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [Text]
$sel:defaultTemplateData:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:templateArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:returnPathArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:defaultTags:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [MessageTag]
$sel:sourceArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:configurationSetName:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:returnPath:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> 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
"SendBulkTemplatedEmail" :: 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
"DefaultTags"
          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]
defaultTags),
        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
"DefaultTemplateData" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
defaultTemplateData,
        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
"Template" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
template,
        ByteString
"Destinations"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [BulkEmailDestination] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.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
(SendBulkTemplatedEmailResponse
 -> SendBulkTemplatedEmailResponse -> Bool)
-> (SendBulkTemplatedEmailResponse
    -> SendBulkTemplatedEmailResponse -> Bool)
-> Eq SendBulkTemplatedEmailResponse
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]
(Int -> ReadS SendBulkTemplatedEmailResponse)
-> ReadS [SendBulkTemplatedEmailResponse]
-> ReadPrec SendBulkTemplatedEmailResponse
-> ReadPrec [SendBulkTemplatedEmailResponse]
-> Read 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
(Int -> SendBulkTemplatedEmailResponse -> ShowS)
-> (SendBulkTemplatedEmailResponse -> String)
-> ([SendBulkTemplatedEmailResponse] -> ShowS)
-> Show SendBulkTemplatedEmailResponse
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.
 SendBulkTemplatedEmailResponse
 -> Rep SendBulkTemplatedEmailResponse x)
-> (forall x.
    Rep SendBulkTemplatedEmailResponse x
    -> SendBulkTemplatedEmailResponse)
-> Generic SendBulkTemplatedEmailResponse
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' :: Int
-> [BulkEmailDestinationStatus] -> SendBulkTemplatedEmailResponse
SendBulkTemplatedEmailResponse'
    { $sel:httpStatus:SendBulkTemplatedEmailResponse' :: Int
httpStatus =
        Int
pHttpStatus_,
      $sel:status:SendBulkTemplatedEmailResponse' :: [BulkEmailDestinationStatus]
status = [BulkEmailDestinationStatus]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The response's http status code.
sendBulkTemplatedEmailResponse_httpStatus :: Lens.Lens' SendBulkTemplatedEmailResponse Prelude.Int
sendBulkTemplatedEmailResponse_httpStatus :: (Int -> f Int)
-> SendBulkTemplatedEmailResponse
-> f SendBulkTemplatedEmailResponse
sendBulkTemplatedEmailResponse_httpStatus = (SendBulkTemplatedEmailResponse -> Int)
-> (SendBulkTemplatedEmailResponse
    -> Int -> SendBulkTemplatedEmailResponse)
-> Lens
     SendBulkTemplatedEmailResponse
     SendBulkTemplatedEmailResponse
     Int
     Int
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 :: ([BulkEmailDestinationStatus] -> f [BulkEmailDestinationStatus])
-> SendBulkTemplatedEmailResponse
-> f SendBulkTemplatedEmailResponse
sendBulkTemplatedEmailResponse_status = (SendBulkTemplatedEmailResponse -> [BulkEmailDestinationStatus])
-> (SendBulkTemplatedEmailResponse
    -> [BulkEmailDestinationStatus] -> SendBulkTemplatedEmailResponse)
-> Lens
     SendBulkTemplatedEmailResponse
     SendBulkTemplatedEmailResponse
     [BulkEmailDestinationStatus]
     [BulkEmailDestinationStatus]
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) (([BulkEmailDestinationStatus] -> f [BulkEmailDestinationStatus])
 -> SendBulkTemplatedEmailResponse
 -> f SendBulkTemplatedEmailResponse)
-> (([BulkEmailDestinationStatus]
     -> f [BulkEmailDestinationStatus])
    -> [BulkEmailDestinationStatus] -> f [BulkEmailDestinationStatus])
-> ([BulkEmailDestinationStatus] -> f [BulkEmailDestinationStatus])
-> SendBulkTemplatedEmailResponse
-> f SendBulkTemplatedEmailResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BulkEmailDestinationStatus] -> f [BulkEmailDestinationStatus])
-> [BulkEmailDestinationStatus] -> f [BulkEmailDestinationStatus]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    SendBulkTemplatedEmailResponse