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