aws_sdk_forecast/operation/create_dataset_group/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_dataset_group::_create_dataset_group_output::CreateDatasetGroupOutputBuilder;
3
4pub use crate::operation::create_dataset_group::_create_dataset_group_input::CreateDatasetGroupInputBuilder;
5
6impl crate::operation::create_dataset_group::builders::CreateDatasetGroupInputBuilder {
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_dataset_group::CreateDatasetGroupOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_dataset_group::CreateDatasetGroupError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_dataset_group();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateDatasetGroup`.
24///
25/// <p>Creates a dataset group, which holds a collection of related datasets. You can add datasets to the dataset group when you create the dataset group, or later by using the <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_UpdateDatasetGroup.html">UpdateDatasetGroup</a> operation.</p>
26/// <p>After creating a dataset group and adding datasets, you use the dataset group when you create a predictor. For more information, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/howitworks-datasets-groups.html">Dataset groups</a>.</p>
27/// <p>To get a list of all your datasets groups, use the <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_ListDatasetGroups.html">ListDatasetGroups</a> operation.</p><note>
28/// <p>The <code>Status</code> of a dataset group must be <code>ACTIVE</code> before you can use the dataset group to create a predictor. To get the status, use the <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_DescribeDatasetGroup.html">DescribeDatasetGroup</a> operation.</p>
29/// </note>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct CreateDatasetGroupFluentBuilder {
32 handle: ::std::sync::Arc<crate::client::Handle>,
33 inner: crate::operation::create_dataset_group::builders::CreateDatasetGroupInputBuilder,
34 config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37 crate::client::customize::internal::CustomizableSend<
38 crate::operation::create_dataset_group::CreateDatasetGroupOutput,
39 crate::operation::create_dataset_group::CreateDatasetGroupError,
40 > for CreateDatasetGroupFluentBuilder
41{
42 fn send(
43 self,
44 config_override: crate::config::Builder,
45 ) -> crate::client::customize::internal::BoxFuture<
46 crate::client::customize::internal::SendResult<
47 crate::operation::create_dataset_group::CreateDatasetGroupOutput,
48 crate::operation::create_dataset_group::CreateDatasetGroupError,
49 >,
50 > {
51 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52 }
53}
54impl CreateDatasetGroupFluentBuilder {
55 /// Creates a new `CreateDatasetGroupFluentBuilder`.
56 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57 Self {
58 handle,
59 inner: ::std::default::Default::default(),
60 config_override: ::std::option::Option::None,
61 }
62 }
63 /// Access the CreateDatasetGroup as a reference.
64 pub fn as_input(&self) -> &crate::operation::create_dataset_group::builders::CreateDatasetGroupInputBuilder {
65 &self.inner
66 }
67 /// Sends the request and returns the response.
68 ///
69 /// If an error occurs, an `SdkError` will be returned with additional details that
70 /// can be matched against.
71 ///
72 /// By default, any retryable failures will be retried twice. Retry behavior
73 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74 /// set when configuring the client.
75 pub async fn send(
76 self,
77 ) -> ::std::result::Result<
78 crate::operation::create_dataset_group::CreateDatasetGroupOutput,
79 ::aws_smithy_runtime_api::client::result::SdkError<
80 crate::operation::create_dataset_group::CreateDatasetGroupError,
81 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82 >,
83 > {
84 let input = self
85 .inner
86 .build()
87 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88 let runtime_plugins = crate::operation::create_dataset_group::CreateDatasetGroup::operation_runtime_plugins(
89 self.handle.runtime_plugins.clone(),
90 &self.handle.conf,
91 self.config_override,
92 );
93 crate::operation::create_dataset_group::CreateDatasetGroup::orchestrate(&runtime_plugins, input).await
94 }
95
96 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97 pub fn customize(
98 self,
99 ) -> crate::client::customize::CustomizableOperation<
100 crate::operation::create_dataset_group::CreateDatasetGroupOutput,
101 crate::operation::create_dataset_group::CreateDatasetGroupError,
102 Self,
103 > {
104 crate::client::customize::CustomizableOperation::new(self)
105 }
106 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107 self.set_config_override(::std::option::Option::Some(config_override.into()));
108 self
109 }
110
111 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112 self.config_override = config_override;
113 self
114 }
115 /// <p>A name for the dataset group.</p>
116 pub fn dataset_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117 self.inner = self.inner.dataset_group_name(input.into());
118 self
119 }
120 /// <p>A name for the dataset group.</p>
121 pub fn set_dataset_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.inner = self.inner.set_dataset_group_name(input);
123 self
124 }
125 /// <p>A name for the dataset group.</p>
126 pub fn get_dataset_group_name(&self) -> &::std::option::Option<::std::string::String> {
127 self.inner.get_dataset_group_name()
128 }
129 /// <p>The domain associated with the dataset group. When you add a dataset to a dataset group, this value and the value specified for the <code>Domain</code> parameter of the <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_CreateDataset.html">CreateDataset</a> operation must match.</p>
130 /// <p>The <code>Domain</code> and <code>DatasetType</code> that you choose determine the fields that must be present in training data that you import to a dataset. For example, if you choose the <code>RETAIL</code> domain and <code>TARGET_TIME_SERIES</code> as the <code>DatasetType</code>, Amazon Forecast requires that <code>item_id</code>, <code>timestamp</code>, and <code>demand</code> fields are present in your data. For more information, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/howitworks-datasets-groups.html">Dataset groups</a>.</p>
131 pub fn domain(mut self, input: crate::types::Domain) -> Self {
132 self.inner = self.inner.domain(input);
133 self
134 }
135 /// <p>The domain associated with the dataset group. When you add a dataset to a dataset group, this value and the value specified for the <code>Domain</code> parameter of the <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_CreateDataset.html">CreateDataset</a> operation must match.</p>
136 /// <p>The <code>Domain</code> and <code>DatasetType</code> that you choose determine the fields that must be present in training data that you import to a dataset. For example, if you choose the <code>RETAIL</code> domain and <code>TARGET_TIME_SERIES</code> as the <code>DatasetType</code>, Amazon Forecast requires that <code>item_id</code>, <code>timestamp</code>, and <code>demand</code> fields are present in your data. For more information, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/howitworks-datasets-groups.html">Dataset groups</a>.</p>
137 pub fn set_domain(mut self, input: ::std::option::Option<crate::types::Domain>) -> Self {
138 self.inner = self.inner.set_domain(input);
139 self
140 }
141 /// <p>The domain associated with the dataset group. When you add a dataset to a dataset group, this value and the value specified for the <code>Domain</code> parameter of the <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_CreateDataset.html">CreateDataset</a> operation must match.</p>
142 /// <p>The <code>Domain</code> and <code>DatasetType</code> that you choose determine the fields that must be present in training data that you import to a dataset. For example, if you choose the <code>RETAIL</code> domain and <code>TARGET_TIME_SERIES</code> as the <code>DatasetType</code>, Amazon Forecast requires that <code>item_id</code>, <code>timestamp</code>, and <code>demand</code> fields are present in your data. For more information, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/howitworks-datasets-groups.html">Dataset groups</a>.</p>
143 pub fn get_domain(&self) -> &::std::option::Option<crate::types::Domain> {
144 self.inner.get_domain()
145 }
146 ///
147 /// Appends an item to `DatasetArns`.
148 ///
149 /// To override the contents of this collection use [`set_dataset_arns`](Self::set_dataset_arns).
150 ///
151 /// <p>An array of Amazon Resource Names (ARNs) of the datasets that you want to include in the dataset group.</p>
152 pub fn dataset_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153 self.inner = self.inner.dataset_arns(input.into());
154 self
155 }
156 /// <p>An array of Amazon Resource Names (ARNs) of the datasets that you want to include in the dataset group.</p>
157 pub fn set_dataset_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
158 self.inner = self.inner.set_dataset_arns(input);
159 self
160 }
161 /// <p>An array of Amazon Resource Names (ARNs) of the datasets that you want to include in the dataset group.</p>
162 pub fn get_dataset_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
163 self.inner.get_dataset_arns()
164 }
165 ///
166 /// Appends an item to `Tags`.
167 ///
168 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
169 ///
170 /// <p>The optional metadata that you apply to the dataset group to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
171 /// <p>The following basic restrictions apply to tags:</p>
172 /// <ul>
173 /// <li>
174 /// <p>Maximum number of tags per resource - 50.</p></li>
175 /// <li>
176 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
177 /// <li>
178 /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
179 /// <li>
180 /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
181 /// <li>
182 /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
183 /// <li>
184 /// <p>Tag keys and values are case sensitive.</p></li>
185 /// <li>
186 /// <p>Do not use <code>aws:</code>, <code>AWS:</code>, or any upper or lowercase combination of such as a prefix for keys as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has <code>aws</code> as its prefix but the key does not, then Forecast considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of <code>aws</code> do not count against your tags per resource limit.</p></li>
187 /// </ul>
188 pub fn tags(mut self, input: crate::types::Tag) -> Self {
189 self.inner = self.inner.tags(input);
190 self
191 }
192 /// <p>The optional metadata that you apply to the dataset group to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
193 /// <p>The following basic restrictions apply to tags:</p>
194 /// <ul>
195 /// <li>
196 /// <p>Maximum number of tags per resource - 50.</p></li>
197 /// <li>
198 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
199 /// <li>
200 /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
201 /// <li>
202 /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
203 /// <li>
204 /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
205 /// <li>
206 /// <p>Tag keys and values are case sensitive.</p></li>
207 /// <li>
208 /// <p>Do not use <code>aws:</code>, <code>AWS:</code>, or any upper or lowercase combination of such as a prefix for keys as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has <code>aws</code> as its prefix but the key does not, then Forecast considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of <code>aws</code> do not count against your tags per resource limit.</p></li>
209 /// </ul>
210 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
211 self.inner = self.inner.set_tags(input);
212 self
213 }
214 /// <p>The optional metadata that you apply to the dataset group to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
215 /// <p>The following basic restrictions apply to tags:</p>
216 /// <ul>
217 /// <li>
218 /// <p>Maximum number of tags per resource - 50.</p></li>
219 /// <li>
220 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
221 /// <li>
222 /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
223 /// <li>
224 /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
225 /// <li>
226 /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
227 /// <li>
228 /// <p>Tag keys and values are case sensitive.</p></li>
229 /// <li>
230 /// <p>Do not use <code>aws:</code>, <code>AWS:</code>, or any upper or lowercase combination of such as a prefix for keys as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has <code>aws</code> as its prefix but the key does not, then Forecast considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of <code>aws</code> do not count against your tags per resource limit.</p></li>
231 /// </ul>
232 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
233 self.inner.get_tags()
234 }
235}