aws-sdk-pinpoint 1.55.0

AWS SDK for Amazon Pinpoint
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateEmailTemplateInput {
    /// <p>Specifies the content and settings for a message template that can be used in messages that are sent through the email channel.</p>
    pub email_template_request: ::std::option::Option<crate::types::EmailTemplateRequest>,
    /// <p>The name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.</p>
    pub template_name: ::std::option::Option<::std::string::String>,
}
impl CreateEmailTemplateInput {
    /// <p>Specifies the content and settings for a message template that can be used in messages that are sent through the email channel.</p>
    pub fn email_template_request(&self) -> ::std::option::Option<&crate::types::EmailTemplateRequest> {
        self.email_template_request.as_ref()
    }
    /// <p>The name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.</p>
    pub fn template_name(&self) -> ::std::option::Option<&str> {
        self.template_name.as_deref()
    }
}
impl CreateEmailTemplateInput {
    /// Creates a new builder-style object to manufacture [`CreateEmailTemplateInput`](crate::operation::create_email_template::CreateEmailTemplateInput).
    pub fn builder() -> crate::operation::create_email_template::builders::CreateEmailTemplateInputBuilder {
        crate::operation::create_email_template::builders::CreateEmailTemplateInputBuilder::default()
    }
}

/// A builder for [`CreateEmailTemplateInput`](crate::operation::create_email_template::CreateEmailTemplateInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateEmailTemplateInputBuilder {
    pub(crate) email_template_request: ::std::option::Option<crate::types::EmailTemplateRequest>,
    pub(crate) template_name: ::std::option::Option<::std::string::String>,
}
impl CreateEmailTemplateInputBuilder {
    /// <p>Specifies the content and settings for a message template that can be used in messages that are sent through the email channel.</p>
    /// This field is required.
    pub fn email_template_request(mut self, input: crate::types::EmailTemplateRequest) -> Self {
        self.email_template_request = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies the content and settings for a message template that can be used in messages that are sent through the email channel.</p>
    pub fn set_email_template_request(mut self, input: ::std::option::Option<crate::types::EmailTemplateRequest>) -> Self {
        self.email_template_request = input;
        self
    }
    /// <p>Specifies the content and settings for a message template that can be used in messages that are sent through the email channel.</p>
    pub fn get_email_template_request(&self) -> &::std::option::Option<crate::types::EmailTemplateRequest> {
        &self.email_template_request
    }
    /// <p>The name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.</p>
    /// This field is required.
    pub fn template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.template_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.</p>
    pub fn set_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.template_name = input;
        self
    }
    /// <p>The name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.</p>
    pub fn get_template_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.template_name
    }
    /// Consumes the builder and constructs a [`CreateEmailTemplateInput`](crate::operation::create_email_template::CreateEmailTemplateInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_email_template::CreateEmailTemplateInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_email_template::CreateEmailTemplateInput {
            email_template_request: self.email_template_request,
            template_name: self.template_name,
        })
    }
}