aws-sdk-ecs 1.128.0

AWS SDK for Amazon EC2 Container Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_capacity_provider::_update_capacity_provider_input::UpdateCapacityProviderInputBuilder;

pub use crate::operation::update_capacity_provider::_update_capacity_provider_output::UpdateCapacityProviderOutputBuilder;

impl crate::operation::update_capacity_provider::builders::UpdateCapacityProviderInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::update_capacity_provider::UpdateCapacityProviderOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_capacity_provider::UpdateCapacityProviderError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_capacity_provider();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateCapacityProvider`.
///
/// <p>Modifies the parameters for a capacity provider.</p>
/// <p>These changes only apply to new Amazon ECS Managed Instances, or EC2 instances, not existing ones.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateCapacityProviderFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_capacity_provider::builders::UpdateCapacityProviderInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_capacity_provider::UpdateCapacityProviderOutput,
        crate::operation::update_capacity_provider::UpdateCapacityProviderError,
    > for UpdateCapacityProviderFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_capacity_provider::UpdateCapacityProviderOutput,
            crate::operation::update_capacity_provider::UpdateCapacityProviderError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateCapacityProviderFluentBuilder {
    /// Creates a new `UpdateCapacityProviderFluentBuilder`.
    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 UpdateCapacityProvider as a reference.
    pub fn as_input(&self) -> &crate::operation::update_capacity_provider::builders::UpdateCapacityProviderInputBuilder {
        &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::update_capacity_provider::UpdateCapacityProviderOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_capacity_provider::UpdateCapacityProviderError,
            ::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::update_capacity_provider::UpdateCapacityProvider::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_capacity_provider::UpdateCapacityProvider::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::update_capacity_provider::UpdateCapacityProviderOutput,
        crate::operation::update_capacity_provider::UpdateCapacityProviderError,
        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 name of the capacity provider to update.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// <p>The name of the capacity provider to update.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// <p>The name of the capacity provider to update.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>The name of the cluster that contains the capacity provider to update. Managed instances capacity providers are cluster-scoped and can only be updated within their associated cluster.</p>
    pub fn cluster(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.cluster(input.into());
        self
    }
    /// <p>The name of the cluster that contains the capacity provider to update. Managed instances capacity providers are cluster-scoped and can only be updated within their associated cluster.</p>
    pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_cluster(input);
        self
    }
    /// <p>The name of the cluster that contains the capacity provider to update. Managed instances capacity providers are cluster-scoped and can only be updated within their associated cluster.</p>
    pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_cluster()
    }
    /// <p>An object that represent the parameters to update for the Auto Scaling group capacity provider.</p>
    pub fn auto_scaling_group_provider(mut self, input: crate::types::AutoScalingGroupProviderUpdate) -> Self {
        self.inner = self.inner.auto_scaling_group_provider(input);
        self
    }
    /// <p>An object that represent the parameters to update for the Auto Scaling group capacity provider.</p>
    pub fn set_auto_scaling_group_provider(mut self, input: ::std::option::Option<crate::types::AutoScalingGroupProviderUpdate>) -> Self {
        self.inner = self.inner.set_auto_scaling_group_provider(input);
        self
    }
    /// <p>An object that represent the parameters to update for the Auto Scaling group capacity provider.</p>
    pub fn get_auto_scaling_group_provider(&self) -> &::std::option::Option<crate::types::AutoScalingGroupProviderUpdate> {
        self.inner.get_auto_scaling_group_provider()
    }
    /// <p>The updated configuration for the Amazon ECS Managed Instances provider. You can modify the infrastructure role, instance launch template, and tag propagation settings. Changes take effect for new instances launched after the update.</p>
    pub fn managed_instances_provider(mut self, input: crate::types::UpdateManagedInstancesProviderConfiguration) -> Self {
        self.inner = self.inner.managed_instances_provider(input);
        self
    }
    /// <p>The updated configuration for the Amazon ECS Managed Instances provider. You can modify the infrastructure role, instance launch template, and tag propagation settings. Changes take effect for new instances launched after the update.</p>
    pub fn set_managed_instances_provider(mut self, input: ::std::option::Option<crate::types::UpdateManagedInstancesProviderConfiguration>) -> Self {
        self.inner = self.inner.set_managed_instances_provider(input);
        self
    }
    /// <p>The updated configuration for the Amazon ECS Managed Instances provider. You can modify the infrastructure role, instance launch template, and tag propagation settings. Changes take effect for new instances launched after the update.</p>
    pub fn get_managed_instances_provider(&self) -> &::std::option::Option<crate::types::UpdateManagedInstancesProviderConfiguration> {
        self.inner.get_managed_instances_provider()
    }
}