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::continue_service_deployment::_continue_service_deployment_input::ContinueServiceDeploymentInputBuilder;

pub use crate::operation::continue_service_deployment::_continue_service_deployment_output::ContinueServiceDeploymentOutputBuilder;

impl crate::operation::continue_service_deployment::builders::ContinueServiceDeploymentInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::continue_service_deployment::ContinueServiceDeploymentOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::continue_service_deployment::ContinueServiceDeploymentError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.continue_service_deployment();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `ContinueServiceDeployment`.
///
/// <p>Continues or rolls back an Amazon ECS service deployment that is paused at a lifecycle hook.</p>
/// <p>When a service deployment reaches a lifecycle stage that has a <code>PAUSE</code> hook configured, the deployment pauses and waits for an explicit action. Use this API to either continue the deployment to the next stage or roll back to the previous service revision.</p>
/// <p>To find the <code>hookId</code> of the paused hook, call <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeServiceDeployments.html">DescribeServiceDeployments</a> and inspect the <code>lifecycleHookDetails</code> field.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ContinueServiceDeploymentFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::continue_service_deployment::builders::ContinueServiceDeploymentInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::continue_service_deployment::ContinueServiceDeploymentOutput,
        crate::operation::continue_service_deployment::ContinueServiceDeploymentError,
    > for ContinueServiceDeploymentFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::continue_service_deployment::ContinueServiceDeploymentOutput,
            crate::operation::continue_service_deployment::ContinueServiceDeploymentError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl ContinueServiceDeploymentFluentBuilder {
    /// Creates a new `ContinueServiceDeploymentFluentBuilder`.
    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 ContinueServiceDeployment as a reference.
    pub fn as_input(&self) -> &crate::operation::continue_service_deployment::builders::ContinueServiceDeploymentInputBuilder {
        &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::continue_service_deployment::ContinueServiceDeploymentOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::continue_service_deployment::ContinueServiceDeploymentError,
            ::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::continue_service_deployment::ContinueServiceDeployment::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::continue_service_deployment::ContinueServiceDeployment::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::continue_service_deployment::ContinueServiceDeploymentOutput,
        crate::operation::continue_service_deployment::ContinueServiceDeploymentError,
        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 ARN of the service deployment to continue or roll back.</p>
    pub fn service_deployment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.service_deployment_arn(input.into());
        self
    }
    /// <p>The ARN of the service deployment to continue or roll back.</p>
    pub fn set_service_deployment_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_service_deployment_arn(input);
        self
    }
    /// <p>The ARN of the service deployment to continue or roll back.</p>
    pub fn get_service_deployment_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_service_deployment_arn()
    }
    /// <p>The ID of the paused lifecycle hook to act on. You can find the <code>hookId</code> by calling <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeServiceDeployments.html">DescribeServiceDeployments</a> and inspecting the <code>lifecycleHookDetails</code> field of the service deployment.</p>
    pub fn hook_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.hook_id(input.into());
        self
    }
    /// <p>The ID of the paused lifecycle hook to act on. You can find the <code>hookId</code> by calling <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeServiceDeployments.html">DescribeServiceDeployments</a> and inspecting the <code>lifecycleHookDetails</code> field of the service deployment.</p>
    pub fn set_hook_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_hook_id(input);
        self
    }
    /// <p>The ID of the paused lifecycle hook to act on. You can find the <code>hookId</code> by calling <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeServiceDeployments.html">DescribeServiceDeployments</a> and inspecting the <code>lifecycleHookDetails</code> field of the service deployment.</p>
    pub fn get_hook_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_hook_id()
    }
    /// <p>The action to take on the paused lifecycle hook. Valid values are:</p>
    /// <ul>
    /// <li>
    /// <p><code>CONTINUE</code> - Proceeds the deployment to the next lifecycle stage.</p></li>
    /// <li>
    /// <p><code>ROLLBACK</code> - Rolls back the deployment to the previous service revision.</p></li>
    /// </ul>
    /// <p>If no value is specified, the default action is <code>CONTINUE</code>.</p>
    pub fn action(mut self, input: crate::types::DeploymentLifecycleHookAction) -> Self {
        self.inner = self.inner.action(input);
        self
    }
    /// <p>The action to take on the paused lifecycle hook. Valid values are:</p>
    /// <ul>
    /// <li>
    /// <p><code>CONTINUE</code> - Proceeds the deployment to the next lifecycle stage.</p></li>
    /// <li>
    /// <p><code>ROLLBACK</code> - Rolls back the deployment to the previous service revision.</p></li>
    /// </ul>
    /// <p>If no value is specified, the default action is <code>CONTINUE</code>.</p>
    pub fn set_action(mut self, input: ::std::option::Option<crate::types::DeploymentLifecycleHookAction>) -> Self {
        self.inner = self.inner.set_action(input);
        self
    }
    /// <p>The action to take on the paused lifecycle hook. Valid values are:</p>
    /// <ul>
    /// <li>
    /// <p><code>CONTINUE</code> - Proceeds the deployment to the next lifecycle stage.</p></li>
    /// <li>
    /// <p><code>ROLLBACK</code> - Rolls back the deployment to the previous service revision.</p></li>
    /// </ul>
    /// <p>If no value is specified, the default action is <code>CONTINUE</code>.</p>
    pub fn get_action(&self) -> &::std::option::Option<crate::types::DeploymentLifecycleHookAction> {
        self.inner.get_action()
    }
}