{-# 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
(SendBulkTemplatedEmail -> SendBulkTemplatedEmail -> Bool)
-> (SendBulkTemplatedEmail -> SendBulkTemplatedEmail -> Bool)
-> Eq SendBulkTemplatedEmail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SendBulkTemplatedEmail -> SendBulkTemplatedEmail -> Bool
== :: SendBulkTemplatedEmail -> SendBulkTemplatedEmail -> Bool
$c/= :: SendBulkTemplatedEmail -> SendBulkTemplatedEmail -> Bool
/= :: 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
$creadsPrec :: Int -> ReadS SendBulkTemplatedEmail
readsPrec :: Int -> ReadS SendBulkTemplatedEmail
$creadList :: ReadS [SendBulkTemplatedEmail]
readList :: ReadS [SendBulkTemplatedEmail]
$creadPrec :: ReadPrec SendBulkTemplatedEmail
readPrec :: ReadPrec SendBulkTemplatedEmail
$creadListPrec :: ReadPrec [SendBulkTemplatedEmail]
readListPrec :: ReadPrec [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
$cshowsPrec :: Int -> SendBulkTemplatedEmail -> ShowS
showsPrec :: Int -> SendBulkTemplatedEmail -> ShowS
$cshow :: SendBulkTemplatedEmail -> String
show :: SendBulkTemplatedEmail -> String
$cshowList :: [SendBulkTemplatedEmail] -> ShowS
showList :: [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
$cfrom :: forall x. SendBulkTemplatedEmail -> Rep SendBulkTemplatedEmail x
from :: forall x. SendBulkTemplatedEmail -> Rep SendBulkTemplatedEmail x
$cto :: forall x. Rep SendBulkTemplatedEmail x -> SendBulkTemplatedEmail
to :: forall x. Rep SendBulkTemplatedEmail x -> SendBulkTemplatedEmail
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 =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultTags:SendBulkTemplatedEmail' :: Maybe [MessageTag]
defaultTags = Maybe [MessageTag]
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:returnPath:SendBulkTemplatedEmail' :: Maybe Text
returnPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:returnPathArn:SendBulkTemplatedEmail' :: Maybe Text
returnPathArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceArn:SendBulkTemplatedEmail' :: Maybe Text
sourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateArn:SendBulkTemplatedEmail' :: Maybe Text
templateArn = 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 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 = (SendBulkTemplatedEmail -> Maybe Text)
-> (SendBulkTemplatedEmail -> Maybe Text -> SendBulkTemplatedEmail)
-> Lens' SendBulkTemplatedEmail (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkTemplatedEmail' {Maybe Text
$sel:configurationSetName:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
configurationSetName :: Maybe Text
configurationSetName} -> Maybe Text
configurationSetName) (\s :: SendBulkTemplatedEmail
s@SendBulkTemplatedEmail' {} Maybe Text
a -> SendBulkTemplatedEmail
s {configurationSetName = 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 = (SendBulkTemplatedEmail -> Maybe [MessageTag])
-> (SendBulkTemplatedEmail
    -> Maybe [MessageTag] -> SendBulkTemplatedEmail)
-> Lens' SendBulkTemplatedEmail (Maybe [MessageTag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkTemplatedEmail' {Maybe [MessageTag]
$sel:defaultTags:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [MessageTag]
defaultTags :: Maybe [MessageTag]
defaultTags} -> Maybe [MessageTag]
defaultTags) (\s :: SendBulkTemplatedEmail
s@SendBulkTemplatedEmail' {} Maybe [MessageTag]
a -> SendBulkTemplatedEmail
s {defaultTags = 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
Iso [MessageTag] [MessageTag] [MessageTag] [MessageTag]
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 = (SendBulkTemplatedEmail -> Maybe Text)
-> (SendBulkTemplatedEmail -> Maybe Text -> SendBulkTemplatedEmail)
-> Lens' SendBulkTemplatedEmail (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkTemplatedEmail' {Maybe Text
$sel:defaultTemplateData:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
defaultTemplateData :: Maybe Text
defaultTemplateData} -> Maybe Text
defaultTemplateData) (\s :: SendBulkTemplatedEmail
s@SendBulkTemplatedEmail' {} Maybe Text
a -> SendBulkTemplatedEmail
s {defaultTemplateData = 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 = (SendBulkTemplatedEmail -> Maybe [Text])
-> (SendBulkTemplatedEmail
    -> Maybe [Text] -> SendBulkTemplatedEmail)
-> Lens' SendBulkTemplatedEmail (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkTemplatedEmail' {Maybe [Text]
$sel:replyToAddresses:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [Text]
replyToAddresses :: Maybe [Text]
replyToAddresses} -> Maybe [Text]
replyToAddresses) (\s :: SendBulkTemplatedEmail
s@SendBulkTemplatedEmail' {} Maybe [Text]
a -> SendBulkTemplatedEmail
s {replyToAddresses = 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
Iso [Text] [Text] [Text] [Text]
Lens.coerced

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

-- | The template to use when sending this email.
sendBulkTemplatedEmail_template :: Lens.Lens' SendBulkTemplatedEmail Prelude.Text
sendBulkTemplatedEmail_template :: Lens' SendBulkTemplatedEmail Text
sendBulkTemplatedEmail_template = (SendBulkTemplatedEmail -> Text)
-> (SendBulkTemplatedEmail -> Text -> SendBulkTemplatedEmail)
-> Lens' SendBulkTemplatedEmail Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkTemplatedEmail' {Text
$sel:template:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Text
template :: Text
template} -> Text
template) (\s :: SendBulkTemplatedEmail
s@SendBulkTemplatedEmail' {} Text
a -> SendBulkTemplatedEmail
s {template = 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 = (SendBulkTemplatedEmail -> [BulkEmailDestination])
-> (SendBulkTemplatedEmail
    -> [BulkEmailDestination] -> SendBulkTemplatedEmail)
-> Lens' SendBulkTemplatedEmail [BulkEmailDestination]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkTemplatedEmail' {[BulkEmailDestination]
$sel:destinations:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> [BulkEmailDestination]
destinations :: [BulkEmailDestination]
destinations} -> [BulkEmailDestination]
destinations) (\s :: SendBulkTemplatedEmail
s@SendBulkTemplatedEmail' {} [BulkEmailDestination]
a -> SendBulkTemplatedEmail
s {destinations = 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
Iso
  [BulkEmailDestination]
  [BulkEmailDestination]
  [BulkEmailDestination]
  [BulkEmailDestination]
Lens.coerced

instance Core.AWSRequest SendBulkTemplatedEmail where
  type
    AWSResponse SendBulkTemplatedEmail =
      SendBulkTemplatedEmailResponse
  request :: (Service -> Service)
-> SendBulkTemplatedEmail -> Request SendBulkTemplatedEmail
request Service -> Service
overrides =
    Service -> SendBulkTemplatedEmail -> Request SendBulkTemplatedEmail
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 =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse SendBulkTemplatedEmail))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy SendBulkTemplatedEmail
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SendBulkTemplatedEmail)))
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'
            (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 a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String
  ([BulkEmailDestinationStatus] -> SendBulkTemplatedEmailResponse)
-> Either String [BulkEmailDestinationStatus]
-> Either String SendBulkTemplatedEmailResponse
forall a b.
Either String (a -> b) -> Either String a -> Either String b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? 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 a b.
Either String a -> (a -> Either String b) -> Either String b
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]
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
$sel:configurationSetName:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:defaultTags:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [MessageTag]
$sel:defaultTemplateData:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:replyToAddresses:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [Text]
$sel:returnPath:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:returnPathArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:sourceArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:templateArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:source:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Text
$sel:template:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Text
$sel:destinations:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> [BulkEmailDestination]
configurationSetName :: Maybe Text
defaultTags :: Maybe [MessageTag]
defaultTemplateData :: Maybe Text
replyToAddresses :: Maybe [Text]
returnPath :: Maybe Text
returnPathArn :: Maybe Text
sourceArn :: Maybe Text
templateArn :: Maybe Text
source :: Text
template :: Text
destinations :: [BulkEmailDestination]
..} =
    Int
_salt
      Int -> Maybe Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
configurationSetName
      Int -> Maybe [MessageTag] -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [MessageTag]
defaultTags
      Int -> Maybe Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultTemplateData
      Int -> Maybe [Text] -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
replyToAddresses
      Int -> Maybe Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
returnPath
      Int -> Maybe Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
returnPathArn
      Int -> Maybe Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceArn
      Int -> Maybe Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateArn
      Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
source
      Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
template
      Int -> [BulkEmailDestination] -> Int
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
$sel:configurationSetName:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:defaultTags:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [MessageTag]
$sel:defaultTemplateData:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:replyToAddresses:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [Text]
$sel:returnPath:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:returnPathArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:sourceArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:templateArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:source:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Text
$sel:template:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Text
$sel:destinations:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> [BulkEmailDestination]
configurationSetName :: Maybe Text
defaultTags :: Maybe [MessageTag]
defaultTemplateData :: Maybe Text
replyToAddresses :: Maybe [Text]
returnPath :: Maybe Text
returnPathArn :: Maybe Text
sourceArn :: Maybe Text
templateArn :: Maybe Text
source :: Text
template :: Text
destinations :: [BulkEmailDestination]
..} =
    Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configurationSetName
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe [MessageTag] -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe [MessageTag]
defaultTags
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultTemplateData
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe [Text] -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
replyToAddresses
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
returnPath
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
returnPathArn
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceArn
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateArn
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
source
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
template
      () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` [BulkEmailDestination] -> ()
forall a. NFData a => a -> ()
Prelude.rnf [BulkEmailDestination]
destinations

instance Data.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 Data.ToPath SendBulkTemplatedEmail where
  toPath :: SendBulkTemplatedEmail -> ByteString
toPath = ByteString -> SendBulkTemplatedEmail -> ByteString
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
$sel:configurationSetName:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:defaultTags:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [MessageTag]
$sel:defaultTemplateData:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:replyToAddresses:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe [Text]
$sel:returnPath:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:returnPathArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:sourceArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:templateArn:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Maybe Text
$sel:source:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Text
$sel:template:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> Text
$sel:destinations:SendBulkTemplatedEmail' :: SendBulkTemplatedEmail -> [BulkEmailDestination]
configurationSetName :: Maybe Text
defaultTags :: Maybe [MessageTag]
defaultTemplateData :: Maybe Text
replyToAddresses :: Maybe [Text]
returnPath :: Maybe Text
returnPathArn :: Maybe Text
sourceArn :: Maybe Text
templateArn :: Maybe Text
source :: Text
template :: Text
destinations :: [BulkEmailDestination]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"SendBulkTemplatedEmail" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"ConfigurationSetName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
configurationSetName,
        ByteString
"DefaultTags"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Data.toQuery
            (ByteString -> [MessageTag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" ([MessageTag] -> QueryString)
-> Maybe [MessageTag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MessageTag]
defaultTags),
        ByteString
"DefaultTemplateData" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
defaultTemplateData,
        ByteString
"ReplyToAddresses"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
replyToAddresses
            ),
        ByteString
"ReturnPath" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
returnPath,
        ByteString
"ReturnPathArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
returnPathArn,
        ByteString
"SourceArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
sourceArn,
        ByteString
"TemplateArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
templateArn,
        ByteString
"Source" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
source,
        ByteString
"Template" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
template,
        ByteString
"Destinations"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ByteString -> [BulkEmailDestination] -> QueryString
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
(SendBulkTemplatedEmailResponse
 -> SendBulkTemplatedEmailResponse -> Bool)
-> (SendBulkTemplatedEmailResponse
    -> SendBulkTemplatedEmailResponse -> Bool)
-> Eq SendBulkTemplatedEmailResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SendBulkTemplatedEmailResponse
-> SendBulkTemplatedEmailResponse -> Bool
== :: SendBulkTemplatedEmailResponse
-> SendBulkTemplatedEmailResponse -> Bool
$c/= :: SendBulkTemplatedEmailResponse
-> SendBulkTemplatedEmailResponse -> Bool
/= :: 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
$creadsPrec :: Int -> ReadS SendBulkTemplatedEmailResponse
readsPrec :: Int -> ReadS SendBulkTemplatedEmailResponse
$creadList :: ReadS [SendBulkTemplatedEmailResponse]
readList :: ReadS [SendBulkTemplatedEmailResponse]
$creadPrec :: ReadPrec SendBulkTemplatedEmailResponse
readPrec :: ReadPrec SendBulkTemplatedEmailResponse
$creadListPrec :: ReadPrec [SendBulkTemplatedEmailResponse]
readListPrec :: ReadPrec [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
$cshowsPrec :: Int -> SendBulkTemplatedEmailResponse -> ShowS
showsPrec :: Int -> SendBulkTemplatedEmailResponse -> ShowS
$cshow :: SendBulkTemplatedEmailResponse -> String
show :: SendBulkTemplatedEmailResponse -> String
$cshowList :: [SendBulkTemplatedEmailResponse] -> ShowS
showList :: [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
$cfrom :: forall x.
SendBulkTemplatedEmailResponse
-> Rep SendBulkTemplatedEmailResponse x
from :: forall x.
SendBulkTemplatedEmailResponse
-> Rep SendBulkTemplatedEmailResponse x
$cto :: forall x.
Rep SendBulkTemplatedEmailResponse x
-> SendBulkTemplatedEmailResponse
to :: forall x.
Rep SendBulkTemplatedEmailResponse x
-> SendBulkTemplatedEmailResponse
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 = [BulkEmailDestinationStatus]
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 = (SendBulkTemplatedEmailResponse -> Int)
-> (SendBulkTemplatedEmailResponse
    -> Int -> SendBulkTemplatedEmailResponse)
-> Lens' SendBulkTemplatedEmailResponse Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkTemplatedEmailResponse' {Int
$sel:httpStatus:SendBulkTemplatedEmailResponse' :: SendBulkTemplatedEmailResponse -> Int
httpStatus :: Int
httpStatus} -> Int
httpStatus) (\s :: SendBulkTemplatedEmailResponse
s@SendBulkTemplatedEmailResponse' {} Int
a -> SendBulkTemplatedEmailResponse
s {httpStatus = a} :: SendBulkTemplatedEmailResponse)

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

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