aws-sdk-pinpointemail 1.111.0

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

/// <p>Represents the body of the email message.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Body {
    /// <p>An object that represents the version of the message that is displayed in email clients that don't support HTML, or clients where the recipient has disabled HTML rendering.</p>
    pub text: ::std::option::Option<crate::types::Content>,
    /// <p>An object that represents the version of the message that is displayed in email clients that support HTML. HTML messages can include formatted text, hyperlinks, images, and more.</p>
    pub html: ::std::option::Option<crate::types::Content>,
}
impl Body {
    /// <p>An object that represents the version of the message that is displayed in email clients that don't support HTML, or clients where the recipient has disabled HTML rendering.</p>
    pub fn text(&self) -> ::std::option::Option<&crate::types::Content> {
        self.text.as_ref()
    }
    /// <p>An object that represents the version of the message that is displayed in email clients that support HTML. HTML messages can include formatted text, hyperlinks, images, and more.</p>
    pub fn html(&self) -> ::std::option::Option<&crate::types::Content> {
        self.html.as_ref()
    }
}
impl Body {
    /// Creates a new builder-style object to manufacture [`Body`](crate::types::Body).
    pub fn builder() -> crate::types::builders::BodyBuilder {
        crate::types::builders::BodyBuilder::default()
    }
}

/// A builder for [`Body`](crate::types::Body).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BodyBuilder {
    pub(crate) text: ::std::option::Option<crate::types::Content>,
    pub(crate) html: ::std::option::Option<crate::types::Content>,
}
impl BodyBuilder {
    /// <p>An object that represents the version of the message that is displayed in email clients that don't support HTML, or clients where the recipient has disabled HTML rendering.</p>
    pub fn text(mut self, input: crate::types::Content) -> Self {
        self.text = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object that represents the version of the message that is displayed in email clients that don't support HTML, or clients where the recipient has disabled HTML rendering.</p>
    pub fn set_text(mut self, input: ::std::option::Option<crate::types::Content>) -> Self {
        self.text = input;
        self
    }
    /// <p>An object that represents the version of the message that is displayed in email clients that don't support HTML, or clients where the recipient has disabled HTML rendering.</p>
    pub fn get_text(&self) -> &::std::option::Option<crate::types::Content> {
        &self.text
    }
    /// <p>An object that represents the version of the message that is displayed in email clients that support HTML. HTML messages can include formatted text, hyperlinks, images, and more.</p>
    pub fn html(mut self, input: crate::types::Content) -> Self {
        self.html = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object that represents the version of the message that is displayed in email clients that support HTML. HTML messages can include formatted text, hyperlinks, images, and more.</p>
    pub fn set_html(mut self, input: ::std::option::Option<crate::types::Content>) -> Self {
        self.html = input;
        self
    }
    /// <p>An object that represents the version of the message that is displayed in email clients that support HTML. HTML messages can include formatted text, hyperlinks, images, and more.</p>
    pub fn get_html(&self) -> &::std::option::Option<crate::types::Content> {
        &self.html
    }
    /// Consumes the builder and constructs a [`Body`](crate::types::Body).
    pub fn build(self) -> crate::types::Body {
        crate::types::Body {
            text: self.text,
            html: self.html,
        }
    }
}