Struct aws_sdk_forecastquery::model::forecast::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for Forecast
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn predictions(self, k: impl Into<String>, v: Vec<DataPoint>) -> Self
pub fn predictions(self, k: impl Into<String>, v: Vec<DataPoint>) -> Self
Adds a key-value pair to predictions
.
To override the contents of this collection use set_predictions
.
The forecast.
The string of the string-to-array map is one of the following values:
-
p10
-
p50
-
p90
The default setting is ["0.1", "0.5", "0.9"]
. Use the optional ForecastTypes
parameter of the CreateForecast operation to change the values. The values will vary depending on how this is set, with a minimum of 1
and a maximum of 5.
sourcepub fn set_predictions(
self,
input: Option<HashMap<String, Vec<DataPoint>>>
) -> Self
pub fn set_predictions(
self,
input: Option<HashMap<String, Vec<DataPoint>>>
) -> Self
The forecast.
The string of the string-to-array map is one of the following values:
-
p10
-
p50
-
p90
The default setting is ["0.1", "0.5", "0.9"]
. Use the optional ForecastTypes
parameter of the CreateForecast operation to change the values. The values will vary depending on how this is set, with a minimum of 1
and a maximum of 5.
Examples found in repository?
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398
pub(crate) fn deser_structure_crate_model_forecast<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Forecast>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::forecast::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"Predictions" => {
builder = builder.set_predictions(
crate::json_deser::deser_map_com_amazonaws_forecastquery_predictions(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn build(self) -> Forecast
pub fn build(self) -> Forecast
Consumes the builder and constructs a Forecast
.
Examples found in repository?
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398
pub(crate) fn deser_structure_crate_model_forecast<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::Forecast>, aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::forecast::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"Predictions" => {
builder = builder.set_predictions(
crate::json_deser::deser_map_com_amazonaws_forecastquery_predictions(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}