{-# 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.SendRawEmail
-- 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 and immediately queues it for sending.
--
-- This operation is more flexible than the @SendEmail@ API operation. When
-- you use the @SendRawEmail@ operation, you can specify the headers of the
-- message as well as its content. This flexibility is useful, for example,
-- when you want to send a multipart MIME email (such a message that
-- contains both a text and an HTML version). You can also use this
-- operation to send messages that include attachments.
--
-- The @SendRawEmail@ operation has the following requirements:
--
-- -   You can only send email from
--     <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html verified email addresses or domains>.
--     If you try to send email from an address that isn\'t verified, the
--     operation results in an \"Email address not verified\" error.
--
-- -   If your account is still in the
--     <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/request-production-access.html Amazon SES sandbox>,
--     you can only send email to other verified addresses in your account,
--     or to addresses that are associated with the
--     <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/mailbox-simulator.html Amazon SES mailbox simulator>.
--
-- -   The maximum message size, including attachments, is 10 MB.
--
-- -   Each message has to include at least one recipient address. A
--     recipient address includes any address on the To:, CC:, or BCC:
--     lines.
--
-- -   If you send a single message to more than one recipient address, and
--     one of the recipient addresses isn\'t in a valid format (that is,
--     it\'s not in the format
--     /UserName\@[SubDomain.]Domain.TopLevelDomain/), Amazon SES rejects
--     the entire message, even if the other addresses are valid.
--
-- -   Each message can include up to 50 recipient addresses across the
--     To:, CC:, or BCC: lines. If you need to send a single message to
--     more than 50 recipients, you have to split the list of recipient
--     addresses into groups of less than 50 recipients, and send separate
--     messages to each group.
--
-- -   Amazon SES allows you to specify 8-bit Content-Transfer-Encoding for
--     MIME message parts. However, if Amazon SES has to modify the
--     contents of your message (for example, if you use open and click
--     tracking), 8-bit content isn\'t preserved. For this reason, we
--     highly recommend that you encode all content that isn\'t 7-bit
--     ASCII. For more information, see
--     <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-raw.html#send-email-mime-encoding MIME Encoding>
--     in the /Amazon SES Developer Guide/.
--
-- Additionally, keep the following considerations in mind when using the
-- @SendRawEmail@ operation:
--
-- -   Although you can customize the message headers when using the
--     @SendRawEmail@ operation, Amazon SES will automatically apply its
--     own @Message-ID@ and @Date@ headers; if you passed these headers
--     when creating the message, they will be overwritten by the values
--     that Amazon SES provides.
--
-- -   If you are using sending authorization to send on behalf of another
--     user, @SendRawEmail@ enables you to specify the cross-account
--     identity for the email\'s Source, From, and Return-Path parameters
--     in one of two ways: you can pass optional parameters @SourceArn@,
--     @FromArn@, and\/or @ReturnPathArn@ to the API, or you can include
--     the following X-headers in the header of your raw email:
--
--     -   @X-SES-SOURCE-ARN@
--
--     -   @X-SES-FROM-ARN@
--
--     -   @X-SES-RETURN-PATH-ARN@
--
--     Don\'t include these X-headers in the DKIM signature. Amazon SES
--     removes these before it sends the email.
--
--     If you only specify the @SourceIdentityArn@ parameter, Amazon SES
--     sets the From and Return-Path addresses to the same identity that
--     you specified.
--
--     For more information about sending authorization, see the
--     <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Using Sending Authorization with Amazon SES>
--     in the /Amazon SES Developer Guide./
--
-- -   For every message that you send, the total number of recipients
--     (including each recipient in the To:, CC: and BCC: fields) is
--     counted against the maximum number of emails you can send in a
--     24-hour period (your /sending quota/). For more information about
--     sending quotas in Amazon SES, see
--     <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/manage-sending-limits.html Managing Your Amazon SES Sending Limits>
--     in the /Amazon SES Developer Guide./
module Amazonka.SES.SendRawEmail
  ( -- * Creating a Request
    SendRawEmail (..),
    newSendRawEmail,

    -- * Request Lenses
    sendRawEmail_configurationSetName,
    sendRawEmail_sourceArn,
    sendRawEmail_destinations,
    sendRawEmail_returnPathArn,
    sendRawEmail_source,
    sendRawEmail_fromArn,
    sendRawEmail_tags,
    sendRawEmail_rawMessage,

    -- * Destructuring the Response
    SendRawEmailResponse (..),
    newSendRawEmailResponse,

    -- * Response Lenses
    sendRawEmailResponse_httpStatus,
    sendRawEmailResponse_messageId,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SES.Types

-- | Represents a request to send a single raw email using Amazon SES. For
-- more information, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-raw.html Amazon SES Developer Guide>.
--
-- /See:/ 'newSendRawEmail' smart constructor.
data SendRawEmail = SendRawEmail'
  { -- | The name of the configuration set to use when you send an email using
    -- @SendRawEmail@.
    SendRawEmail -> 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@.
    --
    -- Instead of using this parameter, you can use the X-header
    -- @X-SES-SOURCE-ARN@ in the raw message of the email. If you use both the
    -- @SourceArn@ parameter and the corresponding X-header, Amazon SES uses
    -- the value of the @SourceArn@ parameter.
    --
    -- For information about when to use this parameter, see the description of
    -- @SendRawEmail@ in this guide, or see the
    -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>.
    SendRawEmail -> Maybe Text
sourceArn :: Prelude.Maybe Prelude.Text,
    -- | A list of destinations for the message, consisting of To:, CC:, and BCC:
    -- addresses.
    SendRawEmail -> Maybe [Text]
destinations :: 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@.
    --
    -- Instead of using this parameter, you can use the X-header
    -- @X-SES-RETURN-PATH-ARN@ in the raw message of the email. If you use both
    -- the @ReturnPathArn@ parameter and the corresponding X-header, Amazon SES
    -- uses the value of the @ReturnPathArn@ parameter.
    --
    -- For information about when to use this parameter, see the description of
    -- @SendRawEmail@ in this guide, or see the
    -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>.
    SendRawEmail -> Maybe Text
returnPathArn :: Prelude.Maybe Prelude.Text,
    -- | The identity\'s email address. If you do not provide a value for this
    -- parameter, you must specify a \"From\" address in the raw text of the
    -- message. (You can also specify both.)
    --
    -- 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?=@.
    --
    -- If you specify the @Source@ parameter and have feedback forwarding
    -- enabled, then bounces and complaints will be sent to this email address.
    -- This takes precedence over any Return-Path header that you might include
    -- in the raw text of the message.
    SendRawEmail -> Maybe Text
source :: 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 specify a particular \"From\" address in the header
    -- of the raw email.
    --
    -- Instead of using this parameter, you can use the X-header
    -- @X-SES-FROM-ARN@ in the raw message of the email. If you use both the
    -- @FromArn@ parameter and the corresponding X-header, Amazon SES uses the
    -- value of the @FromArn@ parameter.
    --
    -- For information about when to use this parameter, see the description of
    -- @SendRawEmail@ in this guide, or see the
    -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>.
    SendRawEmail -> Maybe Text
fromArn :: Prelude.Maybe Prelude.Text,
    -- | A list of tags, in the form of name\/value pairs, to apply to an email
    -- that you send using @SendRawEmail@. Tags correspond to characteristics
    -- of the email that you define, so that you can publish email sending
    -- events.
    SendRawEmail -> Maybe [MessageTag]
tags :: Prelude.Maybe [MessageTag],
    -- | The raw email message itself. The message has to meet the following
    -- criteria:
    --
    -- -   The message has to contain a header and a body, separated by a blank
    --     line.
    --
    -- -   All of the required header fields must be present in the message.
    --
    -- -   Each part of a multipart MIME message must be formatted properly.
    --
    -- -   Attachments must be of a content type that Amazon SES supports. For
    --     a list on unsupported content types, see
    --     <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/mime-types.html Unsupported Attachment Types>
    --     in the /Amazon SES Developer Guide/.
    --
    -- -   The entire message must be base64-encoded.
    --
    -- -   If any of the MIME parts in your message contain content that is
    --     outside of the 7-bit ASCII character range, we highly recommend that
    --     you encode that content. For more information, see
    --     <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-raw.html Sending Raw Email>
    --     in the /Amazon SES Developer Guide/.
    --
    -- -   Per
    --     <https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6 RFC 5321>,
    --     the maximum length of each line of text, including the \<CRLF>, must
    --     not exceed 1,000 characters.
    SendRawEmail -> RawMessage
rawMessage :: RawMessage
  }
  deriving (SendRawEmail -> SendRawEmail -> Bool
(SendRawEmail -> SendRawEmail -> Bool)
-> (SendRawEmail -> SendRawEmail -> Bool) -> Eq SendRawEmail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendRawEmail -> SendRawEmail -> Bool
$c/= :: SendRawEmail -> SendRawEmail -> Bool
== :: SendRawEmail -> SendRawEmail -> Bool
$c== :: SendRawEmail -> SendRawEmail -> Bool
Prelude.Eq, ReadPrec [SendRawEmail]
ReadPrec SendRawEmail
Int -> ReadS SendRawEmail
ReadS [SendRawEmail]
(Int -> ReadS SendRawEmail)
-> ReadS [SendRawEmail]
-> ReadPrec SendRawEmail
-> ReadPrec [SendRawEmail]
-> Read SendRawEmail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendRawEmail]
$creadListPrec :: ReadPrec [SendRawEmail]
readPrec :: ReadPrec SendRawEmail
$creadPrec :: ReadPrec SendRawEmail
readList :: ReadS [SendRawEmail]
$creadList :: ReadS [SendRawEmail]
readsPrec :: Int -> ReadS SendRawEmail
$creadsPrec :: Int -> ReadS SendRawEmail
Prelude.Read, Int -> SendRawEmail -> ShowS
[SendRawEmail] -> ShowS
SendRawEmail -> String
(Int -> SendRawEmail -> ShowS)
-> (SendRawEmail -> String)
-> ([SendRawEmail] -> ShowS)
-> Show SendRawEmail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendRawEmail] -> ShowS
$cshowList :: [SendRawEmail] -> ShowS
show :: SendRawEmail -> String
$cshow :: SendRawEmail -> String
showsPrec :: Int -> SendRawEmail -> ShowS
$cshowsPrec :: Int -> SendRawEmail -> ShowS
Prelude.Show, (forall x. SendRawEmail -> Rep SendRawEmail x)
-> (forall x. Rep SendRawEmail x -> SendRawEmail)
-> Generic SendRawEmail
forall x. Rep SendRawEmail x -> SendRawEmail
forall x. SendRawEmail -> Rep SendRawEmail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendRawEmail x -> SendRawEmail
$cfrom :: forall x. SendRawEmail -> Rep SendRawEmail x
Prelude.Generic)

-- |
-- Create a value of 'SendRawEmail' 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', 'sendRawEmail_configurationSetName' - The name of the configuration set to use when you send an email using
-- @SendRawEmail@.
--
-- 'sourceArn', 'sendRawEmail_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@.
--
-- Instead of using this parameter, you can use the X-header
-- @X-SES-SOURCE-ARN@ in the raw message of the email. If you use both the
-- @SourceArn@ parameter and the corresponding X-header, Amazon SES uses
-- the value of the @SourceArn@ parameter.
--
-- For information about when to use this parameter, see the description of
-- @SendRawEmail@ in this guide, or see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>.
--
-- 'destinations', 'sendRawEmail_destinations' - A list of destinations for the message, consisting of To:, CC:, and BCC:
-- addresses.
--
-- 'returnPathArn', 'sendRawEmail_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@.
--
-- Instead of using this parameter, you can use the X-header
-- @X-SES-RETURN-PATH-ARN@ in the raw message of the email. If you use both
-- the @ReturnPathArn@ parameter and the corresponding X-header, Amazon SES
-- uses the value of the @ReturnPathArn@ parameter.
--
-- For information about when to use this parameter, see the description of
-- @SendRawEmail@ in this guide, or see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>.
--
-- 'source', 'sendRawEmail_source' - The identity\'s email address. If you do not provide a value for this
-- parameter, you must specify a \"From\" address in the raw text of the
-- message. (You can also specify both.)
--
-- 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?=@.
--
-- If you specify the @Source@ parameter and have feedback forwarding
-- enabled, then bounces and complaints will be sent to this email address.
-- This takes precedence over any Return-Path header that you might include
-- in the raw text of the message.
--
-- 'fromArn', 'sendRawEmail_fromArn' - 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 specify a particular \"From\" address in the header
-- of the raw email.
--
-- Instead of using this parameter, you can use the X-header
-- @X-SES-FROM-ARN@ in the raw message of the email. If you use both the
-- @FromArn@ parameter and the corresponding X-header, Amazon SES uses the
-- value of the @FromArn@ parameter.
--
-- For information about when to use this parameter, see the description of
-- @SendRawEmail@ in this guide, or see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>.
--
-- 'tags', 'sendRawEmail_tags' - A list of tags, in the form of name\/value pairs, to apply to an email
-- that you send using @SendRawEmail@. Tags correspond to characteristics
-- of the email that you define, so that you can publish email sending
-- events.
--
-- 'rawMessage', 'sendRawEmail_rawMessage' - The raw email message itself. The message has to meet the following
-- criteria:
--
-- -   The message has to contain a header and a body, separated by a blank
--     line.
--
-- -   All of the required header fields must be present in the message.
--
-- -   Each part of a multipart MIME message must be formatted properly.
--
-- -   Attachments must be of a content type that Amazon SES supports. For
--     a list on unsupported content types, see
--     <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/mime-types.html Unsupported Attachment Types>
--     in the /Amazon SES Developer Guide/.
--
-- -   The entire message must be base64-encoded.
--
-- -   If any of the MIME parts in your message contain content that is
--     outside of the 7-bit ASCII character range, we highly recommend that
--     you encode that content. For more information, see
--     <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-raw.html Sending Raw Email>
--     in the /Amazon SES Developer Guide/.
--
-- -   Per
--     <https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6 RFC 5321>,
--     the maximum length of each line of text, including the \<CRLF>, must
--     not exceed 1,000 characters.
newSendRawEmail ::
  -- | 'rawMessage'
  RawMessage ->
  SendRawEmail
newSendRawEmail :: RawMessage -> SendRawEmail
newSendRawEmail RawMessage
pRawMessage_ =
  SendRawEmail' :: Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [MessageTag]
-> RawMessage
-> SendRawEmail
SendRawEmail'
    { $sel:configurationSetName:SendRawEmail' :: Maybe Text
configurationSetName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceArn:SendRawEmail' :: Maybe Text
sourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:destinations:SendRawEmail' :: Maybe [Text]
destinations = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:returnPathArn:SendRawEmail' :: Maybe Text
returnPathArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:source:SendRawEmail' :: Maybe Text
source = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fromArn:SendRawEmail' :: Maybe Text
fromArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:SendRawEmail' :: Maybe [MessageTag]
tags = Maybe [MessageTag]
forall a. Maybe a
Prelude.Nothing,
      $sel:rawMessage:SendRawEmail' :: RawMessage
rawMessage = RawMessage
pRawMessage_
    }

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

-- | 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@.
--
-- Instead of using this parameter, you can use the X-header
-- @X-SES-SOURCE-ARN@ in the raw message of the email. If you use both the
-- @SourceArn@ parameter and the corresponding X-header, Amazon SES uses
-- the value of the @SourceArn@ parameter.
--
-- For information about when to use this parameter, see the description of
-- @SendRawEmail@ in this guide, or see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>.
sendRawEmail_sourceArn :: Lens.Lens' SendRawEmail (Prelude.Maybe Prelude.Text)
sendRawEmail_sourceArn :: (Maybe Text -> f (Maybe Text)) -> SendRawEmail -> f SendRawEmail
sendRawEmail_sourceArn = (SendRawEmail -> Maybe Text)
-> (SendRawEmail -> Maybe Text -> SendRawEmail)
-> Lens SendRawEmail SendRawEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendRawEmail' {Maybe Text
sourceArn :: Maybe Text
$sel:sourceArn:SendRawEmail' :: SendRawEmail -> Maybe Text
sourceArn} -> Maybe Text
sourceArn) (\s :: SendRawEmail
s@SendRawEmail' {} Maybe Text
a -> SendRawEmail
s {$sel:sourceArn:SendRawEmail' :: Maybe Text
sourceArn = Maybe Text
a} :: SendRawEmail)

-- | A list of destinations for the message, consisting of To:, CC:, and BCC:
-- addresses.
sendRawEmail_destinations :: Lens.Lens' SendRawEmail (Prelude.Maybe [Prelude.Text])
sendRawEmail_destinations :: (Maybe [Text] -> f (Maybe [Text]))
-> SendRawEmail -> f SendRawEmail
sendRawEmail_destinations = (SendRawEmail -> Maybe [Text])
-> (SendRawEmail -> Maybe [Text] -> SendRawEmail)
-> Lens SendRawEmail SendRawEmail (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendRawEmail' {Maybe [Text]
destinations :: Maybe [Text]
$sel:destinations:SendRawEmail' :: SendRawEmail -> Maybe [Text]
destinations} -> Maybe [Text]
destinations) (\s :: SendRawEmail
s@SendRawEmail' {} Maybe [Text]
a -> SendRawEmail
s {$sel:destinations:SendRawEmail' :: Maybe [Text]
destinations = Maybe [Text]
a} :: SendRawEmail) ((Maybe [Text] -> f (Maybe [Text]))
 -> SendRawEmail -> f SendRawEmail)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SendRawEmail
-> f SendRawEmail
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

-- | 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@.
--
-- Instead of using this parameter, you can use the X-header
-- @X-SES-RETURN-PATH-ARN@ in the raw message of the email. If you use both
-- the @ReturnPathArn@ parameter and the corresponding X-header, Amazon SES
-- uses the value of the @ReturnPathArn@ parameter.
--
-- For information about when to use this parameter, see the description of
-- @SendRawEmail@ in this guide, or see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>.
sendRawEmail_returnPathArn :: Lens.Lens' SendRawEmail (Prelude.Maybe Prelude.Text)
sendRawEmail_returnPathArn :: (Maybe Text -> f (Maybe Text)) -> SendRawEmail -> f SendRawEmail
sendRawEmail_returnPathArn = (SendRawEmail -> Maybe Text)
-> (SendRawEmail -> Maybe Text -> SendRawEmail)
-> Lens SendRawEmail SendRawEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendRawEmail' {Maybe Text
returnPathArn :: Maybe Text
$sel:returnPathArn:SendRawEmail' :: SendRawEmail -> Maybe Text
returnPathArn} -> Maybe Text
returnPathArn) (\s :: SendRawEmail
s@SendRawEmail' {} Maybe Text
a -> SendRawEmail
s {$sel:returnPathArn:SendRawEmail' :: Maybe Text
returnPathArn = Maybe Text
a} :: SendRawEmail)

-- | The identity\'s email address. If you do not provide a value for this
-- parameter, you must specify a \"From\" address in the raw text of the
-- message. (You can also specify both.)
--
-- 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?=@.
--
-- If you specify the @Source@ parameter and have feedback forwarding
-- enabled, then bounces and complaints will be sent to this email address.
-- This takes precedence over any Return-Path header that you might include
-- in the raw text of the message.
sendRawEmail_source :: Lens.Lens' SendRawEmail (Prelude.Maybe Prelude.Text)
sendRawEmail_source :: (Maybe Text -> f (Maybe Text)) -> SendRawEmail -> f SendRawEmail
sendRawEmail_source = (SendRawEmail -> Maybe Text)
-> (SendRawEmail -> Maybe Text -> SendRawEmail)
-> Lens SendRawEmail SendRawEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendRawEmail' {Maybe Text
source :: Maybe Text
$sel:source:SendRawEmail' :: SendRawEmail -> Maybe Text
source} -> Maybe Text
source) (\s :: SendRawEmail
s@SendRawEmail' {} Maybe Text
a -> SendRawEmail
s {$sel:source:SendRawEmail' :: Maybe Text
source = Maybe Text
a} :: SendRawEmail)

-- | 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 specify a particular \"From\" address in the header
-- of the raw email.
--
-- Instead of using this parameter, you can use the X-header
-- @X-SES-FROM-ARN@ in the raw message of the email. If you use both the
-- @FromArn@ parameter and the corresponding X-header, Amazon SES uses the
-- value of the @FromArn@ parameter.
--
-- For information about when to use this parameter, see the description of
-- @SendRawEmail@ in this guide, or see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-delegate-sender-tasks-email.html Amazon SES Developer Guide>.
sendRawEmail_fromArn :: Lens.Lens' SendRawEmail (Prelude.Maybe Prelude.Text)
sendRawEmail_fromArn :: (Maybe Text -> f (Maybe Text)) -> SendRawEmail -> f SendRawEmail
sendRawEmail_fromArn = (SendRawEmail -> Maybe Text)
-> (SendRawEmail -> Maybe Text -> SendRawEmail)
-> Lens SendRawEmail SendRawEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendRawEmail' {Maybe Text
fromArn :: Maybe Text
$sel:fromArn:SendRawEmail' :: SendRawEmail -> Maybe Text
fromArn} -> Maybe Text
fromArn) (\s :: SendRawEmail
s@SendRawEmail' {} Maybe Text
a -> SendRawEmail
s {$sel:fromArn:SendRawEmail' :: Maybe Text
fromArn = Maybe Text
a} :: SendRawEmail)

-- | A list of tags, in the form of name\/value pairs, to apply to an email
-- that you send using @SendRawEmail@. Tags correspond to characteristics
-- of the email that you define, so that you can publish email sending
-- events.
sendRawEmail_tags :: Lens.Lens' SendRawEmail (Prelude.Maybe [MessageTag])
sendRawEmail_tags :: (Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> SendRawEmail -> f SendRawEmail
sendRawEmail_tags = (SendRawEmail -> Maybe [MessageTag])
-> (SendRawEmail -> Maybe [MessageTag] -> SendRawEmail)
-> Lens
     SendRawEmail SendRawEmail (Maybe [MessageTag]) (Maybe [MessageTag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendRawEmail' {Maybe [MessageTag]
tags :: Maybe [MessageTag]
$sel:tags:SendRawEmail' :: SendRawEmail -> Maybe [MessageTag]
tags} -> Maybe [MessageTag]
tags) (\s :: SendRawEmail
s@SendRawEmail' {} Maybe [MessageTag]
a -> SendRawEmail
s {$sel:tags:SendRawEmail' :: Maybe [MessageTag]
tags = Maybe [MessageTag]
a} :: SendRawEmail) ((Maybe [MessageTag] -> f (Maybe [MessageTag]))
 -> SendRawEmail -> f SendRawEmail)
-> ((Maybe [MessageTag] -> f (Maybe [MessageTag]))
    -> Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> (Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> SendRawEmail
-> f SendRawEmail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [MessageTag] [MessageTag] [MessageTag] [MessageTag]
-> Iso
     (Maybe [MessageTag])
     (Maybe [MessageTag])
     (Maybe [MessageTag])
     (Maybe [MessageTag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [MessageTag] [MessageTag] [MessageTag] [MessageTag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The raw email message itself. The message has to meet the following
-- criteria:
--
-- -   The message has to contain a header and a body, separated by a blank
--     line.
--
-- -   All of the required header fields must be present in the message.
--
-- -   Each part of a multipart MIME message must be formatted properly.
--
-- -   Attachments must be of a content type that Amazon SES supports. For
--     a list on unsupported content types, see
--     <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/mime-types.html Unsupported Attachment Types>
--     in the /Amazon SES Developer Guide/.
--
-- -   The entire message must be base64-encoded.
--
-- -   If any of the MIME parts in your message contain content that is
--     outside of the 7-bit ASCII character range, we highly recommend that
--     you encode that content. For more information, see
--     <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-raw.html Sending Raw Email>
--     in the /Amazon SES Developer Guide/.
--
-- -   Per
--     <https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6 RFC 5321>,
--     the maximum length of each line of text, including the \<CRLF>, must
--     not exceed 1,000 characters.
sendRawEmail_rawMessage :: Lens.Lens' SendRawEmail RawMessage
sendRawEmail_rawMessage :: (RawMessage -> f RawMessage) -> SendRawEmail -> f SendRawEmail
sendRawEmail_rawMessage = (SendRawEmail -> RawMessage)
-> (SendRawEmail -> RawMessage -> SendRawEmail)
-> Lens SendRawEmail SendRawEmail RawMessage RawMessage
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendRawEmail' {RawMessage
rawMessage :: RawMessage
$sel:rawMessage:SendRawEmail' :: SendRawEmail -> RawMessage
rawMessage} -> RawMessage
rawMessage) (\s :: SendRawEmail
s@SendRawEmail' {} RawMessage
a -> SendRawEmail
s {$sel:rawMessage:SendRawEmail' :: RawMessage
rawMessage = RawMessage
a} :: SendRawEmail)

instance Core.AWSRequest SendRawEmail where
  type AWSResponse SendRawEmail = SendRawEmailResponse
  request :: SendRawEmail -> Request SendRawEmail
request = Service -> SendRawEmail -> Request SendRawEmail
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy SendRawEmail
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendRawEmail)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse SendRawEmail))
-> Logger
-> Service
-> Proxy SendRawEmail
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendRawEmail)))
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
"SendRawEmailResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int -> Text -> SendRawEmailResponse
SendRawEmailResponse'
            (Int -> Text -> SendRawEmailResponse)
-> Either String Int
-> Either String (Text -> SendRawEmailResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either String (Text -> SendRawEmailResponse)
-> Either String Text -> Either String SendRawEmailResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"MessageId")
      )

instance Prelude.Hashable SendRawEmail

instance Prelude.NFData SendRawEmail

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

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

instance Core.ToQuery SendRawEmail where
  toQuery :: SendRawEmail -> QueryString
toQuery SendRawEmail' {Maybe [Text]
Maybe [MessageTag]
Maybe Text
RawMessage
rawMessage :: RawMessage
tags :: Maybe [MessageTag]
fromArn :: Maybe Text
source :: Maybe Text
returnPathArn :: Maybe Text
destinations :: Maybe [Text]
sourceArn :: Maybe Text
configurationSetName :: Maybe Text
$sel:rawMessage:SendRawEmail' :: SendRawEmail -> RawMessage
$sel:tags:SendRawEmail' :: SendRawEmail -> Maybe [MessageTag]
$sel:fromArn:SendRawEmail' :: SendRawEmail -> Maybe Text
$sel:source:SendRawEmail' :: SendRawEmail -> Maybe Text
$sel:returnPathArn:SendRawEmail' :: SendRawEmail -> Maybe Text
$sel:destinations:SendRawEmail' :: SendRawEmail -> Maybe [Text]
$sel:sourceArn:SendRawEmail' :: SendRawEmail -> Maybe Text
$sel:configurationSetName:SendRawEmail' :: SendRawEmail -> 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
"SendRawEmail" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        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
"Destinations"
          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]
destinations),
        ByteString
"ReturnPathArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
returnPathArn,
        ByteString
"Source" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
source,
        ByteString
"FromArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
fromArn,
        ByteString
"Tags"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [MessageTag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([MessageTag] -> QueryString)
-> Maybe [MessageTag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MessageTag]
tags),
        ByteString
"RawMessage" ByteString -> RawMessage -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: RawMessage
rawMessage
      ]

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

-- |
-- Create a value of 'SendRawEmailResponse' 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', 'sendRawEmailResponse_httpStatus' - The response's http status code.
--
-- 'messageId', 'sendRawEmailResponse_messageId' - The unique message identifier returned from the @SendRawEmail@ action.
newSendRawEmailResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'messageId'
  Prelude.Text ->
  SendRawEmailResponse
newSendRawEmailResponse :: Int -> Text -> SendRawEmailResponse
newSendRawEmailResponse Int
pHttpStatus_ Text
pMessageId_ =
  SendRawEmailResponse' :: Int -> Text -> SendRawEmailResponse
SendRawEmailResponse'
    { $sel:httpStatus:SendRawEmailResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:messageId:SendRawEmailResponse' :: Text
messageId = Text
pMessageId_
    }

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

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

instance Prelude.NFData SendRawEmailResponse