aws-sdk-forecast 1.98.0

AWS SDK for Amazon Forecast Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::get_accuracy_metrics::_get_accuracy_metrics_input::GetAccuracyMetricsInputBuilder;

pub use crate::operation::get_accuracy_metrics::_get_accuracy_metrics_output::GetAccuracyMetricsOutputBuilder;

impl crate::operation::get_accuracy_metrics::builders::GetAccuracyMetricsInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::get_accuracy_metrics::GetAccuracyMetricsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_accuracy_metrics::GetAccuracyMetricsError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.get_accuracy_metrics();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `GetAccuracyMetrics`.
///
/// <p>Provides metrics on the accuracy of the models that were trained by the <code>CreatePredictor</code> operation. Use metrics to see how well the model performed and to decide whether to use the predictor to generate a forecast. For more information, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/metrics.html">Predictor Metrics</a>.</p>
/// <p>This operation generates metrics for each backtest window that was evaluated. The number of backtest windows (<code>NumberOfBacktestWindows</code>) is specified using the <code>EvaluationParameters</code> object, which is optionally included in the <code>CreatePredictor</code> request. If <code>NumberOfBacktestWindows</code> isn't specified, the number defaults to one.</p>
/// <p>The parameters of the <code>filling</code> method determine which items contribute to the metrics. If you want all items to contribute, specify <code>zero</code>. If you want only those items that have complete data in the range being evaluated to contribute, specify <code>nan</code>. For more information, see <code>FeaturizationMethod</code>.</p><note>
/// <p>Before you can get accuracy metrics, the <code>Status</code> of the predictor must be <code>ACTIVE</code>, signifying that training has completed. To get the status, use the <code>DescribePredictor</code> operation.</p>
/// </note>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GetAccuracyMetricsFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::get_accuracy_metrics::builders::GetAccuracyMetricsInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::get_accuracy_metrics::GetAccuracyMetricsOutput,
        crate::operation::get_accuracy_metrics::GetAccuracyMetricsError,
    > for GetAccuracyMetricsFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::get_accuracy_metrics::GetAccuracyMetricsOutput,
            crate::operation::get_accuracy_metrics::GetAccuracyMetricsError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl GetAccuracyMetricsFluentBuilder {
    /// Creates a new `GetAccuracyMetricsFluentBuilder`.
    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 GetAccuracyMetrics as a reference.
    pub fn as_input(&self) -> &crate::operation::get_accuracy_metrics::builders::GetAccuracyMetricsInputBuilder {
        &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::get_accuracy_metrics::GetAccuracyMetricsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_accuracy_metrics::GetAccuracyMetricsError,
            ::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::get_accuracy_metrics::GetAccuracyMetrics::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::get_accuracy_metrics::GetAccuracyMetrics::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::get_accuracy_metrics::GetAccuracyMetricsOutput,
        crate::operation::get_accuracy_metrics::GetAccuracyMetricsError,
        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>The Amazon Resource Name (ARN) of the predictor to get metrics for.</p>
    pub fn predictor_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.predictor_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the predictor to get metrics for.</p>
    pub fn set_predictor_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_predictor_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the predictor to get metrics for.</p>
    pub fn get_predictor_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_predictor_arn()
    }
}