aws_sdk_quicksight/operation/create_template/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_template::_create_template_output::CreateTemplateOutputBuilder;
3
4pub use crate::operation::create_template::_create_template_input::CreateTemplateInputBuilder;
5
6impl crate::operation::create_template::builders::CreateTemplateInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_template::CreateTemplateOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_template::CreateTemplateError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_template();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateTemplate`.
24///
25/// <p>Creates a template either from a <code>TemplateDefinition</code> or from an existing Amazon QuickSight analysis or template. You can use the resulting template to create additional dashboards, templates, or analyses.</p>
26/// <p>A <i>template</i> is an entity in Amazon QuickSight that encapsulates the metadata required to create an analysis and that you can use to create s dashboard. A template adds a layer of abstraction by using placeholders to replace the dataset associated with the analysis. You can use templates to create dashboards by replacing dataset placeholders with datasets that follow the same schema that was used to create the source analysis and template.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateTemplateFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::create_template::builders::CreateTemplateInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::create_template::CreateTemplateOutput,
36        crate::operation::create_template::CreateTemplateError,
37    > for CreateTemplateFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::create_template::CreateTemplateOutput,
45            crate::operation::create_template::CreateTemplateError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl CreateTemplateFluentBuilder {
52    /// Creates a new `CreateTemplateFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the CreateTemplate as a reference.
61    pub fn as_input(&self) -> &crate::operation::create_template::builders::CreateTemplateInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::create_template::CreateTemplateOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::create_template::CreateTemplateError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::create_template::CreateTemplate::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::create_template::CreateTemplate::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::create_template::CreateTemplateOutput,
98        crate::operation::create_template::CreateTemplateError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <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>
113    pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.aws_account_id(input.into());
115        self
116    }
117    /// <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>
118    pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.inner = self.inner.set_aws_account_id(input);
120        self
121    }
122    /// <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>
123    pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
124        self.inner.get_aws_account_id()
125    }
126    /// <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>
127    pub fn template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.template_id(input.into());
129        self
130    }
131    /// <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>
132    pub fn set_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_template_id(input);
134        self
135    }
136    /// <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>
137    pub fn get_template_id(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_template_id()
139    }
140    /// <p>A display name for the template.</p>
141    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.inner = self.inner.name(input.into());
143        self
144    }
145    /// <p>A display name for the template.</p>
146    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_name(input);
148        self
149    }
150    /// <p>A display name for the template.</p>
151    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
152        self.inner.get_name()
153    }
154    ///
155    /// Appends an item to `Permissions`.
156    ///
157    /// To override the contents of this collection use [`set_permissions`](Self::set_permissions).
158    ///
159    /// <p>A list of resource permissions to be set on the template.</p>
160    pub fn permissions(mut self, input: crate::types::ResourcePermission) -> Self {
161        self.inner = self.inner.permissions(input);
162        self
163    }
164    /// <p>A list of resource permissions to be set on the template.</p>
165    pub fn set_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>) -> Self {
166        self.inner = self.inner.set_permissions(input);
167        self
168    }
169    /// <p>A list of resource permissions to be set on the template.</p>
170    pub fn get_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>> {
171        self.inner.get_permissions()
172    }
173    /// <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 Amazon QuickSight-supported Amazon Web Services Region.</p>
174    /// <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>
175    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
176    pub fn source_entity(mut self, input: crate::types::TemplateSourceEntity) -> Self {
177        self.inner = self.inner.source_entity(input);
178        self
179    }
180    /// <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 Amazon QuickSight-supported Amazon Web Services Region.</p>
181    /// <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>
182    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
183    pub fn set_source_entity(mut self, input: ::std::option::Option<crate::types::TemplateSourceEntity>) -> Self {
184        self.inner = self.inner.set_source_entity(input);
185        self
186    }
187    /// <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 Amazon QuickSight-supported Amazon Web Services Region.</p>
188    /// <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>
189    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
190    pub fn get_source_entity(&self) -> &::std::option::Option<crate::types::TemplateSourceEntity> {
191        self.inner.get_source_entity()
192    }
193    ///
194    /// Appends an item to `Tags`.
195    ///
196    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
197    ///
198    /// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the resource.</p>
199    pub fn tags(mut self, input: crate::types::Tag) -> Self {
200        self.inner = self.inner.tags(input);
201        self
202    }
203    /// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the resource.</p>
204    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
205        self.inner = self.inner.set_tags(input);
206        self
207    }
208    /// <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the resource.</p>
209    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
210        self.inner.get_tags()
211    }
212    /// <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>
213    pub fn version_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214        self.inner = self.inner.version_description(input.into());
215        self
216    }
217    /// <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>
218    pub fn set_version_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
219        self.inner = self.inner.set_version_description(input);
220        self
221    }
222    /// <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>
223    pub fn get_version_description(&self) -> &::std::option::Option<::std::string::String> {
224        self.inner.get_version_description()
225    }
226    /// <p>The definition of a template.</p>
227    /// <p>A definition is the data model of all features in a Dashboard, Template, or Analysis.</p>
228    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
229    pub fn definition(mut self, input: crate::types::TemplateVersionDefinition) -> Self {
230        self.inner = self.inner.definition(input);
231        self
232    }
233    /// <p>The definition of a template.</p>
234    /// <p>A definition is the data model of all features in a Dashboard, Template, or Analysis.</p>
235    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
236    pub fn set_definition(mut self, input: ::std::option::Option<crate::types::TemplateVersionDefinition>) -> Self {
237        self.inner = self.inner.set_definition(input);
238        self
239    }
240    /// <p>The definition of a template.</p>
241    /// <p>A definition is the data model of all features in a Dashboard, Template, or Analysis.</p>
242    /// <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
243    pub fn get_definition(&self) -> &::std::option::Option<crate::types::TemplateVersionDefinition> {
244        self.inner.get_definition()
245    }
246    /// <p>TThe option to relax the validation needed to create a template with definition objects. This skips the validation step for specific errors.</p>
247    pub fn validation_strategy(mut self, input: crate::types::ValidationStrategy) -> Self {
248        self.inner = self.inner.validation_strategy(input);
249        self
250    }
251    /// <p>TThe option to relax the validation needed to create a template with definition objects. This skips the validation step for specific errors.</p>
252    pub fn set_validation_strategy(mut self, input: ::std::option::Option<crate::types::ValidationStrategy>) -> Self {
253        self.inner = self.inner.set_validation_strategy(input);
254        self
255    }
256    /// <p>TThe option to relax the validation needed to create a template with definition objects. This skips the validation step for specific errors.</p>
257    pub fn get_validation_strategy(&self) -> &::std::option::Option<crate::types::ValidationStrategy> {
258        self.inner.get_validation_strategy()
259    }
260}