aws-sdk-ses 1.96.0

AWS SDK for Amazon Simple Email Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents a request to send a bounce message to the sender of an email you received through Amazon SES.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SendBounceInput {
    /// <p>The message ID of the message to be bounced.</p>
    pub original_message_id: ::std::option::Option<::std::string::String>,
    /// <p>The address to use in the "From" header of the bounce message. This must be an identity that you have verified with Amazon SES.</p>
    pub bounce_sender: ::std::option::Option<::std::string::String>,
    /// <p>Human-readable text for the bounce message to explain the failure. If not specified, the text is auto-generated based on the bounced recipient information.</p>
    pub explanation: ::std::option::Option<::std::string::String>,
    /// <p>Message-related DSN fields. If not specified, Amazon SES chooses the values.</p>
    pub message_dsn: ::std::option::Option<crate::types::MessageDsn>,
    /// <p>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 <code>BouncedRecipientInfo</code> in the list.</p>
    pub bounced_recipient_info_list: ::std::option::Option<::std::vec::Vec<crate::types::BouncedRecipientInfo>>,
    /// <p>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 <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
    pub bounce_sender_arn: ::std::option::Option<::std::string::String>,
}
impl SendBounceInput {
    /// <p>The message ID of the message to be bounced.</p>
    pub fn original_message_id(&self) -> ::std::option::Option<&str> {
        self.original_message_id.as_deref()
    }
    /// <p>The address to use in the "From" header of the bounce message. This must be an identity that you have verified with Amazon SES.</p>
    pub fn bounce_sender(&self) -> ::std::option::Option<&str> {
        self.bounce_sender.as_deref()
    }
    /// <p>Human-readable text for the bounce message to explain the failure. If not specified, the text is auto-generated based on the bounced recipient information.</p>
    pub fn explanation(&self) -> ::std::option::Option<&str> {
        self.explanation.as_deref()
    }
    /// <p>Message-related DSN fields. If not specified, Amazon SES chooses the values.</p>
    pub fn message_dsn(&self) -> ::std::option::Option<&crate::types::MessageDsn> {
        self.message_dsn.as_ref()
    }
    /// <p>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 <code>BouncedRecipientInfo</code> in the list.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.bounced_recipient_info_list.is_none()`.
    pub fn bounced_recipient_info_list(&self) -> &[crate::types::BouncedRecipientInfo] {
        self.bounced_recipient_info_list.as_deref().unwrap_or_default()
    }
    /// <p>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 <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
    pub fn bounce_sender_arn(&self) -> ::std::option::Option<&str> {
        self.bounce_sender_arn.as_deref()
    }
}
impl SendBounceInput {
    /// Creates a new builder-style object to manufacture [`SendBounceInput`](crate::operation::send_bounce::SendBounceInput).
    pub fn builder() -> crate::operation::send_bounce::builders::SendBounceInputBuilder {
        crate::operation::send_bounce::builders::SendBounceInputBuilder::default()
    }
}

/// A builder for [`SendBounceInput`](crate::operation::send_bounce::SendBounceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SendBounceInputBuilder {
    pub(crate) original_message_id: ::std::option::Option<::std::string::String>,
    pub(crate) bounce_sender: ::std::option::Option<::std::string::String>,
    pub(crate) explanation: ::std::option::Option<::std::string::String>,
    pub(crate) message_dsn: ::std::option::Option<crate::types::MessageDsn>,
    pub(crate) bounced_recipient_info_list: ::std::option::Option<::std::vec::Vec<crate::types::BouncedRecipientInfo>>,
    pub(crate) bounce_sender_arn: ::std::option::Option<::std::string::String>,
}
impl SendBounceInputBuilder {
    /// <p>The message ID of the message to be bounced.</p>
    /// This field is required.
    pub fn original_message_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.original_message_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The message ID of the message to be bounced.</p>
    pub fn set_original_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.original_message_id = input;
        self
    }
    /// <p>The message ID of the message to be bounced.</p>
    pub fn get_original_message_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.original_message_id
    }
    /// <p>The address to use in the "From" header of the bounce message. This must be an identity that you have verified with Amazon SES.</p>
    /// This field is required.
    pub fn bounce_sender(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.bounce_sender = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The address to use in the "From" header of the bounce message. This must be an identity that you have verified with Amazon SES.</p>
    pub fn set_bounce_sender(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.bounce_sender = input;
        self
    }
    /// <p>The address to use in the "From" header of the bounce message. This must be an identity that you have verified with Amazon SES.</p>
    pub fn get_bounce_sender(&self) -> &::std::option::Option<::std::string::String> {
        &self.bounce_sender
    }
    /// <p>Human-readable text for the bounce message to explain the failure. If not specified, the text is auto-generated based on the bounced recipient information.</p>
    pub fn explanation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.explanation = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Human-readable text for the bounce message to explain the failure. If not specified, the text is auto-generated based on the bounced recipient information.</p>
    pub fn set_explanation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.explanation = input;
        self
    }
    /// <p>Human-readable text for the bounce message to explain the failure. If not specified, the text is auto-generated based on the bounced recipient information.</p>
    pub fn get_explanation(&self) -> &::std::option::Option<::std::string::String> {
        &self.explanation
    }
    /// <p>Message-related DSN fields. If not specified, Amazon SES chooses the values.</p>
    pub fn message_dsn(mut self, input: crate::types::MessageDsn) -> Self {
        self.message_dsn = ::std::option::Option::Some(input);
        self
    }
    /// <p>Message-related DSN fields. If not specified, Amazon SES chooses the values.</p>
    pub fn set_message_dsn(mut self, input: ::std::option::Option<crate::types::MessageDsn>) -> Self {
        self.message_dsn = input;
        self
    }
    /// <p>Message-related DSN fields. If not specified, Amazon SES chooses the values.</p>
    pub fn get_message_dsn(&self) -> &::std::option::Option<crate::types::MessageDsn> {
        &self.message_dsn
    }
    /// Appends an item to `bounced_recipient_info_list`.
    ///
    /// To override the contents of this collection use [`set_bounced_recipient_info_list`](Self::set_bounced_recipient_info_list).
    ///
    /// <p>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 <code>BouncedRecipientInfo</code> in the list.</p>
    pub fn bounced_recipient_info_list(mut self, input: crate::types::BouncedRecipientInfo) -> Self {
        let mut v = self.bounced_recipient_info_list.unwrap_or_default();
        v.push(input);
        self.bounced_recipient_info_list = ::std::option::Option::Some(v);
        self
    }
    /// <p>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 <code>BouncedRecipientInfo</code> in the list.</p>
    pub fn set_bounced_recipient_info_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BouncedRecipientInfo>>) -> Self {
        self.bounced_recipient_info_list = input;
        self
    }
    /// <p>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 <code>BouncedRecipientInfo</code> in the list.</p>
    pub fn get_bounced_recipient_info_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BouncedRecipientInfo>> {
        &self.bounced_recipient_info_list
    }
    /// <p>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 <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
    pub fn bounce_sender_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.bounce_sender_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>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 <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
    pub fn set_bounce_sender_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.bounce_sender_arn = input;
        self
    }
    /// <p>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 <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
    pub fn get_bounce_sender_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.bounce_sender_arn
    }
    /// Consumes the builder and constructs a [`SendBounceInput`](crate::operation::send_bounce::SendBounceInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::send_bounce::SendBounceInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::send_bounce::SendBounceInput {
            original_message_id: self.original_message_id,
            bounce_sender: self.bounce_sender,
            explanation: self.explanation,
            message_dsn: self.message_dsn,
            bounced_recipient_info_list: self.bounced_recipient_info_list,
            bounce_sender_arn: self.bounce_sender_arn,
        })
    }
}