// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::deregister_task_definition::_deregister_task_definition_input::DeregisterTaskDefinitionInputBuilder;
pub use crate::operation::deregister_task_definition::_deregister_task_definition_output::DeregisterTaskDefinitionOutputBuilder;
impl crate::operation::deregister_task_definition::builders::DeregisterTaskDefinitionInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::deregister_task_definition::DeregisterTaskDefinitionOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::deregister_task_definition::DeregisterTaskDefinitionError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.deregister_task_definition();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `DeregisterTaskDefinition`.
///
/// <p>Deregisters the specified task definition by family and revision. Upon deregistration, the task definition is marked as <code>INACTIVE</code>. Existing tasks and services that reference an <code>INACTIVE</code> task definition continue to run without disruption. Existing services that reference an <code>INACTIVE</code> task definition can still scale up or down by modifying the service's desired count. If you want to delete a task definition revision, you must first deregister the task definition revision.</p>
/// <p>You can't use an <code>INACTIVE</code> task definition to run new tasks or create new services, and you can't update an existing service to reference an <code>INACTIVE</code> task definition. However, there may be up to a 10-minute window following deregistration where these restrictions have not yet taken effect.</p><note>
/// <p>At this time, <code>INACTIVE</code> task definitions remain discoverable in your account indefinitely. However, this behavior is subject to change in the future. We don't recommend that you rely on <code>INACTIVE</code> task definitions persisting beyond the lifecycle of any associated tasks and services.</p>
/// </note>
/// <p>You must deregister a task definition revision before you delete it. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeleteTaskDefinitions.html">DeleteTaskDefinitions</a>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct DeregisterTaskDefinitionFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::deregister_task_definition::builders::DeregisterTaskDefinitionInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::deregister_task_definition::DeregisterTaskDefinitionOutput,
crate::operation::deregister_task_definition::DeregisterTaskDefinitionError,
> for DeregisterTaskDefinitionFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::deregister_task_definition::DeregisterTaskDefinitionOutput,
crate::operation::deregister_task_definition::DeregisterTaskDefinitionError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl DeregisterTaskDefinitionFluentBuilder {
/// Creates a new `DeregisterTaskDefinitionFluentBuilder`.
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 DeregisterTaskDefinition as a reference.
pub fn as_input(&self) -> &crate::operation::deregister_task_definition::builders::DeregisterTaskDefinitionInputBuilder {
&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::deregister_task_definition::DeregisterTaskDefinitionOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::deregister_task_definition::DeregisterTaskDefinitionError,
::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::deregister_task_definition::DeregisterTaskDefinition::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::deregister_task_definition::DeregisterTaskDefinition::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::deregister_task_definition::DeregisterTaskDefinitionOutput,
crate::operation::deregister_task_definition::DeregisterTaskDefinitionError,
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 <code>family</code> and <code>revision</code> (<code>family:revision</code>) or full Amazon Resource Name (ARN) of the task definition to deregister. You must specify a <code>revision</code>.</p>
pub fn task_definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.task_definition(input.into());
self
}
/// <p>The <code>family</code> and <code>revision</code> (<code>family:revision</code>) or full Amazon Resource Name (ARN) of the task definition to deregister. You must specify a <code>revision</code>.</p>
pub fn set_task_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_task_definition(input);
self
}
/// <p>The <code>family</code> and <code>revision</code> (<code>family:revision</code>) or full Amazon Resource Name (ARN) of the task definition to deregister. You must specify a <code>revision</code>.</p>
pub fn get_task_definition(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_task_definition()
}
}