aws_sdk_quicksight/operation/create_template/
_create_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 CreateTemplateInput {
6    /// <p>The ID for the Amazon Web Services account that the group is in. You use the ID for the Amazon Web Services account that contains your Amazon QuickSight account.</p>
7    pub aws_account_id: ::std::option::Option<::std::string::String>,
8    /// <p>An ID for the template that you want to create. This template is unique per Amazon Web Services Region; in each Amazon Web Services account.</p>
9    pub template_id: ::std::option::Option<::std::string::String>,
10    /// <p>A display name for the template.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>A list of resource permissions to be set on the template.</p>
13    pub permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
14    /// <p>The entity that you are using as a source when you create the template. In <code>SourceEntity</code>, you specify the type of object you're using as source: <code>SourceTemplate</code> for a template or <code>SourceAnalysis</code> for an analysis. Both of these require an Amazon Resource Name (ARN). For <code>SourceTemplate</code>, specify the ARN of the source template. For <code>SourceAnalysis</code>, specify the ARN of the source analysis. The <code>SourceTemplate</code> ARN can contain any Amazon Web Services account and any QuickSight-supported Amazon Web Services Region.</p>
15    /// <p>Use the <code>DataSetReferences</code> entity within <code>SourceTemplate</code> or <code>SourceAnalysis</code> to list the replacement datasets for the placeholders listed in the original. The schema in each dataset must match its placeholder.</p>
16    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
17    pub source_entity: ::std::option::Option<crate::types::TemplateSourceEntity>,
18    /// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the resource.</p>
19    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
20    /// <p>A description of the current template version being created. This API operation creates the first version of the template. Every time <code>UpdateTemplate</code> is called, a new version is created. Each version of the template maintains a description of the version in the <code>VersionDescription</code> field.</p>
21    pub version_description: ::std::option::Option<::std::string::String>,
22    /// <p>The definition of a template.</p>
23    /// <p>A definition is the data model of all features in a Dashboard, Template, or Analysis.</p>
24    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
25    pub definition: ::std::option::Option<crate::types::TemplateVersionDefinition>,
26    /// <p>TThe option to relax the validation needed to create a template with definition objects. This skips the validation step for specific errors.</p>
27    pub validation_strategy: ::std::option::Option<crate::types::ValidationStrategy>,
28}
29impl CreateTemplateInput {
30    /// <p>The ID for the Amazon Web Services account that the group is in. You use the ID for the Amazon Web Services account that contains your Amazon QuickSight account.</p>
31    pub fn aws_account_id(&self) -> ::std::option::Option<&str> {
32        self.aws_account_id.as_deref()
33    }
34    /// <p>An ID for the template that you want to create. This template is unique per Amazon Web Services Region; in each Amazon Web Services account.</p>
35    pub fn template_id(&self) -> ::std::option::Option<&str> {
36        self.template_id.as_deref()
37    }
38    /// <p>A display name for the template.</p>
39    pub fn name(&self) -> ::std::option::Option<&str> {
40        self.name.as_deref()
41    }
42    /// <p>A list of resource permissions to be set on the template.</p>
43    ///
44    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.permissions.is_none()`.
45    pub fn permissions(&self) -> &[crate::types::ResourcePermission] {
46        self.permissions.as_deref().unwrap_or_default()
47    }
48    /// <p>The entity that you are using as a source when you create the template. In <code>SourceEntity</code>, you specify the type of object you're using as source: <code>SourceTemplate</code> for a template or <code>SourceAnalysis</code> for an analysis. Both of these require an Amazon Resource Name (ARN). For <code>SourceTemplate</code>, specify the ARN of the source template. For <code>SourceAnalysis</code>, specify the ARN of the source analysis. The <code>SourceTemplate</code> ARN can contain any Amazon Web Services account and any QuickSight-supported Amazon Web Services Region.</p>
49    /// <p>Use the <code>DataSetReferences</code> entity within <code>SourceTemplate</code> or <code>SourceAnalysis</code> to list the replacement datasets for the placeholders listed in the original. The schema in each dataset must match its placeholder.</p>
50    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
51    pub fn source_entity(&self) -> ::std::option::Option<&crate::types::TemplateSourceEntity> {
52        self.source_entity.as_ref()
53    }
54    /// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the resource.</p>
55    ///
56    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
57    pub fn tags(&self) -> &[crate::types::Tag] {
58        self.tags.as_deref().unwrap_or_default()
59    }
60    /// <p>A description of the current template version being created. This API operation creates the first version of the template. Every time <code>UpdateTemplate</code> is called, a new version is created. Each version of the template maintains a description of the version in the <code>VersionDescription</code> field.</p>
61    pub fn version_description(&self) -> ::std::option::Option<&str> {
62        self.version_description.as_deref()
63    }
64    /// <p>The definition of a template.</p>
65    /// <p>A definition is the data model of all features in a Dashboard, Template, or Analysis.</p>
66    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
67    pub fn definition(&self) -> ::std::option::Option<&crate::types::TemplateVersionDefinition> {
68        self.definition.as_ref()
69    }
70    /// <p>TThe option to relax the validation needed to create a template with definition objects. This skips the validation step for specific errors.</p>
71    pub fn validation_strategy(&self) -> ::std::option::Option<&crate::types::ValidationStrategy> {
72        self.validation_strategy.as_ref()
73    }
74}
75impl CreateTemplateInput {
76    /// Creates a new builder-style object to manufacture [`CreateTemplateInput`](crate::operation::create_template::CreateTemplateInput).
77    pub fn builder() -> crate::operation::create_template::builders::CreateTemplateInputBuilder {
78        crate::operation::create_template::builders::CreateTemplateInputBuilder::default()
79    }
80}
81
82/// A builder for [`CreateTemplateInput`](crate::operation::create_template::CreateTemplateInput).
83#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
84#[non_exhaustive]
85pub struct CreateTemplateInputBuilder {
86    pub(crate) aws_account_id: ::std::option::Option<::std::string::String>,
87    pub(crate) template_id: ::std::option::Option<::std::string::String>,
88    pub(crate) name: ::std::option::Option<::std::string::String>,
89    pub(crate) permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
90    pub(crate) source_entity: ::std::option::Option<crate::types::TemplateSourceEntity>,
91    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
92    pub(crate) version_description: ::std::option::Option<::std::string::String>,
93    pub(crate) definition: ::std::option::Option<crate::types::TemplateVersionDefinition>,
94    pub(crate) validation_strategy: ::std::option::Option<crate::types::ValidationStrategy>,
95}
96impl CreateTemplateInputBuilder {
97    /// <p>The ID for the Amazon Web Services account that the group is in. You use the ID for the Amazon Web Services account that contains your Amazon QuickSight account.</p>
98    /// This field is required.
99    pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100        self.aws_account_id = ::std::option::Option::Some(input.into());
101        self
102    }
103    /// <p>The ID for the Amazon Web Services account that the group is in. You use the ID for the Amazon Web Services account that contains your Amazon QuickSight account.</p>
104    pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105        self.aws_account_id = input;
106        self
107    }
108    /// <p>The ID for the Amazon Web Services account that the group is in. You use the ID for the Amazon Web Services account that contains your Amazon QuickSight account.</p>
109    pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
110        &self.aws_account_id
111    }
112    /// <p>An ID for the template that you want to create. This template is unique per Amazon Web Services Region; in each Amazon Web Services account.</p>
113    /// This field is required.
114    pub fn template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.template_id = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>An ID for the template that you want to create. This template is unique per Amazon Web Services Region; in each Amazon Web Services account.</p>
119    pub fn set_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.template_id = input;
121        self
122    }
123    /// <p>An ID for the template that you want to create. This template is unique per Amazon Web Services Region; in each Amazon Web Services account.</p>
124    pub fn get_template_id(&self) -> &::std::option::Option<::std::string::String> {
125        &self.template_id
126    }
127    /// <p>A display name for the template.</p>
128    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.name = ::std::option::Option::Some(input.into());
130        self
131    }
132    /// <p>A display name for the template.</p>
133    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.name = input;
135        self
136    }
137    /// <p>A display name for the template.</p>
138    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
139        &self.name
140    }
141    /// Appends an item to `permissions`.
142    ///
143    /// To override the contents of this collection use [`set_permissions`](Self::set_permissions).
144    ///
145    /// <p>A list of resource permissions to be set on the template.</p>
146    pub fn permissions(mut self, input: crate::types::ResourcePermission) -> Self {
147        let mut v = self.permissions.unwrap_or_default();
148        v.push(input);
149        self.permissions = ::std::option::Option::Some(v);
150        self
151    }
152    /// <p>A list of resource permissions to be set on the template.</p>
153    pub fn set_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>) -> Self {
154        self.permissions = input;
155        self
156    }
157    /// <p>A list of resource permissions to be set on the template.</p>
158    pub fn get_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>> {
159        &self.permissions
160    }
161    /// <p>The entity that you are using as a source when you create the template. In <code>SourceEntity</code>, you specify the type of object you're using as source: <code>SourceTemplate</code> for a template or <code>SourceAnalysis</code> for an analysis. Both of these require an Amazon Resource Name (ARN). For <code>SourceTemplate</code>, specify the ARN of the source template. For <code>SourceAnalysis</code>, specify the ARN of the source analysis. The <code>SourceTemplate</code> ARN can contain any Amazon Web Services account and any QuickSight-supported Amazon Web Services Region.</p>
162    /// <p>Use the <code>DataSetReferences</code> entity within <code>SourceTemplate</code> or <code>SourceAnalysis</code> to list the replacement datasets for the placeholders listed in the original. The schema in each dataset must match its placeholder.</p>
163    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
164    pub fn source_entity(mut self, input: crate::types::TemplateSourceEntity) -> Self {
165        self.source_entity = ::std::option::Option::Some(input);
166        self
167    }
168    /// <p>The entity that you are using as a source when you create the template. In <code>SourceEntity</code>, you specify the type of object you're using as source: <code>SourceTemplate</code> for a template or <code>SourceAnalysis</code> for an analysis. Both of these require an Amazon Resource Name (ARN). For <code>SourceTemplate</code>, specify the ARN of the source template. For <code>SourceAnalysis</code>, specify the ARN of the source analysis. The <code>SourceTemplate</code> ARN can contain any Amazon Web Services account and any QuickSight-supported Amazon Web Services Region.</p>
169    /// <p>Use the <code>DataSetReferences</code> entity within <code>SourceTemplate</code> or <code>SourceAnalysis</code> to list the replacement datasets for the placeholders listed in the original. The schema in each dataset must match its placeholder.</p>
170    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
171    pub fn set_source_entity(mut self, input: ::std::option::Option<crate::types::TemplateSourceEntity>) -> Self {
172        self.source_entity = input;
173        self
174    }
175    /// <p>The entity that you are using as a source when you create the template. In <code>SourceEntity</code>, you specify the type of object you're using as source: <code>SourceTemplate</code> for a template or <code>SourceAnalysis</code> for an analysis. Both of these require an Amazon Resource Name (ARN). For <code>SourceTemplate</code>, specify the ARN of the source template. For <code>SourceAnalysis</code>, specify the ARN of the source analysis. The <code>SourceTemplate</code> ARN can contain any Amazon Web Services account and any QuickSight-supported Amazon Web Services Region.</p>
176    /// <p>Use the <code>DataSetReferences</code> entity within <code>SourceTemplate</code> or <code>SourceAnalysis</code> to list the replacement datasets for the placeholders listed in the original. The schema in each dataset must match its placeholder.</p>
177    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
178    pub fn get_source_entity(&self) -> &::std::option::Option<crate::types::TemplateSourceEntity> {
179        &self.source_entity
180    }
181    /// Appends an item to `tags`.
182    ///
183    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
184    ///
185    /// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the resource.</p>
186    pub fn tags(mut self, input: crate::types::Tag) -> Self {
187        let mut v = self.tags.unwrap_or_default();
188        v.push(input);
189        self.tags = ::std::option::Option::Some(v);
190        self
191    }
192    /// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the resource.</p>
193    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
194        self.tags = input;
195        self
196    }
197    /// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the resource.</p>
198    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
199        &self.tags
200    }
201    /// <p>A description of the current template version being created. This API operation creates the first version of the template. Every time <code>UpdateTemplate</code> is called, a new version is created. Each version of the template maintains a description of the version in the <code>VersionDescription</code> field.</p>
202    pub fn version_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
203        self.version_description = ::std::option::Option::Some(input.into());
204        self
205    }
206    /// <p>A description of the current template version being created. This API operation creates the first version of the template. Every time <code>UpdateTemplate</code> is called, a new version is created. Each version of the template maintains a description of the version in the <code>VersionDescription</code> field.</p>
207    pub fn set_version_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
208        self.version_description = input;
209        self
210    }
211    /// <p>A description of the current template version being created. This API operation creates the first version of the template. Every time <code>UpdateTemplate</code> is called, a new version is created. Each version of the template maintains a description of the version in the <code>VersionDescription</code> field.</p>
212    pub fn get_version_description(&self) -> &::std::option::Option<::std::string::String> {
213        &self.version_description
214    }
215    /// <p>The definition of a template.</p>
216    /// <p>A definition is the data model of all features in a Dashboard, Template, or Analysis.</p>
217    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
218    pub fn definition(mut self, input: crate::types::TemplateVersionDefinition) -> Self {
219        self.definition = ::std::option::Option::Some(input);
220        self
221    }
222    /// <p>The definition of a template.</p>
223    /// <p>A definition is the data model of all features in a Dashboard, Template, or Analysis.</p>
224    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
225    pub fn set_definition(mut self, input: ::std::option::Option<crate::types::TemplateVersionDefinition>) -> Self {
226        self.definition = input;
227        self
228    }
229    /// <p>The definition of a template.</p>
230    /// <p>A definition is the data model of all features in a Dashboard, Template, or Analysis.</p>
231    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
232    pub fn get_definition(&self) -> &::std::option::Option<crate::types::TemplateVersionDefinition> {
233        &self.definition
234    }
235    /// <p>TThe option to relax the validation needed to create a template with definition objects. This skips the validation step for specific errors.</p>
236    pub fn validation_strategy(mut self, input: crate::types::ValidationStrategy) -> Self {
237        self.validation_strategy = ::std::option::Option::Some(input);
238        self
239    }
240    /// <p>TThe option to relax the validation needed to create a template with definition objects. This skips the validation step for specific errors.</p>
241    pub fn set_validation_strategy(mut self, input: ::std::option::Option<crate::types::ValidationStrategy>) -> Self {
242        self.validation_strategy = input;
243        self
244    }
245    /// <p>TThe option to relax the validation needed to create a template with definition objects. This skips the validation step for specific errors.</p>
246    pub fn get_validation_strategy(&self) -> &::std::option::Option<crate::types::ValidationStrategy> {
247        &self.validation_strategy
248    }
249    /// Consumes the builder and constructs a [`CreateTemplateInput`](crate::operation::create_template::CreateTemplateInput).
250    pub fn build(
251        self,
252    ) -> ::std::result::Result<crate::operation::create_template::CreateTemplateInput, ::aws_smithy_types::error::operation::BuildError> {
253        ::std::result::Result::Ok(crate::operation::create_template::CreateTemplateInput {
254            aws_account_id: self.aws_account_id,
255            template_id: self.template_id,
256            name: self.name,
257            permissions: self.permissions,
258            source_entity: self.source_entity,
259            tags: self.tags,
260            version_description: self.version_description,
261            definition: self.definition,
262            validation_strategy: self.validation_strategy,
263        })
264    }
265}