aws_sdk_gamelift/operation/update_container_group_definition/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_container_group_definition::_update_container_group_definition_output::UpdateContainerGroupDefinitionOutputBuilder;
3
4pub use crate::operation::update_container_group_definition::_update_container_group_definition_input::UpdateContainerGroupDefinitionInputBuilder;
5
6impl crate::operation::update_container_group_definition::builders::UpdateContainerGroupDefinitionInputBuilder {
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::update_container_group_definition::UpdateContainerGroupDefinitionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_container_group_definition::UpdateContainerGroupDefinitionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_container_group_definition();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateContainerGroupDefinition`.
24///
25/// <p><b>This API works with the following fleet types:</b> Container</p>
26/// <p>Updates properties in an existing container group definition. This operation doesn't replace the definition. Instead, it creates a new version of the definition and saves it separately. You can access all versions that you choose to retain.</p>
27/// <p>The only property you can't update is the container group type.</p>
28/// <p><b>Request options:</b></p>
29/// <ul>
30/// <li>
31/// <p>Update based on the latest version of the container group definition. Specify the container group definition name only, or use an ARN value without a version number. Provide updated values for the properties that you want to change only. All other values remain the same as the latest version.</p></li>
32/// <li>
33/// <p>Update based on a specific version of the container group definition. Specify the container group definition name and a source version number, or use an ARN value with a version number. Provide updated values for the properties that you want to change only. All other values remain the same as the source version.</p></li>
34/// <li>
35/// <p>Change a game server container definition. Provide the updated container definition.</p></li>
36/// <li>
37/// <p>Add or change a support container definition. Provide a complete set of container definitions, including the updated definition.</p></li>
38/// <li>
39/// <p>Remove a support container definition. Provide a complete set of container definitions, excluding the definition to remove. If the container group has only one support container definition, provide an empty set.</p></li>
40/// </ul>
41/// <p><b>Results:</b></p>
42/// <p>If successful, this operation returns the complete properties of the new container group definition version.</p>
43/// <p>If the container group definition version is used in an active fleets, the update automatically initiates a new fleet deployment of the new version. You can track a fleet's deployments using <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListFleetDeployments.html">ListFleetDeployments</a>.</p>
44#[derive(::std::clone::Clone, ::std::fmt::Debug)]
45pub struct UpdateContainerGroupDefinitionFluentBuilder {
46    handle: ::std::sync::Arc<crate::client::Handle>,
47    inner: crate::operation::update_container_group_definition::builders::UpdateContainerGroupDefinitionInputBuilder,
48    config_override: ::std::option::Option<crate::config::Builder>,
49}
50impl
51    crate::client::customize::internal::CustomizableSend<
52        crate::operation::update_container_group_definition::UpdateContainerGroupDefinitionOutput,
53        crate::operation::update_container_group_definition::UpdateContainerGroupDefinitionError,
54    > for UpdateContainerGroupDefinitionFluentBuilder
55{
56    fn send(
57        self,
58        config_override: crate::config::Builder,
59    ) -> crate::client::customize::internal::BoxFuture<
60        crate::client::customize::internal::SendResult<
61            crate::operation::update_container_group_definition::UpdateContainerGroupDefinitionOutput,
62            crate::operation::update_container_group_definition::UpdateContainerGroupDefinitionError,
63        >,
64    > {
65        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
66    }
67}
68impl UpdateContainerGroupDefinitionFluentBuilder {
69    /// Creates a new `UpdateContainerGroupDefinitionFluentBuilder`.
70    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
71        Self {
72            handle,
73            inner: ::std::default::Default::default(),
74            config_override: ::std::option::Option::None,
75        }
76    }
77    /// Access the UpdateContainerGroupDefinition as a reference.
78    pub fn as_input(&self) -> &crate::operation::update_container_group_definition::builders::UpdateContainerGroupDefinitionInputBuilder {
79        &self.inner
80    }
81    /// Sends the request and returns the response.
82    ///
83    /// If an error occurs, an `SdkError` will be returned with additional details that
84    /// can be matched against.
85    ///
86    /// By default, any retryable failures will be retried twice. Retry behavior
87    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
88    /// set when configuring the client.
89    pub async fn send(
90        self,
91    ) -> ::std::result::Result<
92        crate::operation::update_container_group_definition::UpdateContainerGroupDefinitionOutput,
93        ::aws_smithy_runtime_api::client::result::SdkError<
94            crate::operation::update_container_group_definition::UpdateContainerGroupDefinitionError,
95            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
96        >,
97    > {
98        let input = self
99            .inner
100            .build()
101            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
102        let runtime_plugins = crate::operation::update_container_group_definition::UpdateContainerGroupDefinition::operation_runtime_plugins(
103            self.handle.runtime_plugins.clone(),
104            &self.handle.conf,
105            self.config_override,
106        );
107        crate::operation::update_container_group_definition::UpdateContainerGroupDefinition::orchestrate(&runtime_plugins, input).await
108    }
109
110    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
111    pub fn customize(
112        self,
113    ) -> crate::client::customize::CustomizableOperation<
114        crate::operation::update_container_group_definition::UpdateContainerGroupDefinitionOutput,
115        crate::operation::update_container_group_definition::UpdateContainerGroupDefinitionError,
116        Self,
117    > {
118        crate::client::customize::CustomizableOperation::new(self)
119    }
120    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
121        self.set_config_override(::std::option::Option::Some(config_override.into()));
122        self
123    }
124
125    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
126        self.config_override = config_override;
127        self
128    }
129    /// <p>A descriptive identifier for the container group definition. The name value must be unique in an Amazon Web Services Region.</p>
130    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.name(input.into());
132        self
133    }
134    /// <p>A descriptive identifier for the container group definition. The name value must be unique in an Amazon Web Services Region.</p>
135    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_name(input);
137        self
138    }
139    /// <p>A descriptive identifier for the container group definition. The name value must be unique in an Amazon Web Services Region.</p>
140    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_name()
142    }
143    /// <p>An updated definition for the game server container in this group. Define a game server container only when the container group type is <code>GAME_SERVER</code>. You can pass in your container definitions as a JSON file.</p>
144    pub fn game_server_container_definition(mut self, input: crate::types::GameServerContainerDefinitionInput) -> Self {
145        self.inner = self.inner.game_server_container_definition(input);
146        self
147    }
148    /// <p>An updated definition for the game server container in this group. Define a game server container only when the container group type is <code>GAME_SERVER</code>. You can pass in your container definitions as a JSON file.</p>
149    pub fn set_game_server_container_definition(mut self, input: ::std::option::Option<crate::types::GameServerContainerDefinitionInput>) -> Self {
150        self.inner = self.inner.set_game_server_container_definition(input);
151        self
152    }
153    /// <p>An updated definition for the game server container in this group. Define a game server container only when the container group type is <code>GAME_SERVER</code>. You can pass in your container definitions as a JSON file.</p>
154    pub fn get_game_server_container_definition(&self) -> &::std::option::Option<crate::types::GameServerContainerDefinitionInput> {
155        self.inner.get_game_server_container_definition()
156    }
157    ///
158    /// Appends an item to `SupportContainerDefinitions`.
159    ///
160    /// To override the contents of this collection use [`set_support_container_definitions`](Self::set_support_container_definitions).
161    ///
162    /// <p>One or more definitions for support containers in this group. You can define a support container in any type of container group. You can pass in your container definitions as a JSON file.</p>
163    pub fn support_container_definitions(mut self, input: crate::types::SupportContainerDefinitionInput) -> Self {
164        self.inner = self.inner.support_container_definitions(input);
165        self
166    }
167    /// <p>One or more definitions for support containers in this group. You can define a support container in any type of container group. You can pass in your container definitions as a JSON file.</p>
168    pub fn set_support_container_definitions(
169        mut self,
170        input: ::std::option::Option<::std::vec::Vec<crate::types::SupportContainerDefinitionInput>>,
171    ) -> Self {
172        self.inner = self.inner.set_support_container_definitions(input);
173        self
174    }
175    /// <p>One or more definitions for support containers in this group. You can define a support container in any type of container group. You can pass in your container definitions as a JSON file.</p>
176    pub fn get_support_container_definitions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SupportContainerDefinitionInput>> {
177        self.inner.get_support_container_definitions()
178    }
179    /// <p>The maximum amount of memory (in MiB) to allocate to the container group. All containers in the group share this memory. If you specify memory limits for an individual container, the total value must be greater than any individual container's memory limit.</p>
180    pub fn total_memory_limit_mebibytes(mut self, input: i32) -> Self {
181        self.inner = self.inner.total_memory_limit_mebibytes(input);
182        self
183    }
184    /// <p>The maximum amount of memory (in MiB) to allocate to the container group. All containers in the group share this memory. If you specify memory limits for an individual container, the total value must be greater than any individual container's memory limit.</p>
185    pub fn set_total_memory_limit_mebibytes(mut self, input: ::std::option::Option<i32>) -> Self {
186        self.inner = self.inner.set_total_memory_limit_mebibytes(input);
187        self
188    }
189    /// <p>The maximum amount of memory (in MiB) to allocate to the container group. All containers in the group share this memory. If you specify memory limits for an individual container, the total value must be greater than any individual container's memory limit.</p>
190    pub fn get_total_memory_limit_mebibytes(&self) -> &::std::option::Option<i32> {
191        self.inner.get_total_memory_limit_mebibytes()
192    }
193    /// <p>The maximum amount of vCPU units to allocate to the container group (1 vCPU is equal to 1024 CPU units). All containers in the group share this memory. If you specify vCPU limits for individual containers, the total value must be equal to or greater than the sum of the CPU limits for all containers in the group.</p>
194    pub fn total_vcpu_limit(mut self, input: f64) -> Self {
195        self.inner = self.inner.total_vcpu_limit(input);
196        self
197    }
198    /// <p>The maximum amount of vCPU units to allocate to the container group (1 vCPU is equal to 1024 CPU units). All containers in the group share this memory. If you specify vCPU limits for individual containers, the total value must be equal to or greater than the sum of the CPU limits for all containers in the group.</p>
199    pub fn set_total_vcpu_limit(mut self, input: ::std::option::Option<f64>) -> Self {
200        self.inner = self.inner.set_total_vcpu_limit(input);
201        self
202    }
203    /// <p>The maximum amount of vCPU units to allocate to the container group (1 vCPU is equal to 1024 CPU units). All containers in the group share this memory. If you specify vCPU limits for individual containers, the total value must be equal to or greater than the sum of the CPU limits for all containers in the group.</p>
204    pub fn get_total_vcpu_limit(&self) -> &::std::option::Option<f64> {
205        self.inner.get_total_vcpu_limit()
206    }
207    /// <p>A description for this update to the container group definition.</p>
208    pub fn version_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
209        self.inner = self.inner.version_description(input.into());
210        self
211    }
212    /// <p>A description for this update to the container group definition.</p>
213    pub fn set_version_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
214        self.inner = self.inner.set_version_description(input);
215        self
216    }
217    /// <p>A description for this update to the container group definition.</p>
218    pub fn get_version_description(&self) -> &::std::option::Option<::std::string::String> {
219        self.inner.get_version_description()
220    }
221    /// <p>The container group definition version to update. The new version starts with values from the source version, and then updates values included in this request.</p>
222    pub fn source_version_number(mut self, input: i32) -> Self {
223        self.inner = self.inner.source_version_number(input);
224        self
225    }
226    /// <p>The container group definition version to update. The new version starts with values from the source version, and then updates values included in this request.</p>
227    pub fn set_source_version_number(mut self, input: ::std::option::Option<i32>) -> Self {
228        self.inner = self.inner.set_source_version_number(input);
229        self
230    }
231    /// <p>The container group definition version to update. The new version starts with values from the source version, and then updates values included in this request.</p>
232    pub fn get_source_version_number(&self) -> &::std::option::Option<i32> {
233        self.inner.get_source_version_number()
234    }
235    /// <p>The platform that all containers in the group use. Containers in a group must run on the same operating system.</p><note>
236    /// <p>Amazon Linux 2 (AL2) will reach end of support on 6/30/2025. See more details in the <a href="http://aws.amazon.com/amazon-linux-2/faqs/">Amazon Linux 2 FAQs</a>. For game servers that are hosted on AL2 and use server SDK version 4.x for Amazon GameLift Servers, first update the game server build to server SDK 5.x, and then deploy to AL2023 instances. See <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-serversdk5-migration.html"> Migrate to server SDK version 5.</a></p>
237    /// </note>
238    pub fn operating_system(mut self, input: crate::types::ContainerOperatingSystem) -> Self {
239        self.inner = self.inner.operating_system(input);
240        self
241    }
242    /// <p>The platform that all containers in the group use. Containers in a group must run on the same operating system.</p><note>
243    /// <p>Amazon Linux 2 (AL2) will reach end of support on 6/30/2025. See more details in the <a href="http://aws.amazon.com/amazon-linux-2/faqs/">Amazon Linux 2 FAQs</a>. For game servers that are hosted on AL2 and use server SDK version 4.x for Amazon GameLift Servers, first update the game server build to server SDK 5.x, and then deploy to AL2023 instances. See <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-serversdk5-migration.html"> Migrate to server SDK version 5.</a></p>
244    /// </note>
245    pub fn set_operating_system(mut self, input: ::std::option::Option<crate::types::ContainerOperatingSystem>) -> Self {
246        self.inner = self.inner.set_operating_system(input);
247        self
248    }
249    /// <p>The platform that all containers in the group use. Containers in a group must run on the same operating system.</p><note>
250    /// <p>Amazon Linux 2 (AL2) will reach end of support on 6/30/2025. See more details in the <a href="http://aws.amazon.com/amazon-linux-2/faqs/">Amazon Linux 2 FAQs</a>. For game servers that are hosted on AL2 and use server SDK version 4.x for Amazon GameLift Servers, first update the game server build to server SDK 5.x, and then deploy to AL2023 instances. See <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-serversdk5-migration.html"> Migrate to server SDK version 5.</a></p>
251    /// </note>
252    pub fn get_operating_system(&self) -> &::std::option::Option<crate::types::ContainerOperatingSystem> {
253        self.inner.get_operating_system()
254    }
255}