aws_sdk_gamelift/operation/update_game_server/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_game_server::_update_game_server_output::UpdateGameServerOutputBuilder;
3
4pub use crate::operation::update_game_server::_update_game_server_input::UpdateGameServerInputBuilder;
5
6impl crate::operation::update_game_server::builders::UpdateGameServerInputBuilder {
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_game_server::UpdateGameServerOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_game_server::UpdateGameServerError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_game_server();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateGameServer`.
24///
25/// <p><b>This operation is used with the Amazon GameLift Servers FleetIQ solution and game server groups.</b></p>
26/// <p>Updates information about a registered game server to help Amazon GameLift Servers FleetIQ track game server availability. This operation is called by a game server process that is running on an instance in a game server group.</p>
27/// <p>Use this operation to update the following types of game server information. You can make all three types of updates in the same request:</p>
28/// <ul>
29/// <li>
30/// <p>To update the game server's utilization status from <code>AVAILABLE</code> (when the game server is available to be claimed) to <code>UTILIZED</code> (when the game server is currently hosting games). Identify the game server and game server group and specify the new utilization status. You can't change the status from to <code>UTILIZED</code> to <code>AVAILABLE</code> .</p></li>
31/// <li>
32/// <p>To report health status, identify the game server and game server group and set health check to <code>HEALTHY</code>. If a game server does not report health status for a certain length of time, the game server is no longer considered healthy. As a result, it will be eventually deregistered from the game server group to avoid affecting utilization metrics. The best practice is to report health every 60 seconds.</p></li>
33/// <li>
34/// <p>To change game server metadata, provide updated game server data.</p></li>
35/// </ul>
36/// <p>Once a game server is successfully updated, the relevant statuses and timestamps are updated.</p>
37/// <p><b>Learn more</b></p>
38/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html">Amazon GameLift Servers FleetIQ Guide</a></p>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct UpdateGameServerFluentBuilder {
41    handle: ::std::sync::Arc<crate::client::Handle>,
42    inner: crate::operation::update_game_server::builders::UpdateGameServerInputBuilder,
43    config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46    crate::client::customize::internal::CustomizableSend<
47        crate::operation::update_game_server::UpdateGameServerOutput,
48        crate::operation::update_game_server::UpdateGameServerError,
49    > for UpdateGameServerFluentBuilder
50{
51    fn send(
52        self,
53        config_override: crate::config::Builder,
54    ) -> crate::client::customize::internal::BoxFuture<
55        crate::client::customize::internal::SendResult<
56            crate::operation::update_game_server::UpdateGameServerOutput,
57            crate::operation::update_game_server::UpdateGameServerError,
58        >,
59    > {
60        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61    }
62}
63impl UpdateGameServerFluentBuilder {
64    /// Creates a new `UpdateGameServerFluentBuilder`.
65    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66        Self {
67            handle,
68            inner: ::std::default::Default::default(),
69            config_override: ::std::option::Option::None,
70        }
71    }
72    /// Access the UpdateGameServer as a reference.
73    pub fn as_input(&self) -> &crate::operation::update_game_server::builders::UpdateGameServerInputBuilder {
74        &self.inner
75    }
76    /// Sends the request and returns the response.
77    ///
78    /// If an error occurs, an `SdkError` will be returned with additional details that
79    /// can be matched against.
80    ///
81    /// By default, any retryable failures will be retried twice. Retry behavior
82    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83    /// set when configuring the client.
84    pub async fn send(
85        self,
86    ) -> ::std::result::Result<
87        crate::operation::update_game_server::UpdateGameServerOutput,
88        ::aws_smithy_runtime_api::client::result::SdkError<
89            crate::operation::update_game_server::UpdateGameServerError,
90            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
91        >,
92    > {
93        let input = self
94            .inner
95            .build()
96            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
97        let runtime_plugins = crate::operation::update_game_server::UpdateGameServer::operation_runtime_plugins(
98            self.handle.runtime_plugins.clone(),
99            &self.handle.conf,
100            self.config_override,
101        );
102        crate::operation::update_game_server::UpdateGameServer::orchestrate(&runtime_plugins, input).await
103    }
104
105    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
106    pub fn customize(
107        self,
108    ) -> crate::client::customize::CustomizableOperation<
109        crate::operation::update_game_server::UpdateGameServerOutput,
110        crate::operation::update_game_server::UpdateGameServerError,
111        Self,
112    > {
113        crate::client::customize::CustomizableOperation::new(self)
114    }
115    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
116        self.set_config_override(::std::option::Option::Some(config_override.into()));
117        self
118    }
119
120    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
121        self.config_override = config_override;
122        self
123    }
124    /// <p>A unique identifier for the game server group where the game server is running.</p>
125    pub fn game_server_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.game_server_group_name(input.into());
127        self
128    }
129    /// <p>A unique identifier for the game server group where the game server is running.</p>
130    pub fn set_game_server_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_game_server_group_name(input);
132        self
133    }
134    /// <p>A unique identifier for the game server group where the game server is running.</p>
135    pub fn get_game_server_group_name(&self) -> &::std::option::Option<::std::string::String> {
136        self.inner.get_game_server_group_name()
137    }
138    /// <p>A custom string that uniquely identifies the game server to update.</p>
139    pub fn game_server_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.game_server_id(input.into());
141        self
142    }
143    /// <p>A custom string that uniquely identifies the game server to update.</p>
144    pub fn set_game_server_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.inner = self.inner.set_game_server_id(input);
146        self
147    }
148    /// <p>A custom string that uniquely identifies the game server to update.</p>
149    pub fn get_game_server_id(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_game_server_id()
151    }
152    /// <p>A set of custom game server properties, formatted as a single string value. This data is passed to a game client or service when it requests information on game servers.</p>
153    pub fn game_server_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.inner = self.inner.game_server_data(input.into());
155        self
156    }
157    /// <p>A set of custom game server properties, formatted as a single string value. This data is passed to a game client or service when it requests information on game servers.</p>
158    pub fn set_game_server_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.inner = self.inner.set_game_server_data(input);
160        self
161    }
162    /// <p>A set of custom game server properties, formatted as a single string value. This data is passed to a game client or service when it requests information on game servers.</p>
163    pub fn get_game_server_data(&self) -> &::std::option::Option<::std::string::String> {
164        self.inner.get_game_server_data()
165    }
166    /// <p>Indicates if the game server is available or is currently hosting gameplay. You can update a game server status from <code>AVAILABLE</code> to <code>UTILIZED</code>, but you can't change a the status from <code>UTILIZED</code> to <code>AVAILABLE</code>.</p>
167    pub fn utilization_status(mut self, input: crate::types::GameServerUtilizationStatus) -> Self {
168        self.inner = self.inner.utilization_status(input);
169        self
170    }
171    /// <p>Indicates if the game server is available or is currently hosting gameplay. You can update a game server status from <code>AVAILABLE</code> to <code>UTILIZED</code>, but you can't change a the status from <code>UTILIZED</code> to <code>AVAILABLE</code>.</p>
172    pub fn set_utilization_status(mut self, input: ::std::option::Option<crate::types::GameServerUtilizationStatus>) -> Self {
173        self.inner = self.inner.set_utilization_status(input);
174        self
175    }
176    /// <p>Indicates if the game server is available or is currently hosting gameplay. You can update a game server status from <code>AVAILABLE</code> to <code>UTILIZED</code>, but you can't change a the status from <code>UTILIZED</code> to <code>AVAILABLE</code>.</p>
177    pub fn get_utilization_status(&self) -> &::std::option::Option<crate::types::GameServerUtilizationStatus> {
178        self.inner.get_utilization_status()
179    }
180    /// <p>Indicates health status of the game server. A request that includes this parameter updates the game server's <i>LastHealthCheckTime</i> timestamp.</p>
181    pub fn health_check(mut self, input: crate::types::GameServerHealthCheck) -> Self {
182        self.inner = self.inner.health_check(input);
183        self
184    }
185    /// <p>Indicates health status of the game server. A request that includes this parameter updates the game server's <i>LastHealthCheckTime</i> timestamp.</p>
186    pub fn set_health_check(mut self, input: ::std::option::Option<crate::types::GameServerHealthCheck>) -> Self {
187        self.inner = self.inner.set_health_check(input);
188        self
189    }
190    /// <p>Indicates health status of the game server. A request that includes this parameter updates the game server's <i>LastHealthCheckTime</i> timestamp.</p>
191    pub fn get_health_check(&self) -> &::std::option::Option<crate::types::GameServerHealthCheck> {
192        self.inner.get_health_check()
193    }
194}