aws-sdk-opsworks 0.27.0

AWS SDK for AWS OpsWorks
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::register_ecs_cluster::_register_ecs_cluster_output::RegisterEcsClusterOutputBuilder;

pub use crate::operation::register_ecs_cluster::_register_ecs_cluster_input::RegisterEcsClusterInputBuilder;

/// Fluent builder constructing a request to `RegisterEcsCluster`.
///
/// <p>Registers a specified Amazon ECS cluster with a stack. You can register only one cluster with a stack. A cluster can be registered with only one stack. For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-ecscluster.html"> Resource Management</a>.</p>
/// <p> <b>Required Permissions</b>: To use this action, an IAM user must have a Manage permissions level for the stack or an attached policy that explicitly grants permissions. For more information on user permissions, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html"> Managing User Permissions</a>.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct RegisterEcsClusterFluentBuilder {
    handle: std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::register_ecs_cluster::builders::RegisterEcsClusterInputBuilder,
}
impl RegisterEcsClusterFluentBuilder {
    /// Creates a new `RegisterEcsCluster`.
    pub(crate) fn new(handle: std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: Default::default(),
        }
    }
    /// Consume this builder, creating a customizable operation that can be modified before being
    /// sent. The operation's inner [http::Request] can be modified as well.
    pub async fn customize(
        self,
    ) -> std::result::Result<
        crate::client::customize::CustomizableOperation<
            crate::operation::register_ecs_cluster::RegisterEcsCluster,
            aws_http::retry::AwsResponseRetryClassifier,
        >,
        aws_smithy_http::result::SdkError<
            crate::operation::register_ecs_cluster::RegisterEcsClusterError,
        >,
    > {
        let handle = self.handle.clone();
        let operation = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        Ok(crate::client::customize::CustomizableOperation { handle, operation })
    }

    /// 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::register_ecs_cluster::RegisterEcsClusterOutput,
        aws_smithy_http::result::SdkError<
            crate::operation::register_ecs_cluster::RegisterEcsClusterError,
        >,
    > {
        let op = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&self.handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        self.handle.client.call(op).await
    }
    /// <p>The cluster's ARN.</p>
    pub fn ecs_cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.ecs_cluster_arn(input.into());
        self
    }
    /// <p>The cluster's ARN.</p>
    pub fn set_ecs_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.inner = self.inner.set_ecs_cluster_arn(input);
        self
    }
    /// <p>The stack ID.</p>
    pub fn stack_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.stack_id(input.into());
        self
    }
    /// <p>The stack ID.</p>
    pub fn set_stack_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.inner = self.inner.set_stack_id(input);
        self
    }
}