aws-sdk-gamelift 1.119.0

AWS SDK for Amazon GameLift
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct TerminateGameSessionInput {
    /// <p>An identifier for the game session that is unique across all regions to be terminated. The value is always a full ARN in the following format: For Home Region game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <id string></id>
    /// </fleet>
    /// </home_region></code>. For Remote Location game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <location>
    /// /
    /// <id string></id>
    /// </location>
    /// </fleet>
    /// </home_region></code>.</p>
    pub game_session_id: ::std::option::Option<::std::string::String>,
    /// <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>
    pub termination_mode: ::std::option::Option<crate::types::TerminationMode>,
}
impl TerminateGameSessionInput {
    /// <p>An identifier for the game session that is unique across all regions to be terminated. The value is always a full ARN in the following format: For Home Region game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <id string></id>
    /// </fleet>
    /// </home_region></code>. For Remote Location game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <location>
    /// /
    /// <id string></id>
    /// </location>
    /// </fleet>
    /// </home_region></code>.</p>
    pub fn game_session_id(&self) -> ::std::option::Option<&str> {
        self.game_session_id.as_deref()
    }
    /// <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>
    pub fn termination_mode(&self) -> ::std::option::Option<&crate::types::TerminationMode> {
        self.termination_mode.as_ref()
    }
}
impl TerminateGameSessionInput {
    /// Creates a new builder-style object to manufacture [`TerminateGameSessionInput`](crate::operation::terminate_game_session::TerminateGameSessionInput).
    pub fn builder() -> crate::operation::terminate_game_session::builders::TerminateGameSessionInputBuilder {
        crate::operation::terminate_game_session::builders::TerminateGameSessionInputBuilder::default()
    }
}

/// A builder for [`TerminateGameSessionInput`](crate::operation::terminate_game_session::TerminateGameSessionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TerminateGameSessionInputBuilder {
    pub(crate) game_session_id: ::std::option::Option<::std::string::String>,
    pub(crate) termination_mode: ::std::option::Option<crate::types::TerminationMode>,
}
impl TerminateGameSessionInputBuilder {
    /// <p>An identifier for the game session that is unique across all regions to be terminated. The value is always a full ARN in the following format: For Home Region game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <id string></id>
    /// </fleet>
    /// </home_region></code>. For Remote Location game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <location>
    /// /
    /// <id string></id>
    /// </location>
    /// </fleet>
    /// </home_region></code>.</p>
    /// This field is required.
    pub fn game_session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.game_session_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An identifier for the game session that is unique across all regions to be terminated. The value is always a full ARN in the following format: For Home Region game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <id string></id>
    /// </fleet>
    /// </home_region></code>. For Remote Location game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <location>
    /// /
    /// <id string></id>
    /// </location>
    /// </fleet>
    /// </home_region></code>.</p>
    pub fn set_game_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.game_session_id = input;
        self
    }
    /// <p>An identifier for the game session that is unique across all regions to be terminated. The value is always a full ARN in the following format: For Home Region game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <id string></id>
    /// </fleet>
    /// </home_region></code>. For Remote Location game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <location>
    /// /
    /// <id string></id>
    /// </location>
    /// </fleet>
    /// </home_region></code>.</p>
    pub fn get_game_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.game_session_id
    }
    /// <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>
    /// This field is required.
    pub fn termination_mode(mut self, input: crate::types::TerminationMode) -> Self {
        self.termination_mode = ::std::option::Option::Some(input);
        self
    }
    /// <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>
    pub fn set_termination_mode(mut self, input: ::std::option::Option<crate::types::TerminationMode>) -> Self {
        self.termination_mode = input;
        self
    }
    /// <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>
    pub fn get_termination_mode(&self) -> &::std::option::Option<crate::types::TerminationMode> {
        &self.termination_mode
    }
    /// Consumes the builder and constructs a [`TerminateGameSessionInput`](crate::operation::terminate_game_session::TerminateGameSessionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::terminate_game_session::TerminateGameSessionInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::terminate_game_session::TerminateGameSessionInput {
            game_session_id: self.game_session_id,
            termination_mode: self.termination_mode,
        })
    }
}