aws_sdk_gamelift/operation/delete_container_group_definition/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_container_group_definition::_delete_container_group_definition_output::DeleteContainerGroupDefinitionOutputBuilder;
3
4pub use crate::operation::delete_container_group_definition::_delete_container_group_definition_input::DeleteContainerGroupDefinitionInputBuilder;
5
6impl crate::operation::delete_container_group_definition::builders::DeleteContainerGroupDefinitionInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::delete_container_group_definition::DeleteContainerGroupDefinitionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_container_group_definition::DeleteContainerGroupDefinitionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_container_group_definition();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteContainerGroupDefinition`.
24///
25/// <p><b>This API works with the following fleet types:</b> Container</p>
26/// <p><b>Request options:</b></p>
27/// <p>Deletes a container group definition.</p>
28/// <ul>
29/// <li>
30/// <p>Delete an entire container group definition, including all versions. Specify the container group definition name, or use an ARN value without the version number.</p></li>
31/// <li>
32/// <p>Delete a particular version. Specify the container group definition name and a version number, or use an ARN value that includes the version number.</p></li>
33/// <li>
34/// <p>Keep the newest versions and delete all older versions. Specify the container group definition name and the number of versions to retain. For example, set <code>VersionCountToRetain</code> to 5 to delete all but the five most recent versions.</p></li>
35/// </ul>
36/// <p><b>Result</b></p>
37/// <p>If successful, Amazon GameLift Servers removes the container group definition versions that you request deletion for. This request will fail for any requested versions if the following is true:</p>
38/// <ul>
39/// <li>
40/// <p>If the version is being used in an active fleet</p></li>
41/// <li>
42/// <p>If the version is being deployed to a fleet in a deployment that's currently in progress.</p></li>
43/// <li>
44/// <p>If the version is designated as a rollback definition in a fleet deployment that's currently in progress.</p></li>
45/// </ul>
46/// <p><b>Learn more</b></p>
47/// <ul>
48/// <li>
49/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/containers-create-groups.html">Manage a container group definition</a></p></li>
50/// </ul>
51#[derive(::std::clone::Clone, ::std::fmt::Debug)]
52pub struct DeleteContainerGroupDefinitionFluentBuilder {
53    handle: ::std::sync::Arc<crate::client::Handle>,
54    inner: crate::operation::delete_container_group_definition::builders::DeleteContainerGroupDefinitionInputBuilder,
55    config_override: ::std::option::Option<crate::config::Builder>,
56}
57impl
58    crate::client::customize::internal::CustomizableSend<
59        crate::operation::delete_container_group_definition::DeleteContainerGroupDefinitionOutput,
60        crate::operation::delete_container_group_definition::DeleteContainerGroupDefinitionError,
61    > for DeleteContainerGroupDefinitionFluentBuilder
62{
63    fn send(
64        self,
65        config_override: crate::config::Builder,
66    ) -> crate::client::customize::internal::BoxFuture<
67        crate::client::customize::internal::SendResult<
68            crate::operation::delete_container_group_definition::DeleteContainerGroupDefinitionOutput,
69            crate::operation::delete_container_group_definition::DeleteContainerGroupDefinitionError,
70        >,
71    > {
72        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
73    }
74}
75impl DeleteContainerGroupDefinitionFluentBuilder {
76    /// Creates a new `DeleteContainerGroupDefinitionFluentBuilder`.
77    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
78        Self {
79            handle,
80            inner: ::std::default::Default::default(),
81            config_override: ::std::option::Option::None,
82        }
83    }
84    /// Access the DeleteContainerGroupDefinition as a reference.
85    pub fn as_input(&self) -> &crate::operation::delete_container_group_definition::builders::DeleteContainerGroupDefinitionInputBuilder {
86        &self.inner
87    }
88    /// Sends the request and returns the response.
89    ///
90    /// If an error occurs, an `SdkError` will be returned with additional details that
91    /// can be matched against.
92    ///
93    /// By default, any retryable failures will be retried twice. Retry behavior
94    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
95    /// set when configuring the client.
96    pub async fn send(
97        self,
98    ) -> ::std::result::Result<
99        crate::operation::delete_container_group_definition::DeleteContainerGroupDefinitionOutput,
100        ::aws_smithy_runtime_api::client::result::SdkError<
101            crate::operation::delete_container_group_definition::DeleteContainerGroupDefinitionError,
102            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
103        >,
104    > {
105        let input = self
106            .inner
107            .build()
108            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
109        let runtime_plugins = crate::operation::delete_container_group_definition::DeleteContainerGroupDefinition::operation_runtime_plugins(
110            self.handle.runtime_plugins.clone(),
111            &self.handle.conf,
112            self.config_override,
113        );
114        crate::operation::delete_container_group_definition::DeleteContainerGroupDefinition::orchestrate(&runtime_plugins, input).await
115    }
116
117    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
118    pub fn customize(
119        self,
120    ) -> crate::client::customize::CustomizableOperation<
121        crate::operation::delete_container_group_definition::DeleteContainerGroupDefinitionOutput,
122        crate::operation::delete_container_group_definition::DeleteContainerGroupDefinitionError,
123        Self,
124    > {
125        crate::client::customize::CustomizableOperation::new(self)
126    }
127    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
128        self.set_config_override(::std::option::Option::Some(config_override.into()));
129        self
130    }
131
132    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
133        self.config_override = config_override;
134        self
135    }
136    /// <p>The unique identifier for the container group definition to delete. You can use either the <code>Name</code> or <code>ARN</code> value.</p>
137    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.inner = self.inner.name(input.into());
139        self
140    }
141    /// <p>The unique identifier for the container group definition to delete. You can use either the <code>Name</code> or <code>ARN</code> value.</p>
142    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.inner = self.inner.set_name(input);
144        self
145    }
146    /// <p>The unique identifier for the container group definition to delete. You can use either the <code>Name</code> or <code>ARN</code> value.</p>
147    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
148        self.inner.get_name()
149    }
150    /// <p>The specific version to delete.</p>
151    pub fn version_number(mut self, input: i32) -> Self {
152        self.inner = self.inner.version_number(input);
153        self
154    }
155    /// <p>The specific version to delete.</p>
156    pub fn set_version_number(mut self, input: ::std::option::Option<i32>) -> Self {
157        self.inner = self.inner.set_version_number(input);
158        self
159    }
160    /// <p>The specific version to delete.</p>
161    pub fn get_version_number(&self) -> &::std::option::Option<i32> {
162        self.inner.get_version_number()
163    }
164    /// <p>The number of most recent versions to keep while deleting all older versions.</p>
165    pub fn version_count_to_retain(mut self, input: i32) -> Self {
166        self.inner = self.inner.version_count_to_retain(input);
167        self
168    }
169    /// <p>The number of most recent versions to keep while deleting all older versions.</p>
170    pub fn set_version_count_to_retain(mut self, input: ::std::option::Option<i32>) -> Self {
171        self.inner = self.inner.set_version_count_to_retain(input);
172        self
173    }
174    /// <p>The number of most recent versions to keep while deleting all older versions.</p>
175    pub fn get_version_count_to_retain(&self) -> &::std::option::Option<i32> {
176        self.inner.get_version_count_to_retain()
177    }
178}