aws_sdk_ses/operation/create_template/
_create_template_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents a request to create an email template. For more information, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-api.html">Amazon SES Developer Guide</a>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateTemplateInput {
7    /// <p>The content of the email, composed of a subject line and either an HTML part or a text-only part.</p>
8    pub template: ::std::option::Option<crate::types::Template>,
9}
10impl CreateTemplateInput {
11    /// <p>The content of the email, composed of a subject line and either an HTML part or a text-only part.</p>
12    pub fn template(&self) -> ::std::option::Option<&crate::types::Template> {
13        self.template.as_ref()
14    }
15}
16impl CreateTemplateInput {
17    /// Creates a new builder-style object to manufacture [`CreateTemplateInput`](crate::operation::create_template::CreateTemplateInput).
18    pub fn builder() -> crate::operation::create_template::builders::CreateTemplateInputBuilder {
19        crate::operation::create_template::builders::CreateTemplateInputBuilder::default()
20    }
21}
22
23/// A builder for [`CreateTemplateInput`](crate::operation::create_template::CreateTemplateInput).
24#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
25#[non_exhaustive]
26pub struct CreateTemplateInputBuilder {
27    pub(crate) template: ::std::option::Option<crate::types::Template>,
28}
29impl CreateTemplateInputBuilder {
30    /// <p>The content of the email, composed of a subject line and either an HTML part or a text-only part.</p>
31    /// This field is required.
32    pub fn template(mut self, input: crate::types::Template) -> Self {
33        self.template = ::std::option::Option::Some(input);
34        self
35    }
36    /// <p>The content of the email, composed of a subject line and either an HTML part or a text-only part.</p>
37    pub fn set_template(mut self, input: ::std::option::Option<crate::types::Template>) -> Self {
38        self.template = input;
39        self
40    }
41    /// <p>The content of the email, composed of a subject line and either an HTML part or a text-only part.</p>
42    pub fn get_template(&self) -> &::std::option::Option<crate::types::Template> {
43        &self.template
44    }
45    /// Consumes the builder and constructs a [`CreateTemplateInput`](crate::operation::create_template::CreateTemplateInput).
46    pub fn build(
47        self,
48    ) -> ::std::result::Result<crate::operation::create_template::CreateTemplateInput, ::aws_smithy_types::error::operation::BuildError> {
49        ::std::result::Result::Ok(crate::operation::create_template::CreateTemplateInput { template: self.template })
50    }
51}