aws_sdk_forecast/operation/create_dataset/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_dataset::_create_dataset_output::CreateDatasetOutputBuilder;
3
4pub use crate::operation::create_dataset::_create_dataset_input::CreateDatasetInputBuilder;
5
6impl crate::operation::create_dataset::builders::CreateDatasetInputBuilder {
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::CreateDatasetOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_dataset::CreateDatasetError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_dataset();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateDataset`.
24///
25/// <p>Creates an Amazon Forecast dataset. The information about the dataset that you provide helps Forecast understand how to consume the data for model training. This includes the following:</p>
26/// <ul>
27/// <li>
28/// <p><i> <code>DataFrequency</code> </i> - How frequently your historical time-series data is collected.</p></li>
29/// <li>
30/// <p><i> <code>Domain</code> </i> and <i> <code>DatasetType</code> </i> - Each dataset has an associated dataset domain and a type within the domain. Amazon Forecast provides a list of predefined domains and types within each domain. For each unique dataset domain and type within the domain, Amazon Forecast requires your data to include a minimum set of predefined fields.</p></li>
31/// <li>
32/// <p><i> <code>Schema</code> </i> - A schema specifies the fields in the dataset, including the field name and data type.</p></li>
33/// </ul>
34/// <p>After creating a dataset, you import your training data into it and add the dataset to a dataset group. You use the dataset group to create a predictor. For more information, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/howitworks-datasets-groups.html">Importing datasets</a>.</p>
35/// <p>To get a list of all your datasets, use the <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_ListDatasets.html">ListDatasets</a> operation.</p>
36/// <p>For example Forecast datasets, see the <a href="https://github.com/aws-samples/amazon-forecast-samples">Amazon Forecast Sample GitHub repository</a>.</p><note>
37/// <p>The <code>Status</code> of a dataset must be <code>ACTIVE</code> before you can import training data. Use the <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_DescribeDataset.html">DescribeDataset</a> operation to get the status.</p>
38/// </note>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct CreateDatasetFluentBuilder {
41 handle: ::std::sync::Arc<crate::client::Handle>,
42 inner: crate::operation::create_dataset::builders::CreateDatasetInputBuilder,
43 config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46 crate::client::customize::internal::CustomizableSend<
47 crate::operation::create_dataset::CreateDatasetOutput,
48 crate::operation::create_dataset::CreateDatasetError,
49 > for CreateDatasetFluentBuilder
50{
51 fn send(
52 self,
53 config_override: crate::config::Builder,
54 ) -> crate::client::customize::internal::BoxFuture<
55 crate::client::customize::internal::SendResult<
56 crate::operation::create_dataset::CreateDatasetOutput,
57 crate::operation::create_dataset::CreateDatasetError,
58 >,
59 > {
60 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61 }
62}
63impl CreateDatasetFluentBuilder {
64 /// Creates a new `CreateDatasetFluentBuilder`.
65 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66 Self {
67 handle,
68 inner: ::std::default::Default::default(),
69 config_override: ::std::option::Option::None,
70 }
71 }
72 /// Access the CreateDataset as a reference.
73 pub fn as_input(&self) -> &crate::operation::create_dataset::builders::CreateDatasetInputBuilder {
74 &self.inner
75 }
76 /// Sends the request and returns the response.
77 ///
78 /// If an error occurs, an `SdkError` will be returned with additional details that
79 /// can be matched against.
80 ///
81 /// By default, any retryable failures will be retried twice. Retry behavior
82 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83 /// set when configuring the client.
84 pub async fn send(
85 self,
86 ) -> ::std::result::Result<
87 crate::operation::create_dataset::CreateDatasetOutput,
88 ::aws_smithy_runtime_api::client::result::SdkError<
89 crate::operation::create_dataset::CreateDatasetError,
90 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
91 >,
92 > {
93 let input = self
94 .inner
95 .build()
96 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
97 let runtime_plugins = crate::operation::create_dataset::CreateDataset::operation_runtime_plugins(
98 self.handle.runtime_plugins.clone(),
99 &self.handle.conf,
100 self.config_override,
101 );
102 crate::operation::create_dataset::CreateDataset::orchestrate(&runtime_plugins, input).await
103 }
104
105 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
106 pub fn customize(
107 self,
108 ) -> crate::client::customize::CustomizableOperation<
109 crate::operation::create_dataset::CreateDatasetOutput,
110 crate::operation::create_dataset::CreateDatasetError,
111 Self,
112 > {
113 crate::client::customize::CustomizableOperation::new(self)
114 }
115 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
116 self.set_config_override(::std::option::Option::Some(config_override.into()));
117 self
118 }
119
120 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
121 self.config_override = config_override;
122 self
123 }
124 /// <p>A name for the dataset.</p>
125 pub fn dataset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126 self.inner = self.inner.dataset_name(input.into());
127 self
128 }
129 /// <p>A name for the dataset.</p>
130 pub fn set_dataset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131 self.inner = self.inner.set_dataset_name(input);
132 self
133 }
134 /// <p>A name for the dataset.</p>
135 pub fn get_dataset_name(&self) -> &::std::option::Option<::std::string::String> {
136 self.inner.get_dataset_name()
137 }
138 /// <p>The domain associated with the dataset. 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_CreateDatasetGroup.html">CreateDatasetGroup</a> operation must match.</p>
139 /// <p>The <code>Domain</code> and <code>DatasetType</code> that you choose determine the fields that must be present in the training data that you import to the 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 <code>item_id</code>, <code>timestamp</code>, and <code>demand</code> fields to be present in your data. For more information, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/howitworks-datasets-groups.html">Importing datasets</a>.</p>
140 pub fn domain(mut self, input: crate::types::Domain) -> Self {
141 self.inner = self.inner.domain(input);
142 self
143 }
144 /// <p>The domain associated with the dataset. 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_CreateDatasetGroup.html">CreateDatasetGroup</a> operation must match.</p>
145 /// <p>The <code>Domain</code> and <code>DatasetType</code> that you choose determine the fields that must be present in the training data that you import to the 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 <code>item_id</code>, <code>timestamp</code>, and <code>demand</code> fields to be present in your data. For more information, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/howitworks-datasets-groups.html">Importing datasets</a>.</p>
146 pub fn set_domain(mut self, input: ::std::option::Option<crate::types::Domain>) -> Self {
147 self.inner = self.inner.set_domain(input);
148 self
149 }
150 /// <p>The domain associated with the dataset. 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_CreateDatasetGroup.html">CreateDatasetGroup</a> operation must match.</p>
151 /// <p>The <code>Domain</code> and <code>DatasetType</code> that you choose determine the fields that must be present in the training data that you import to the 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 <code>item_id</code>, <code>timestamp</code>, and <code>demand</code> fields to be present in your data. For more information, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/howitworks-datasets-groups.html">Importing datasets</a>.</p>
152 pub fn get_domain(&self) -> &::std::option::Option<crate::types::Domain> {
153 self.inner.get_domain()
154 }
155 /// <p>The dataset type. Valid values depend on the chosen <code>Domain</code>.</p>
156 pub fn dataset_type(mut self, input: crate::types::DatasetType) -> Self {
157 self.inner = self.inner.dataset_type(input);
158 self
159 }
160 /// <p>The dataset type. Valid values depend on the chosen <code>Domain</code>.</p>
161 pub fn set_dataset_type(mut self, input: ::std::option::Option<crate::types::DatasetType>) -> Self {
162 self.inner = self.inner.set_dataset_type(input);
163 self
164 }
165 /// <p>The dataset type. Valid values depend on the chosen <code>Domain</code>.</p>
166 pub fn get_dataset_type(&self) -> &::std::option::Option<crate::types::DatasetType> {
167 self.inner.get_dataset_type()
168 }
169 /// <p>The frequency of data collection. This parameter is required for RELATED_TIME_SERIES datasets.</p>
170 /// <p>Valid intervals are an integer followed by Y (Year), M (Month), W (Week), D (Day), H (Hour), and min (Minute). For example, "1D" indicates every day and "15min" indicates every 15 minutes. You cannot specify a value that would overlap with the next larger frequency. That means, for example, you cannot specify a frequency of 60 minutes, because that is equivalent to 1 hour. The valid values for each frequency are the following:</p>
171 /// <ul>
172 /// <li>
173 /// <p>Minute - 1-59</p></li>
174 /// <li>
175 /// <p>Hour - 1-23</p></li>
176 /// <li>
177 /// <p>Day - 1-6</p></li>
178 /// <li>
179 /// <p>Week - 1-4</p></li>
180 /// <li>
181 /// <p>Month - 1-11</p></li>
182 /// <li>
183 /// <p>Year - 1</p></li>
184 /// </ul>
185 /// <p>Thus, if you want every other week forecasts, specify "2W". Or, if you want quarterly forecasts, you specify "3M".</p>
186 pub fn data_frequency(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187 self.inner = self.inner.data_frequency(input.into());
188 self
189 }
190 /// <p>The frequency of data collection. This parameter is required for RELATED_TIME_SERIES datasets.</p>
191 /// <p>Valid intervals are an integer followed by Y (Year), M (Month), W (Week), D (Day), H (Hour), and min (Minute). For example, "1D" indicates every day and "15min" indicates every 15 minutes. You cannot specify a value that would overlap with the next larger frequency. That means, for example, you cannot specify a frequency of 60 minutes, because that is equivalent to 1 hour. The valid values for each frequency are the following:</p>
192 /// <ul>
193 /// <li>
194 /// <p>Minute - 1-59</p></li>
195 /// <li>
196 /// <p>Hour - 1-23</p></li>
197 /// <li>
198 /// <p>Day - 1-6</p></li>
199 /// <li>
200 /// <p>Week - 1-4</p></li>
201 /// <li>
202 /// <p>Month - 1-11</p></li>
203 /// <li>
204 /// <p>Year - 1</p></li>
205 /// </ul>
206 /// <p>Thus, if you want every other week forecasts, specify "2W". Or, if you want quarterly forecasts, you specify "3M".</p>
207 pub fn set_data_frequency(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
208 self.inner = self.inner.set_data_frequency(input);
209 self
210 }
211 /// <p>The frequency of data collection. This parameter is required for RELATED_TIME_SERIES datasets.</p>
212 /// <p>Valid intervals are an integer followed by Y (Year), M (Month), W (Week), D (Day), H (Hour), and min (Minute). For example, "1D" indicates every day and "15min" indicates every 15 minutes. You cannot specify a value that would overlap with the next larger frequency. That means, for example, you cannot specify a frequency of 60 minutes, because that is equivalent to 1 hour. The valid values for each frequency are the following:</p>
213 /// <ul>
214 /// <li>
215 /// <p>Minute - 1-59</p></li>
216 /// <li>
217 /// <p>Hour - 1-23</p></li>
218 /// <li>
219 /// <p>Day - 1-6</p></li>
220 /// <li>
221 /// <p>Week - 1-4</p></li>
222 /// <li>
223 /// <p>Month - 1-11</p></li>
224 /// <li>
225 /// <p>Year - 1</p></li>
226 /// </ul>
227 /// <p>Thus, if you want every other week forecasts, specify "2W". Or, if you want quarterly forecasts, you specify "3M".</p>
228 pub fn get_data_frequency(&self) -> &::std::option::Option<::std::string::String> {
229 self.inner.get_data_frequency()
230 }
231 /// <p>The schema for the dataset. The schema attributes and their order must match the fields in your data. The dataset <code>Domain</code> and <code>DatasetType</code> that you choose determine the minimum required fields in your training data. For information about the required fields for a specific dataset domain and type, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/howitworks-domains-ds-types.html">Dataset Domains and Dataset Types</a>.</p>
232 pub fn schema(mut self, input: crate::types::Schema) -> Self {
233 self.inner = self.inner.schema(input);
234 self
235 }
236 /// <p>The schema for the dataset. The schema attributes and their order must match the fields in your data. The dataset <code>Domain</code> and <code>DatasetType</code> that you choose determine the minimum required fields in your training data. For information about the required fields for a specific dataset domain and type, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/howitworks-domains-ds-types.html">Dataset Domains and Dataset Types</a>.</p>
237 pub fn set_schema(mut self, input: ::std::option::Option<crate::types::Schema>) -> Self {
238 self.inner = self.inner.set_schema(input);
239 self
240 }
241 /// <p>The schema for the dataset. The schema attributes and their order must match the fields in your data. The dataset <code>Domain</code> and <code>DatasetType</code> that you choose determine the minimum required fields in your training data. For information about the required fields for a specific dataset domain and type, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/howitworks-domains-ds-types.html">Dataset Domains and Dataset Types</a>.</p>
242 pub fn get_schema(&self) -> &::std::option::Option<crate::types::Schema> {
243 self.inner.get_schema()
244 }
245 /// <p>An Key Management Service (KMS) key and the Identity and Access Management (IAM) role that Amazon Forecast can assume to access the key.</p>
246 pub fn encryption_config(mut self, input: crate::types::EncryptionConfig) -> Self {
247 self.inner = self.inner.encryption_config(input);
248 self
249 }
250 /// <p>An Key Management Service (KMS) key and the Identity and Access Management (IAM) role that Amazon Forecast can assume to access the key.</p>
251 pub fn set_encryption_config(mut self, input: ::std::option::Option<crate::types::EncryptionConfig>) -> Self {
252 self.inner = self.inner.set_encryption_config(input);
253 self
254 }
255 /// <p>An Key Management Service (KMS) key and the Identity and Access Management (IAM) role that Amazon Forecast can assume to access the key.</p>
256 pub fn get_encryption_config(&self) -> &::std::option::Option<crate::types::EncryptionConfig> {
257 self.inner.get_encryption_config()
258 }
259 ///
260 /// Appends an item to `Tags`.
261 ///
262 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
263 ///
264 /// <p>The optional metadata that you apply to the dataset to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
265 /// <p>The following basic restrictions apply to tags:</p>
266 /// <ul>
267 /// <li>
268 /// <p>Maximum number of tags per resource - 50.</p></li>
269 /// <li>
270 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
271 /// <li>
272 /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
273 /// <li>
274 /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
275 /// <li>
276 /// <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>
277 /// <li>
278 /// <p>Tag keys and values are case sensitive.</p></li>
279 /// <li>
280 /// <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>
281 /// </ul>
282 pub fn tags(mut self, input: crate::types::Tag) -> Self {
283 self.inner = self.inner.tags(input);
284 self
285 }
286 /// <p>The optional metadata that you apply to the dataset to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
287 /// <p>The following basic restrictions apply to tags:</p>
288 /// <ul>
289 /// <li>
290 /// <p>Maximum number of tags per resource - 50.</p></li>
291 /// <li>
292 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
293 /// <li>
294 /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
295 /// <li>
296 /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
297 /// <li>
298 /// <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>
299 /// <li>
300 /// <p>Tag keys and values are case sensitive.</p></li>
301 /// <li>
302 /// <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>
303 /// </ul>
304 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
305 self.inner = self.inner.set_tags(input);
306 self
307 }
308 /// <p>The optional metadata that you apply to the dataset to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
309 /// <p>The following basic restrictions apply to tags:</p>
310 /// <ul>
311 /// <li>
312 /// <p>Maximum number of tags per resource - 50.</p></li>
313 /// <li>
314 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
315 /// <li>
316 /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
317 /// <li>
318 /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
319 /// <li>
320 /// <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>
321 /// <li>
322 /// <p>Tag keys and values are case sensitive.</p></li>
323 /// <li>
324 /// <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>
325 /// </ul>
326 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
327 self.inner.get_tags()
328 }
329}