{-# 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.SendBounce
-- 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)
--
-- Generates and sends a bounce message to the sender of an email you
-- received through Amazon SES. You can only use this API on an email up to
-- 24 hours after you receive it.
--
-- You cannot use this API to send generic bounces for mail that was not
-- received by Amazon SES.
--
-- For information about receiving email through Amazon SES, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email.html Amazon SES Developer Guide>.
--
-- You can execute this operation no more than once per second.
module Amazonka.SES.SendBounce
  ( -- * Creating a Request
    SendBounce (..),
    newSendBounce,

    -- * Request Lenses
    sendBounce_messageDsn,
    sendBounce_explanation,
    sendBounce_bounceSenderArn,
    sendBounce_originalMessageId,
    sendBounce_bounceSender,
    sendBounce_bouncedRecipientInfoList,

    -- * Destructuring the Response
    SendBounceResponse (..),
    newSendBounceResponse,

    -- * Response Lenses
    sendBounceResponse_messageId,
    sendBounceResponse_httpStatus,
  )
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 bounce message to the sender of an email
-- you received through Amazon SES.
--
-- /See:/ 'newSendBounce' smart constructor.
data SendBounce = SendBounce'
  { -- | Message-related DSN fields. If not specified, Amazon SES will choose the
    -- values.
    SendBounce -> Maybe MessageDsn
messageDsn :: Prelude.Maybe MessageDsn,
    -- | Human-readable text for the bounce message to explain the failure. If
    -- not specified, the text will be auto-generated based on the bounced
    -- recipient information.
    SendBounce -> Maybe Text
explanation :: 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 address in the \"From\" header of the
    -- bounce. For more information about sending authorization, see the
    -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
    SendBounce -> Maybe Text
bounceSenderArn :: Prelude.Maybe Prelude.Text,
    -- | The message ID of the message to be bounced.
    SendBounce -> Text
originalMessageId :: Prelude.Text,
    -- | The address to use in the \"From\" header of the bounce message. This
    -- must be an identity that you have verified with Amazon SES.
    SendBounce -> Text
bounceSender :: Prelude.Text,
    -- | A list of recipients of the bounced message, including the information
    -- required to create the Delivery Status Notifications (DSNs) for the
    -- recipients. You must specify at least one @BouncedRecipientInfo@ in the
    -- list.
    SendBounce -> [BouncedRecipientInfo]
bouncedRecipientInfoList :: [BouncedRecipientInfo]
  }
  deriving (SendBounce -> SendBounce -> Bool
(SendBounce -> SendBounce -> Bool)
-> (SendBounce -> SendBounce -> Bool) -> Eq SendBounce
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendBounce -> SendBounce -> Bool
$c/= :: SendBounce -> SendBounce -> Bool
== :: SendBounce -> SendBounce -> Bool
$c== :: SendBounce -> SendBounce -> Bool
Prelude.Eq, ReadPrec [SendBounce]
ReadPrec SendBounce
Int -> ReadS SendBounce
ReadS [SendBounce]
(Int -> ReadS SendBounce)
-> ReadS [SendBounce]
-> ReadPrec SendBounce
-> ReadPrec [SendBounce]
-> Read SendBounce
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendBounce]
$creadListPrec :: ReadPrec [SendBounce]
readPrec :: ReadPrec SendBounce
$creadPrec :: ReadPrec SendBounce
readList :: ReadS [SendBounce]
$creadList :: ReadS [SendBounce]
readsPrec :: Int -> ReadS SendBounce
$creadsPrec :: Int -> ReadS SendBounce
Prelude.Read, Int -> SendBounce -> ShowS
[SendBounce] -> ShowS
SendBounce -> String
(Int -> SendBounce -> ShowS)
-> (SendBounce -> String)
-> ([SendBounce] -> ShowS)
-> Show SendBounce
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendBounce] -> ShowS
$cshowList :: [SendBounce] -> ShowS
show :: SendBounce -> String
$cshow :: SendBounce -> String
showsPrec :: Int -> SendBounce -> ShowS
$cshowsPrec :: Int -> SendBounce -> ShowS
Prelude.Show, (forall x. SendBounce -> Rep SendBounce x)
-> (forall x. Rep SendBounce x -> SendBounce) -> Generic SendBounce
forall x. Rep SendBounce x -> SendBounce
forall x. SendBounce -> Rep SendBounce x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendBounce x -> SendBounce
$cfrom :: forall x. SendBounce -> Rep SendBounce x
Prelude.Generic)

-- |
-- Create a value of 'SendBounce' 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:
--
-- 'messageDsn', 'sendBounce_messageDsn' - Message-related DSN fields. If not specified, Amazon SES will choose the
-- values.
--
-- 'explanation', 'sendBounce_explanation' - Human-readable text for the bounce message to explain the failure. If
-- not specified, the text will be auto-generated based on the bounced
-- recipient information.
--
-- 'bounceSenderArn', 'sendBounce_bounceSenderArn' - 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 address in the \"From\" header of the
-- bounce. For more information about sending authorization, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
--
-- 'originalMessageId', 'sendBounce_originalMessageId' - The message ID of the message to be bounced.
--
-- 'bounceSender', 'sendBounce_bounceSender' - The address to use in the \"From\" header of the bounce message. This
-- must be an identity that you have verified with Amazon SES.
--
-- 'bouncedRecipientInfoList', 'sendBounce_bouncedRecipientInfoList' - A list of recipients of the bounced message, including the information
-- required to create the Delivery Status Notifications (DSNs) for the
-- recipients. You must specify at least one @BouncedRecipientInfo@ in the
-- list.
newSendBounce ::
  -- | 'originalMessageId'
  Prelude.Text ->
  -- | 'bounceSender'
  Prelude.Text ->
  SendBounce
newSendBounce :: Text -> Text -> SendBounce
newSendBounce Text
pOriginalMessageId_ Text
pBounceSender_ =
  SendBounce' :: Maybe MessageDsn
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> [BouncedRecipientInfo]
-> SendBounce
SendBounce'
    { $sel:messageDsn:SendBounce' :: Maybe MessageDsn
messageDsn = Maybe MessageDsn
forall a. Maybe a
Prelude.Nothing,
      $sel:explanation:SendBounce' :: Maybe Text
explanation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bounceSenderArn:SendBounce' :: Maybe Text
bounceSenderArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:originalMessageId:SendBounce' :: Text
originalMessageId = Text
pOriginalMessageId_,
      $sel:bounceSender:SendBounce' :: Text
bounceSender = Text
pBounceSender_,
      $sel:bouncedRecipientInfoList:SendBounce' :: [BouncedRecipientInfo]
bouncedRecipientInfoList = [BouncedRecipientInfo]
forall a. Monoid a => a
Prelude.mempty
    }

-- | Message-related DSN fields. If not specified, Amazon SES will choose the
-- values.
sendBounce_messageDsn :: Lens.Lens' SendBounce (Prelude.Maybe MessageDsn)
sendBounce_messageDsn :: (Maybe MessageDsn -> f (Maybe MessageDsn))
-> SendBounce -> f SendBounce
sendBounce_messageDsn = (SendBounce -> Maybe MessageDsn)
-> (SendBounce -> Maybe MessageDsn -> SendBounce)
-> Lens SendBounce SendBounce (Maybe MessageDsn) (Maybe MessageDsn)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBounce' {Maybe MessageDsn
messageDsn :: Maybe MessageDsn
$sel:messageDsn:SendBounce' :: SendBounce -> Maybe MessageDsn
messageDsn} -> Maybe MessageDsn
messageDsn) (\s :: SendBounce
s@SendBounce' {} Maybe MessageDsn
a -> SendBounce
s {$sel:messageDsn:SendBounce' :: Maybe MessageDsn
messageDsn = Maybe MessageDsn
a} :: SendBounce)

-- | Human-readable text for the bounce message to explain the failure. If
-- not specified, the text will be auto-generated based on the bounced
-- recipient information.
sendBounce_explanation :: Lens.Lens' SendBounce (Prelude.Maybe Prelude.Text)
sendBounce_explanation :: (Maybe Text -> f (Maybe Text)) -> SendBounce -> f SendBounce
sendBounce_explanation = (SendBounce -> Maybe Text)
-> (SendBounce -> Maybe Text -> SendBounce)
-> Lens SendBounce SendBounce (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBounce' {Maybe Text
explanation :: Maybe Text
$sel:explanation:SendBounce' :: SendBounce -> Maybe Text
explanation} -> Maybe Text
explanation) (\s :: SendBounce
s@SendBounce' {} Maybe Text
a -> SendBounce
s {$sel:explanation:SendBounce' :: Maybe Text
explanation = Maybe Text
a} :: SendBounce)

-- | 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 address in the \"From\" header of the
-- bounce. For more information about sending authorization, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html Amazon SES Developer Guide>.
sendBounce_bounceSenderArn :: Lens.Lens' SendBounce (Prelude.Maybe Prelude.Text)
sendBounce_bounceSenderArn :: (Maybe Text -> f (Maybe Text)) -> SendBounce -> f SendBounce
sendBounce_bounceSenderArn = (SendBounce -> Maybe Text)
-> (SendBounce -> Maybe Text -> SendBounce)
-> Lens SendBounce SendBounce (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBounce' {Maybe Text
bounceSenderArn :: Maybe Text
$sel:bounceSenderArn:SendBounce' :: SendBounce -> Maybe Text
bounceSenderArn} -> Maybe Text
bounceSenderArn) (\s :: SendBounce
s@SendBounce' {} Maybe Text
a -> SendBounce
s {$sel:bounceSenderArn:SendBounce' :: Maybe Text
bounceSenderArn = Maybe Text
a} :: SendBounce)

-- | The message ID of the message to be bounced.
sendBounce_originalMessageId :: Lens.Lens' SendBounce Prelude.Text
sendBounce_originalMessageId :: (Text -> f Text) -> SendBounce -> f SendBounce
sendBounce_originalMessageId = (SendBounce -> Text)
-> (SendBounce -> Text -> SendBounce)
-> Lens SendBounce SendBounce Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBounce' {Text
originalMessageId :: Text
$sel:originalMessageId:SendBounce' :: SendBounce -> Text
originalMessageId} -> Text
originalMessageId) (\s :: SendBounce
s@SendBounce' {} Text
a -> SendBounce
s {$sel:originalMessageId:SendBounce' :: Text
originalMessageId = Text
a} :: SendBounce)

-- | The address to use in the \"From\" header of the bounce message. This
-- must be an identity that you have verified with Amazon SES.
sendBounce_bounceSender :: Lens.Lens' SendBounce Prelude.Text
sendBounce_bounceSender :: (Text -> f Text) -> SendBounce -> f SendBounce
sendBounce_bounceSender = (SendBounce -> Text)
-> (SendBounce -> Text -> SendBounce)
-> Lens SendBounce SendBounce Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBounce' {Text
bounceSender :: Text
$sel:bounceSender:SendBounce' :: SendBounce -> Text
bounceSender} -> Text
bounceSender) (\s :: SendBounce
s@SendBounce' {} Text
a -> SendBounce
s {$sel:bounceSender:SendBounce' :: Text
bounceSender = Text
a} :: SendBounce)

-- | A list of recipients of the bounced message, including the information
-- required to create the Delivery Status Notifications (DSNs) for the
-- recipients. You must specify at least one @BouncedRecipientInfo@ in the
-- list.
sendBounce_bouncedRecipientInfoList :: Lens.Lens' SendBounce [BouncedRecipientInfo]
sendBounce_bouncedRecipientInfoList :: ([BouncedRecipientInfo] -> f [BouncedRecipientInfo])
-> SendBounce -> f SendBounce
sendBounce_bouncedRecipientInfoList = (SendBounce -> [BouncedRecipientInfo])
-> (SendBounce -> [BouncedRecipientInfo] -> SendBounce)
-> Lens
     SendBounce SendBounce [BouncedRecipientInfo] [BouncedRecipientInfo]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBounce' {[BouncedRecipientInfo]
bouncedRecipientInfoList :: [BouncedRecipientInfo]
$sel:bouncedRecipientInfoList:SendBounce' :: SendBounce -> [BouncedRecipientInfo]
bouncedRecipientInfoList} -> [BouncedRecipientInfo]
bouncedRecipientInfoList) (\s :: SendBounce
s@SendBounce' {} [BouncedRecipientInfo]
a -> SendBounce
s {$sel:bouncedRecipientInfoList:SendBounce' :: [BouncedRecipientInfo]
bouncedRecipientInfoList = [BouncedRecipientInfo]
a} :: SendBounce) (([BouncedRecipientInfo] -> f [BouncedRecipientInfo])
 -> SendBounce -> f SendBounce)
-> (([BouncedRecipientInfo] -> f [BouncedRecipientInfo])
    -> [BouncedRecipientInfo] -> f [BouncedRecipientInfo])
-> ([BouncedRecipientInfo] -> f [BouncedRecipientInfo])
-> SendBounce
-> f SendBounce
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BouncedRecipientInfo] -> f [BouncedRecipientInfo])
-> [BouncedRecipientInfo] -> f [BouncedRecipientInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable SendBounce

instance Prelude.NFData SendBounce

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

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

instance Core.ToQuery SendBounce where
  toQuery :: SendBounce -> QueryString
toQuery SendBounce' {[BouncedRecipientInfo]
Maybe Text
Maybe MessageDsn
Text
bouncedRecipientInfoList :: [BouncedRecipientInfo]
bounceSender :: Text
originalMessageId :: Text
bounceSenderArn :: Maybe Text
explanation :: Maybe Text
messageDsn :: Maybe MessageDsn
$sel:bouncedRecipientInfoList:SendBounce' :: SendBounce -> [BouncedRecipientInfo]
$sel:bounceSender:SendBounce' :: SendBounce -> Text
$sel:originalMessageId:SendBounce' :: SendBounce -> Text
$sel:bounceSenderArn:SendBounce' :: SendBounce -> Maybe Text
$sel:explanation:SendBounce' :: SendBounce -> Maybe Text
$sel:messageDsn:SendBounce' :: SendBounce -> Maybe MessageDsn
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"SendBounce" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"MessageDsn" ByteString -> Maybe MessageDsn -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe MessageDsn
messageDsn,
        ByteString
"Explanation" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
explanation,
        ByteString
"BounceSenderArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
bounceSenderArn,
        ByteString
"OriginalMessageId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
originalMessageId,
        ByteString
"BounceSender" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
bounceSender,
        ByteString
"BouncedRecipientInfoList"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [BouncedRecipientInfo] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [BouncedRecipientInfo]
bouncedRecipientInfoList
      ]

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

-- |
-- Create a value of 'SendBounceResponse' 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:
--
-- 'messageId', 'sendBounceResponse_messageId' - The message ID of the bounce message.
--
-- 'httpStatus', 'sendBounceResponse_httpStatus' - The response's http status code.
newSendBounceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SendBounceResponse
newSendBounceResponse :: Int -> SendBounceResponse
newSendBounceResponse Int
pHttpStatus_ =
  SendBounceResponse' :: Maybe Text -> Int -> SendBounceResponse
SendBounceResponse'
    { $sel:messageId:SendBounceResponse' :: Maybe Text
messageId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SendBounceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The message ID of the bounce message.
sendBounceResponse_messageId :: Lens.Lens' SendBounceResponse (Prelude.Maybe Prelude.Text)
sendBounceResponse_messageId :: (Maybe Text -> f (Maybe Text))
-> SendBounceResponse -> f SendBounceResponse
sendBounceResponse_messageId = (SendBounceResponse -> Maybe Text)
-> (SendBounceResponse -> Maybe Text -> SendBounceResponse)
-> Lens
     SendBounceResponse SendBounceResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBounceResponse' {Maybe Text
messageId :: Maybe Text
$sel:messageId:SendBounceResponse' :: SendBounceResponse -> Maybe Text
messageId} -> Maybe Text
messageId) (\s :: SendBounceResponse
s@SendBounceResponse' {} Maybe Text
a -> SendBounceResponse
s {$sel:messageId:SendBounceResponse' :: Maybe Text
messageId = Maybe Text
a} :: SendBounceResponse)

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

instance Prelude.NFData SendBounceResponse