aws_sdk_cloudformation/operation/create_generated_template/
_create_generated_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 CreateGeneratedTemplateInput {
6    /// <p>An optional list of resources to be included in the generated template.</p>
7    /// <p>If no resources are specified,the template will be created without any resources. Resources can be added to the template using the <code>UpdateGeneratedTemplate</code> API action.</p>
8    pub resources: ::std::option::Option<::std::vec::Vec<crate::types::ResourceDefinition>>,
9    /// <p>The name assigned to the generated template.</p>
10    pub generated_template_name: ::std::option::Option<::std::string::String>,
11    /// <p>An optional name or ARN of a stack to use as the base stack for the generated template.</p>
12    pub stack_name: ::std::option::Option<::std::string::String>,
13    /// <p>The configuration details of the generated template, including the <code>DeletionPolicy</code> and <code>UpdateReplacePolicy</code>.</p>
14    pub template_configuration: ::std::option::Option<crate::types::TemplateConfiguration>,
15}
16impl CreateGeneratedTemplateInput {
17    /// <p>An optional list of resources to be included in the generated template.</p>
18    /// <p>If no resources are specified,the template will be created without any resources. Resources can be added to the template using the <code>UpdateGeneratedTemplate</code> API action.</p>
19    ///
20    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resources.is_none()`.
21    pub fn resources(&self) -> &[crate::types::ResourceDefinition] {
22        self.resources.as_deref().unwrap_or_default()
23    }
24    /// <p>The name assigned to the generated template.</p>
25    pub fn generated_template_name(&self) -> ::std::option::Option<&str> {
26        self.generated_template_name.as_deref()
27    }
28    /// <p>An optional name or ARN of a stack to use as the base stack for the generated template.</p>
29    pub fn stack_name(&self) -> ::std::option::Option<&str> {
30        self.stack_name.as_deref()
31    }
32    /// <p>The configuration details of the generated template, including the <code>DeletionPolicy</code> and <code>UpdateReplacePolicy</code>.</p>
33    pub fn template_configuration(&self) -> ::std::option::Option<&crate::types::TemplateConfiguration> {
34        self.template_configuration.as_ref()
35    }
36}
37impl CreateGeneratedTemplateInput {
38    /// Creates a new builder-style object to manufacture [`CreateGeneratedTemplateInput`](crate::operation::create_generated_template::CreateGeneratedTemplateInput).
39    pub fn builder() -> crate::operation::create_generated_template::builders::CreateGeneratedTemplateInputBuilder {
40        crate::operation::create_generated_template::builders::CreateGeneratedTemplateInputBuilder::default()
41    }
42}
43
44/// A builder for [`CreateGeneratedTemplateInput`](crate::operation::create_generated_template::CreateGeneratedTemplateInput).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct CreateGeneratedTemplateInputBuilder {
48    pub(crate) resources: ::std::option::Option<::std::vec::Vec<crate::types::ResourceDefinition>>,
49    pub(crate) generated_template_name: ::std::option::Option<::std::string::String>,
50    pub(crate) stack_name: ::std::option::Option<::std::string::String>,
51    pub(crate) template_configuration: ::std::option::Option<crate::types::TemplateConfiguration>,
52}
53impl CreateGeneratedTemplateInputBuilder {
54    /// Appends an item to `resources`.
55    ///
56    /// To override the contents of this collection use [`set_resources`](Self::set_resources).
57    ///
58    /// <p>An optional list of resources to be included in the generated template.</p>
59    /// <p>If no resources are specified,the template will be created without any resources. Resources can be added to the template using the <code>UpdateGeneratedTemplate</code> API action.</p>
60    pub fn resources(mut self, input: crate::types::ResourceDefinition) -> Self {
61        let mut v = self.resources.unwrap_or_default();
62        v.push(input);
63        self.resources = ::std::option::Option::Some(v);
64        self
65    }
66    /// <p>An optional list of resources to be included in the generated template.</p>
67    /// <p>If no resources are specified,the template will be created without any resources. Resources can be added to the template using the <code>UpdateGeneratedTemplate</code> API action.</p>
68    pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceDefinition>>) -> Self {
69        self.resources = input;
70        self
71    }
72    /// <p>An optional list of resources to be included in the generated template.</p>
73    /// <p>If no resources are specified,the template will be created without any resources. Resources can be added to the template using the <code>UpdateGeneratedTemplate</code> API action.</p>
74    pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceDefinition>> {
75        &self.resources
76    }
77    /// <p>The name assigned to the generated template.</p>
78    /// This field is required.
79    pub fn generated_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80        self.generated_template_name = ::std::option::Option::Some(input.into());
81        self
82    }
83    /// <p>The name assigned to the generated template.</p>
84    pub fn set_generated_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85        self.generated_template_name = input;
86        self
87    }
88    /// <p>The name assigned to the generated template.</p>
89    pub fn get_generated_template_name(&self) -> &::std::option::Option<::std::string::String> {
90        &self.generated_template_name
91    }
92    /// <p>An optional name or ARN of a stack to use as the base stack for the generated template.</p>
93    pub fn stack_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.stack_name = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>An optional name or ARN of a stack to use as the base stack for the generated template.</p>
98    pub fn set_stack_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.stack_name = input;
100        self
101    }
102    /// <p>An optional name or ARN of a stack to use as the base stack for the generated template.</p>
103    pub fn get_stack_name(&self) -> &::std::option::Option<::std::string::String> {
104        &self.stack_name
105    }
106    /// <p>The configuration details of the generated template, including the <code>DeletionPolicy</code> and <code>UpdateReplacePolicy</code>.</p>
107    pub fn template_configuration(mut self, input: crate::types::TemplateConfiguration) -> Self {
108        self.template_configuration = ::std::option::Option::Some(input);
109        self
110    }
111    /// <p>The configuration details of the generated template, including the <code>DeletionPolicy</code> and <code>UpdateReplacePolicy</code>.</p>
112    pub fn set_template_configuration(mut self, input: ::std::option::Option<crate::types::TemplateConfiguration>) -> Self {
113        self.template_configuration = input;
114        self
115    }
116    /// <p>The configuration details of the generated template, including the <code>DeletionPolicy</code> and <code>UpdateReplacePolicy</code>.</p>
117    pub fn get_template_configuration(&self) -> &::std::option::Option<crate::types::TemplateConfiguration> {
118        &self.template_configuration
119    }
120    /// Consumes the builder and constructs a [`CreateGeneratedTemplateInput`](crate::operation::create_generated_template::CreateGeneratedTemplateInput).
121    pub fn build(
122        self,
123    ) -> ::std::result::Result<
124        crate::operation::create_generated_template::CreateGeneratedTemplateInput,
125        ::aws_smithy_types::error::operation::BuildError,
126    > {
127        ::std::result::Result::Ok(crate::operation::create_generated_template::CreateGeneratedTemplateInput {
128            resources: self.resources,
129            generated_template_name: self.generated_template_name,
130            stack_name: self.stack_name,
131            template_configuration: self.template_configuration,
132        })
133    }
134}