Skip to main content

aws_sdk_pinpoint/operation/delete_push_template/
_delete_push_template_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DeletePushTemplateInput {
6    /// <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>
7    pub template_name: ::std::option::Option<::std::string::String>,
8    /// <p>The unique identifier for the version of the message template to update, retrieve information about, or delete. To retrieve identifiers and other information for all the versions of a template, use the
9    /// <link linkend="templates-template-name-template-type-versions">Template Versions resource.</p>
10    /// <p>If specified, this value must match the identifier for an existing template version. If specified for an update operation, this value must match the identifier for the latest existing version of the template. This restriction helps ensure that race conditions don't occur.</p>
11    /// <p>If you don't specify a value for this parameter, Amazon Pinpoint does the following:</p>
12    /// <ul>
13    /// <li>
14    /// <p>For a get operation, retrieves information about the active version of the template.</p></li>
15    /// <li>
16    /// <p>For an update operation, saves the updates to (overwrites) the latest existing version of the template, if the create-new-version parameter isn't used or is set to false.</p></li>
17    /// <li>
18    /// <p>For a delete operation, deletes the template, including all versions of the template.</p></li>
19    /// </ul>
20    pub version: ::std::option::Option<::std::string::String>,
21}
22impl DeletePushTemplateInput {
23    /// <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>
24    pub fn template_name(&self) -> ::std::option::Option<&str> {
25        self.template_name.as_deref()
26    }
27    /// <p>The unique identifier for the version of the message template to update, retrieve information about, or delete. To retrieve identifiers and other information for all the versions of a template, use the
28    /// <link linkend="templates-template-name-template-type-versions">Template Versions resource.</p>
29    /// <p>If specified, this value must match the identifier for an existing template version. If specified for an update operation, this value must match the identifier for the latest existing version of the template. This restriction helps ensure that race conditions don't occur.</p>
30    /// <p>If you don't specify a value for this parameter, Amazon Pinpoint does the following:</p>
31    /// <ul>
32    /// <li>
33    /// <p>For a get operation, retrieves information about the active version of the template.</p></li>
34    /// <li>
35    /// <p>For an update operation, saves the updates to (overwrites) the latest existing version of the template, if the create-new-version parameter isn't used or is set to false.</p></li>
36    /// <li>
37    /// <p>For a delete operation, deletes the template, including all versions of the template.</p></li>
38    /// </ul>
39    pub fn version(&self) -> ::std::option::Option<&str> {
40        self.version.as_deref()
41    }
42}
43impl DeletePushTemplateInput {
44    /// Creates a new builder-style object to manufacture [`DeletePushTemplateInput`](crate::operation::delete_push_template::DeletePushTemplateInput).
45    pub fn builder() -> crate::operation::delete_push_template::builders::DeletePushTemplateInputBuilder {
46        crate::operation::delete_push_template::builders::DeletePushTemplateInputBuilder::default()
47    }
48}
49
50/// A builder for [`DeletePushTemplateInput`](crate::operation::delete_push_template::DeletePushTemplateInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct DeletePushTemplateInputBuilder {
54    pub(crate) template_name: ::std::option::Option<::std::string::String>,
55    pub(crate) version: ::std::option::Option<::std::string::String>,
56}
57impl DeletePushTemplateInputBuilder {
58    /// <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>
59    /// This field is required.
60    pub fn template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.template_name = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <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>
65    pub fn set_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.template_name = input;
67        self
68    }
69    /// <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>
70    pub fn get_template_name(&self) -> &::std::option::Option<::std::string::String> {
71        &self.template_name
72    }
73    /// <p>The unique identifier for the version of the message template to update, retrieve information about, or delete. To retrieve identifiers and other information for all the versions of a template, use the
74    /// <link linkend="templates-template-name-template-type-versions">Template Versions resource.</p>
75    /// <p>If specified, this value must match the identifier for an existing template version. If specified for an update operation, this value must match the identifier for the latest existing version of the template. This restriction helps ensure that race conditions don't occur.</p>
76    /// <p>If you don't specify a value for this parameter, Amazon Pinpoint does the following:</p>
77    /// <ul>
78    /// <li>
79    /// <p>For a get operation, retrieves information about the active version of the template.</p></li>
80    /// <li>
81    /// <p>For an update operation, saves the updates to (overwrites) the latest existing version of the template, if the create-new-version parameter isn't used or is set to false.</p></li>
82    /// <li>
83    /// <p>For a delete operation, deletes the template, including all versions of the template.</p></li>
84    /// </ul>
85    pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86        self.version = ::std::option::Option::Some(input.into());
87        self
88    }
89    /// <p>The unique identifier for the version of the message template to update, retrieve information about, or delete. To retrieve identifiers and other information for all the versions of a template, use the
90    /// <link linkend="templates-template-name-template-type-versions">Template Versions resource.</p>
91    /// <p>If specified, this value must match the identifier for an existing template version. If specified for an update operation, this value must match the identifier for the latest existing version of the template. This restriction helps ensure that race conditions don't occur.</p>
92    /// <p>If you don't specify a value for this parameter, Amazon Pinpoint does the following:</p>
93    /// <ul>
94    /// <li>
95    /// <p>For a get operation, retrieves information about the active version of the template.</p></li>
96    /// <li>
97    /// <p>For an update operation, saves the updates to (overwrites) the latest existing version of the template, if the create-new-version parameter isn't used or is set to false.</p></li>
98    /// <li>
99    /// <p>For a delete operation, deletes the template, including all versions of the template.</p></li>
100    /// </ul>
101    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.version = input;
103        self
104    }
105    /// <p>The unique identifier for the version of the message template to update, retrieve information about, or delete. To retrieve identifiers and other information for all the versions of a template, use the
106    /// <link linkend="templates-template-name-template-type-versions">Template Versions resource.</p>
107    /// <p>If specified, this value must match the identifier for an existing template version. If specified for an update operation, this value must match the identifier for the latest existing version of the template. This restriction helps ensure that race conditions don't occur.</p>
108    /// <p>If you don't specify a value for this parameter, Amazon Pinpoint does the following:</p>
109    /// <ul>
110    /// <li>
111    /// <p>For a get operation, retrieves information about the active version of the template.</p></li>
112    /// <li>
113    /// <p>For an update operation, saves the updates to (overwrites) the latest existing version of the template, if the create-new-version parameter isn't used or is set to false.</p></li>
114    /// <li>
115    /// <p>For a delete operation, deletes the template, including all versions of the template.</p></li>
116    /// </ul>
117    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
118        &self.version
119    }
120    /// Consumes the builder and constructs a [`DeletePushTemplateInput`](crate::operation::delete_push_template::DeletePushTemplateInput).
121    pub fn build(
122        self,
123    ) -> ::std::result::Result<crate::operation::delete_push_template::DeletePushTemplateInput, ::aws_smithy_types::error::operation::BuildError>
124    {
125        ::std::result::Result::Ok(crate::operation::delete_push_template::DeletePushTemplateInput {
126            template_name: self.template_name,
127            version: self.version,
128        })
129    }
130}