aws_sdk_gamelift/client/
terminate_game_session.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`TerminateGameSession`](crate::operation::terminate_game_session::builders::TerminateGameSessionFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`game_session_id(impl Into<String>)`](crate::operation::terminate_game_session::builders::TerminateGameSessionFluentBuilder::game_session_id) / [`set_game_session_id(Option<String>)`](crate::operation::terminate_game_session::builders::TerminateGameSessionFluentBuilder::set_game_session_id):<br>required: **true**<br><p>A unique identifier for the game session to be terminated. A game session ARN has the following format: <code>arn:aws:gamelift:<location>    ::gamesession/    <fleet id>     /     <custom id string or idempotency token></custom>    </fleet>   </location></code>.</p><br>
7    ///   - [`termination_mode(TerminationMode)`](crate::operation::terminate_game_session::builders::TerminateGameSessionFluentBuilder::termination_mode) / [`set_termination_mode(Option<TerminationMode>)`](crate::operation::terminate_game_session::builders::TerminateGameSessionFluentBuilder::set_termination_mode):<br>required: **true**<br><p>The method to use to terminate the game session. Available methods include:</p> <ul>  <li>   <p><code>TRIGGER_ON_PROCESS_TERMINATE</code> – Prompts the Amazon GameLift Servers service to send an <code>OnProcessTerminate()</code> callback to the server process and initiate the normal game session shutdown sequence. The <code>OnProcessTerminate</code> method, which is implemented in the game server code, must include a call to the server SDK action <code>ProcessEnding()</code>, which is how the server process signals to Amazon GameLift Servers that a game session is ending. If the server process doesn't call <code>ProcessEnding()</code>, the game session termination won't conclude successfully.</p></li>  <li>   <p><code>FORCE_TERMINATE</code> – Prompts the Amazon GameLift Servers service to stop the server process immediately. Amazon GameLift Servers takes action (depending on the type of fleet) to shut down the server process without the normal game session shutdown sequence.</p><note>    <p>This method is not available for game sessions that are running on Anywhere fleets unless the fleet is deployed with the Amazon GameLift Servers Agent. In this scenario, a force terminate request results in an invalid or bad request exception.</p>   </note></li> </ul><br>
8    /// - On success, responds with [`TerminateGameSessionOutput`](crate::operation::terminate_game_session::TerminateGameSessionOutput) with field(s):
9    ///   - [`game_session(Option<GameSession>)`](crate::operation::terminate_game_session::TerminateGameSessionOutput::game_session): <p>Properties describing a game session.</p> <p>A game session in ACTIVE status can host players. When a game session ends, its status is set to <code>TERMINATED</code>.</p> <p>Amazon GameLift Servers retains a game session resource for 30 days after the game session ends. You can reuse idempotency token values after this time. Game session logs are retained for 14 days.</p> <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a></p>
10    /// - On failure, responds with [`SdkError<TerminateGameSessionError>`](crate::operation::terminate_game_session::TerminateGameSessionError)
11    pub fn terminate_game_session(&self) -> crate::operation::terminate_game_session::builders::TerminateGameSessionFluentBuilder {
12        crate::operation::terminate_game_session::builders::TerminateGameSessionFluentBuilder::new(self.handle.clone())
13    }
14}