aws-sdk-applicationautoscaling 1.115.0

AWS SDK for Application Auto Scaling
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::get_predictive_scaling_forecast::_get_predictive_scaling_forecast_input::GetPredictiveScalingForecastInputBuilder;

pub use crate::operation::get_predictive_scaling_forecast::_get_predictive_scaling_forecast_output::GetPredictiveScalingForecastOutputBuilder;

impl crate::operation::get_predictive_scaling_forecast::builders::GetPredictiveScalingForecastInputBuilder {
    /// 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_predictive_scaling_forecast::GetPredictiveScalingForecastOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_predictive_scaling_forecast::GetPredictiveScalingForecastError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.get_predictive_scaling_forecast();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `GetPredictiveScalingForecast`.
///
/// <p>Retrieves the forecast data for a predictive scaling policy.</p>
/// <p>Load forecasts are predictions of the hourly load values using historical load data from CloudWatch and an analysis of historical trends. Capacity forecasts are represented as predicted values for the minimum capacity that is needed on an hourly basis, based on the hourly load forecast.</p>
/// <p>A minimum of 24 hours of data is required to create the initial forecasts. However, having a full 14 days of historical data results in more accurate forecasts.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GetPredictiveScalingForecastFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::get_predictive_scaling_forecast::builders::GetPredictiveScalingForecastInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::get_predictive_scaling_forecast::GetPredictiveScalingForecastOutput,
        crate::operation::get_predictive_scaling_forecast::GetPredictiveScalingForecastError,
    > for GetPredictiveScalingForecastFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::get_predictive_scaling_forecast::GetPredictiveScalingForecastOutput,
            crate::operation::get_predictive_scaling_forecast::GetPredictiveScalingForecastError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl GetPredictiveScalingForecastFluentBuilder {
    /// Creates a new `GetPredictiveScalingForecastFluentBuilder`.
    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 GetPredictiveScalingForecast as a reference.
    pub fn as_input(&self) -> &crate::operation::get_predictive_scaling_forecast::builders::GetPredictiveScalingForecastInputBuilder {
        &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_predictive_scaling_forecast::GetPredictiveScalingForecastOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_predictive_scaling_forecast::GetPredictiveScalingForecastError,
            ::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_predictive_scaling_forecast::GetPredictiveScalingForecast::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::get_predictive_scaling_forecast::GetPredictiveScalingForecast::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_predictive_scaling_forecast::GetPredictiveScalingForecastOutput,
        crate::operation::get_predictive_scaling_forecast::GetPredictiveScalingForecastError,
        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 namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use <code>custom-resource</code> instead.</p>
    pub fn service_namespace(mut self, input: crate::types::ServiceNamespace) -> Self {
        self.inner = self.inner.service_namespace(input);
        self
    }
    /// <p>The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use <code>custom-resource</code> instead.</p>
    pub fn set_service_namespace(mut self, input: ::std::option::Option<crate::types::ServiceNamespace>) -> Self {
        self.inner = self.inner.set_service_namespace(input);
        self
    }
    /// <p>The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use <code>custom-resource</code> instead.</p>
    pub fn get_service_namespace(&self) -> &::std::option::Option<crate::types::ServiceNamespace> {
        self.inner.get_service_namespace()
    }
    /// <p>The identifier of the resource.</p>
    pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.resource_id(input.into());
        self
    }
    /// <p>The identifier of the resource.</p>
    pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_resource_id(input);
        self
    }
    /// <p>The identifier of the resource.</p>
    pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_resource_id()
    }
    /// <p>The scalable dimension.</p>
    pub fn scalable_dimension(mut self, input: crate::types::ScalableDimension) -> Self {
        self.inner = self.inner.scalable_dimension(input);
        self
    }
    /// <p>The scalable dimension.</p>
    pub fn set_scalable_dimension(mut self, input: ::std::option::Option<crate::types::ScalableDimension>) -> Self {
        self.inner = self.inner.set_scalable_dimension(input);
        self
    }
    /// <p>The scalable dimension.</p>
    pub fn get_scalable_dimension(&self) -> &::std::option::Option<crate::types::ScalableDimension> {
        self.inner.get_scalable_dimension()
    }
    /// <p>The name of the policy.</p>
    pub fn policy_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.policy_name(input.into());
        self
    }
    /// <p>The name of the policy.</p>
    pub fn set_policy_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_policy_name(input);
        self
    }
    /// <p>The name of the policy.</p>
    pub fn get_policy_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_policy_name()
    }
    /// <p>The inclusive start time of the time range for the forecast data to get. At most, the date and time can be one year before the current date and time</p>
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.inner = self.inner.start_time(input);
        self
    }
    /// <p>The inclusive start time of the time range for the forecast data to get. At most, the date and time can be one year before the current date and time</p>
    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.inner = self.inner.set_start_time(input);
        self
    }
    /// <p>The inclusive start time of the time range for the forecast data to get. At most, the date and time can be one year before the current date and time</p>
    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        self.inner.get_start_time()
    }
    /// <p>The exclusive end time of the time range for the forecast data to get. The maximum time duration between the start and end time is 30 days.</p>
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.inner = self.inner.end_time(input);
        self
    }
    /// <p>The exclusive end time of the time range for the forecast data to get. The maximum time duration between the start and end time is 30 days.</p>
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.inner = self.inner.set_end_time(input);
        self
    }
    /// <p>The exclusive end time of the time range for the forecast data to get. The maximum time duration between the start and end time is 30 days.</p>
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        self.inner.get_end_time()
    }
}