aws_sdk_forecast/operation/create_forecast/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_forecast::_create_forecast_output::CreateForecastOutputBuilder;
3
4pub use crate::operation::create_forecast::_create_forecast_input::CreateForecastInputBuilder;
5
6impl crate::operation::create_forecast::builders::CreateForecastInputBuilder {
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_forecast::CreateForecastOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_forecast::CreateForecastError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_forecast();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateForecast`.
24///
25/// <p>Creates a forecast for each item in the <code>TARGET_TIME_SERIES</code> dataset that was used to train the predictor. This is known as inference. To retrieve the forecast for a single item at low latency, use the operation. To export the complete forecast into your Amazon Simple Storage Service (Amazon S3) bucket, use the <code>CreateForecastExportJob</code> operation.</p>
26/// <p>The range of the forecast is determined by the <code>ForecastHorizon</code> value, which you specify in the <code>CreatePredictor</code> request. When you query a forecast, you can request a specific date range within the forecast.</p>
27/// <p>To get a list of all your forecasts, use the <code>ListForecasts</code> operation.</p><note>
28/// <p>The forecasts generated by Amazon Forecast are in the same time zone as the dataset that was used to create the predictor.</p>
29/// </note>
30/// <p>For more information, see <code>howitworks-forecast</code>.</p><note>
31/// <p>The <code>Status</code> of the forecast must be <code>ACTIVE</code> before you can query or export the forecast. Use the <code>DescribeForecast</code> operation to get the status.</p>
32/// </note>
33/// <p>By default, a forecast includes predictions for every item (<code>item_id</code>) in the dataset group that was used to train the predictor. However, you can use the <code>TimeSeriesSelector</code> object to generate a forecast on a subset of time series. Forecast creation is skipped for any time series that you specify that are not in the input dataset. The forecast export file will not contain these time series or their forecasted values.</p>
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct CreateForecastFluentBuilder {
36 handle: ::std::sync::Arc<crate::client::Handle>,
37 inner: crate::operation::create_forecast::builders::CreateForecastInputBuilder,
38 config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41 crate::client::customize::internal::CustomizableSend<
42 crate::operation::create_forecast::CreateForecastOutput,
43 crate::operation::create_forecast::CreateForecastError,
44 > for CreateForecastFluentBuilder
45{
46 fn send(
47 self,
48 config_override: crate::config::Builder,
49 ) -> crate::client::customize::internal::BoxFuture<
50 crate::client::customize::internal::SendResult<
51 crate::operation::create_forecast::CreateForecastOutput,
52 crate::operation::create_forecast::CreateForecastError,
53 >,
54 > {
55 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56 }
57}
58impl CreateForecastFluentBuilder {
59 /// Creates a new `CreateForecastFluentBuilder`.
60 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61 Self {
62 handle,
63 inner: ::std::default::Default::default(),
64 config_override: ::std::option::Option::None,
65 }
66 }
67 /// Access the CreateForecast as a reference.
68 pub fn as_input(&self) -> &crate::operation::create_forecast::builders::CreateForecastInputBuilder {
69 &self.inner
70 }
71 /// Sends the request and returns the response.
72 ///
73 /// If an error occurs, an `SdkError` will be returned with additional details that
74 /// can be matched against.
75 ///
76 /// By default, any retryable failures will be retried twice. Retry behavior
77 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78 /// set when configuring the client.
79 pub async fn send(
80 self,
81 ) -> ::std::result::Result<
82 crate::operation::create_forecast::CreateForecastOutput,
83 ::aws_smithy_runtime_api::client::result::SdkError<
84 crate::operation::create_forecast::CreateForecastError,
85 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86 >,
87 > {
88 let input = self
89 .inner
90 .build()
91 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92 let runtime_plugins = crate::operation::create_forecast::CreateForecast::operation_runtime_plugins(
93 self.handle.runtime_plugins.clone(),
94 &self.handle.conf,
95 self.config_override,
96 );
97 crate::operation::create_forecast::CreateForecast::orchestrate(&runtime_plugins, input).await
98 }
99
100 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101 pub fn customize(
102 self,
103 ) -> crate::client::customize::CustomizableOperation<
104 crate::operation::create_forecast::CreateForecastOutput,
105 crate::operation::create_forecast::CreateForecastError,
106 Self,
107 > {
108 crate::client::customize::CustomizableOperation::new(self)
109 }
110 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111 self.set_config_override(::std::option::Option::Some(config_override.into()));
112 self
113 }
114
115 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116 self.config_override = config_override;
117 self
118 }
119 /// <p>A name for the forecast.</p>
120 pub fn forecast_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.inner = self.inner.forecast_name(input.into());
122 self
123 }
124 /// <p>A name for the forecast.</p>
125 pub fn set_forecast_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.inner = self.inner.set_forecast_name(input);
127 self
128 }
129 /// <p>A name for the forecast.</p>
130 pub fn get_forecast_name(&self) -> &::std::option::Option<::std::string::String> {
131 self.inner.get_forecast_name()
132 }
133 /// <p>The Amazon Resource Name (ARN) of the predictor to use to generate the forecast.</p>
134 pub fn predictor_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135 self.inner = self.inner.predictor_arn(input.into());
136 self
137 }
138 /// <p>The Amazon Resource Name (ARN) of the predictor to use to generate the forecast.</p>
139 pub fn set_predictor_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140 self.inner = self.inner.set_predictor_arn(input);
141 self
142 }
143 /// <p>The Amazon Resource Name (ARN) of the predictor to use to generate the forecast.</p>
144 pub fn get_predictor_arn(&self) -> &::std::option::Option<::std::string::String> {
145 self.inner.get_predictor_arn()
146 }
147 ///
148 /// Appends an item to `ForecastTypes`.
149 ///
150 /// To override the contents of this collection use [`set_forecast_types`](Self::set_forecast_types).
151 ///
152 /// <p>The quantiles at which probabilistic forecasts are generated. <b>You can currently specify up to 5 quantiles per forecast</b>. Accepted values include <code>0.01 to 0.99</code> (increments of .01 only) and <code>mean</code>. The mean forecast is different from the median (0.50) when the distribution is not symmetric (for example, Beta and Negative Binomial).</p>
153 /// <p>The default quantiles are the quantiles you specified during predictor creation. If you didn't specify quantiles, the default values are <code>\["0.1", "0.5", "0.9"\]</code>.</p>
154 pub fn forecast_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155 self.inner = self.inner.forecast_types(input.into());
156 self
157 }
158 /// <p>The quantiles at which probabilistic forecasts are generated. <b>You can currently specify up to 5 quantiles per forecast</b>. Accepted values include <code>0.01 to 0.99</code> (increments of .01 only) and <code>mean</code>. The mean forecast is different from the median (0.50) when the distribution is not symmetric (for example, Beta and Negative Binomial).</p>
159 /// <p>The default quantiles are the quantiles you specified during predictor creation. If you didn't specify quantiles, the default values are <code>\["0.1", "0.5", "0.9"\]</code>.</p>
160 pub fn set_forecast_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
161 self.inner = self.inner.set_forecast_types(input);
162 self
163 }
164 /// <p>The quantiles at which probabilistic forecasts are generated. <b>You can currently specify up to 5 quantiles per forecast</b>. Accepted values include <code>0.01 to 0.99</code> (increments of .01 only) and <code>mean</code>. The mean forecast is different from the median (0.50) when the distribution is not symmetric (for example, Beta and Negative Binomial).</p>
165 /// <p>The default quantiles are the quantiles you specified during predictor creation. If you didn't specify quantiles, the default values are <code>\["0.1", "0.5", "0.9"\]</code>.</p>
166 pub fn get_forecast_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
167 self.inner.get_forecast_types()
168 }
169 ///
170 /// Appends an item to `Tags`.
171 ///
172 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
173 ///
174 /// <p>The optional metadata that you apply to the forecast to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
175 /// <p>The following basic restrictions apply to tags:</p>
176 /// <ul>
177 /// <li>
178 /// <p>Maximum number of tags per resource - 50.</p></li>
179 /// <li>
180 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
181 /// <li>
182 /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
183 /// <li>
184 /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
185 /// <li>
186 /// <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>
187 /// <li>
188 /// <p>Tag keys and values are case sensitive.</p></li>
189 /// <li>
190 /// <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>
191 /// </ul>
192 pub fn tags(mut self, input: crate::types::Tag) -> Self {
193 self.inner = self.inner.tags(input);
194 self
195 }
196 /// <p>The optional metadata that you apply to the forecast to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
197 /// <p>The following basic restrictions apply to tags:</p>
198 /// <ul>
199 /// <li>
200 /// <p>Maximum number of tags per resource - 50.</p></li>
201 /// <li>
202 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
203 /// <li>
204 /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
205 /// <li>
206 /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
207 /// <li>
208 /// <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>
209 /// <li>
210 /// <p>Tag keys and values are case sensitive.</p></li>
211 /// <li>
212 /// <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>
213 /// </ul>
214 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
215 self.inner = self.inner.set_tags(input);
216 self
217 }
218 /// <p>The optional metadata that you apply to the forecast to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
219 /// <p>The following basic restrictions apply to tags:</p>
220 /// <ul>
221 /// <li>
222 /// <p>Maximum number of tags per resource - 50.</p></li>
223 /// <li>
224 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
225 /// <li>
226 /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
227 /// <li>
228 /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
229 /// <li>
230 /// <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>
231 /// <li>
232 /// <p>Tag keys and values are case sensitive.</p></li>
233 /// <li>
234 /// <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>
235 /// </ul>
236 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
237 self.inner.get_tags()
238 }
239 /// <p>Defines the set of time series that are used to create the forecasts in a <code>TimeSeriesIdentifiers</code> object.</p>
240 /// <p>The <code>TimeSeriesIdentifiers</code> object needs the following information:</p>
241 /// <ul>
242 /// <li>
243 /// <p><code>DataSource</code></p></li>
244 /// <li>
245 /// <p><code>Format</code></p></li>
246 /// <li>
247 /// <p><code>Schema</code></p></li>
248 /// </ul>
249 pub fn time_series_selector(mut self, input: crate::types::TimeSeriesSelector) -> Self {
250 self.inner = self.inner.time_series_selector(input);
251 self
252 }
253 /// <p>Defines the set of time series that are used to create the forecasts in a <code>TimeSeriesIdentifiers</code> object.</p>
254 /// <p>The <code>TimeSeriesIdentifiers</code> object needs the following information:</p>
255 /// <ul>
256 /// <li>
257 /// <p><code>DataSource</code></p></li>
258 /// <li>
259 /// <p><code>Format</code></p></li>
260 /// <li>
261 /// <p><code>Schema</code></p></li>
262 /// </ul>
263 pub fn set_time_series_selector(mut self, input: ::std::option::Option<crate::types::TimeSeriesSelector>) -> Self {
264 self.inner = self.inner.set_time_series_selector(input);
265 self
266 }
267 /// <p>Defines the set of time series that are used to create the forecasts in a <code>TimeSeriesIdentifiers</code> object.</p>
268 /// <p>The <code>TimeSeriesIdentifiers</code> object needs the following information:</p>
269 /// <ul>
270 /// <li>
271 /// <p><code>DataSource</code></p></li>
272 /// <li>
273 /// <p><code>Format</code></p></li>
274 /// <li>
275 /// <p><code>Schema</code></p></li>
276 /// </ul>
277 pub fn get_time_series_selector(&self) -> &::std::option::Option<crate::types::TimeSeriesSelector> {
278 self.inner.get_time_series_selector()
279 }
280}