// 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 UpdateGameSessionInput {
/// <p>An identifier for the game session that is unique across all regions to update. 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 maximum number of players that can be connected simultaneously to the game session.</p>
pub maximum_player_session_count: ::std::option::Option<i32>,
/// <p>A descriptive label that is associated with a game session. Session names do not need to be unique.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>A policy that determines whether the game session is accepting new players.</p>
pub player_session_creation_policy: ::std::option::Option<crate::types::PlayerSessionCreationPolicy>,
/// <p>Game session protection policy to apply to this game session only.</p>
/// <ul>
/// <li>
/// <p><code>NoProtection</code> -- The game session can be terminated during a scale-down event.</p></li>
/// <li>
/// <p><code>FullProtection</code> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p></li>
/// </ul>
pub protection_policy: ::std::option::Option<crate::types::ProtectionPolicy>,
/// <p>A set of key-value pairs that can store custom data in a game session. For example: <code>{"Key": "difficulty", "Value": "novice"}</code>. You can use this parameter to modify game properties in an active game session. This action adds new properties and modifies existing properties. There is no way to delete properties. For an example, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#game-properties-update">Update the value of a game property</a>.</p><note>
/// <ul>
/// <li>
/// <p>Avoid using periods (".") in property keys if you plan to search for game sessions by properties. Property keys containing periods cannot be searched and will be filtered out from search results due to search index limitations.</p></li>
/// <li>
/// <p>If you use SearchGameSessions API, there is a limit of 500 game property keys across all game sessions and all fleets per region. If the limit is exceeded, there will potentially be game session entries missing from SearchGameSessions API results.</p></li>
/// </ul>
/// </note>
pub game_properties: ::std::option::Option<::std::vec::Vec<crate::types::GameProperty>>,
}
impl UpdateGameSessionInput {
/// <p>An identifier for the game session that is unique across all regions to update. 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 maximum number of players that can be connected simultaneously to the game session.</p>
pub fn maximum_player_session_count(&self) -> ::std::option::Option<i32> {
self.maximum_player_session_count
}
/// <p>A descriptive label that is associated with a game session. Session names do not need to be unique.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>A policy that determines whether the game session is accepting new players.</p>
pub fn player_session_creation_policy(&self) -> ::std::option::Option<&crate::types::PlayerSessionCreationPolicy> {
self.player_session_creation_policy.as_ref()
}
/// <p>Game session protection policy to apply to this game session only.</p>
/// <ul>
/// <li>
/// <p><code>NoProtection</code> -- The game session can be terminated during a scale-down event.</p></li>
/// <li>
/// <p><code>FullProtection</code> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p></li>
/// </ul>
pub fn protection_policy(&self) -> ::std::option::Option<&crate::types::ProtectionPolicy> {
self.protection_policy.as_ref()
}
/// <p>A set of key-value pairs that can store custom data in a game session. For example: <code>{"Key": "difficulty", "Value": "novice"}</code>. You can use this parameter to modify game properties in an active game session. This action adds new properties and modifies existing properties. There is no way to delete properties. For an example, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#game-properties-update">Update the value of a game property</a>.</p><note>
/// <ul>
/// <li>
/// <p>Avoid using periods (".") in property keys if you plan to search for game sessions by properties. Property keys containing periods cannot be searched and will be filtered out from search results due to search index limitations.</p></li>
/// <li>
/// <p>If you use SearchGameSessions API, there is a limit of 500 game property keys across all game sessions and all fleets per region. If the limit is exceeded, there will potentially be game session entries missing from SearchGameSessions API results.</p></li>
/// </ul>
/// </note>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.game_properties.is_none()`.
pub fn game_properties(&self) -> &[crate::types::GameProperty] {
self.game_properties.as_deref().unwrap_or_default()
}
}
impl UpdateGameSessionInput {
/// Creates a new builder-style object to manufacture [`UpdateGameSessionInput`](crate::operation::update_game_session::UpdateGameSessionInput).
pub fn builder() -> crate::operation::update_game_session::builders::UpdateGameSessionInputBuilder {
crate::operation::update_game_session::builders::UpdateGameSessionInputBuilder::default()
}
}
/// A builder for [`UpdateGameSessionInput`](crate::operation::update_game_session::UpdateGameSessionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateGameSessionInputBuilder {
pub(crate) game_session_id: ::std::option::Option<::std::string::String>,
pub(crate) maximum_player_session_count: ::std::option::Option<i32>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) player_session_creation_policy: ::std::option::Option<crate::types::PlayerSessionCreationPolicy>,
pub(crate) protection_policy: ::std::option::Option<crate::types::ProtectionPolicy>,
pub(crate) game_properties: ::std::option::Option<::std::vec::Vec<crate::types::GameProperty>>,
}
impl UpdateGameSessionInputBuilder {
/// <p>An identifier for the game session that is unique across all regions to update. 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 update. 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 update. 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 maximum number of players that can be connected simultaneously to the game session.</p>
pub fn maximum_player_session_count(mut self, input: i32) -> Self {
self.maximum_player_session_count = ::std::option::Option::Some(input);
self
}
/// <p>The maximum number of players that can be connected simultaneously to the game session.</p>
pub fn set_maximum_player_session_count(mut self, input: ::std::option::Option<i32>) -> Self {
self.maximum_player_session_count = input;
self
}
/// <p>The maximum number of players that can be connected simultaneously to the game session.</p>
pub fn get_maximum_player_session_count(&self) -> &::std::option::Option<i32> {
&self.maximum_player_session_count
}
/// <p>A descriptive label that is associated with a game session. Session names do not need to be unique.</p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>A descriptive label that is associated with a game session. Session names do not need to be unique.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>A descriptive label that is associated with a game session. Session names do not need to be unique.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>A policy that determines whether the game session is accepting new players.</p>
pub fn player_session_creation_policy(mut self, input: crate::types::PlayerSessionCreationPolicy) -> Self {
self.player_session_creation_policy = ::std::option::Option::Some(input);
self
}
/// <p>A policy that determines whether the game session is accepting new players.</p>
pub fn set_player_session_creation_policy(mut self, input: ::std::option::Option<crate::types::PlayerSessionCreationPolicy>) -> Self {
self.player_session_creation_policy = input;
self
}
/// <p>A policy that determines whether the game session is accepting new players.</p>
pub fn get_player_session_creation_policy(&self) -> &::std::option::Option<crate::types::PlayerSessionCreationPolicy> {
&self.player_session_creation_policy
}
/// <p>Game session protection policy to apply to this game session only.</p>
/// <ul>
/// <li>
/// <p><code>NoProtection</code> -- The game session can be terminated during a scale-down event.</p></li>
/// <li>
/// <p><code>FullProtection</code> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p></li>
/// </ul>
pub fn protection_policy(mut self, input: crate::types::ProtectionPolicy) -> Self {
self.protection_policy = ::std::option::Option::Some(input);
self
}
/// <p>Game session protection policy to apply to this game session only.</p>
/// <ul>
/// <li>
/// <p><code>NoProtection</code> -- The game session can be terminated during a scale-down event.</p></li>
/// <li>
/// <p><code>FullProtection</code> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p></li>
/// </ul>
pub fn set_protection_policy(mut self, input: ::std::option::Option<crate::types::ProtectionPolicy>) -> Self {
self.protection_policy = input;
self
}
/// <p>Game session protection policy to apply to this game session only.</p>
/// <ul>
/// <li>
/// <p><code>NoProtection</code> -- The game session can be terminated during a scale-down event.</p></li>
/// <li>
/// <p><code>FullProtection</code> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p></li>
/// </ul>
pub fn get_protection_policy(&self) -> &::std::option::Option<crate::types::ProtectionPolicy> {
&self.protection_policy
}
/// Appends an item to `game_properties`.
///
/// To override the contents of this collection use [`set_game_properties`](Self::set_game_properties).
///
/// <p>A set of key-value pairs that can store custom data in a game session. For example: <code>{"Key": "difficulty", "Value": "novice"}</code>. You can use this parameter to modify game properties in an active game session. This action adds new properties and modifies existing properties. There is no way to delete properties. For an example, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#game-properties-update">Update the value of a game property</a>.</p><note>
/// <ul>
/// <li>
/// <p>Avoid using periods (".") in property keys if you plan to search for game sessions by properties. Property keys containing periods cannot be searched and will be filtered out from search results due to search index limitations.</p></li>
/// <li>
/// <p>If you use SearchGameSessions API, there is a limit of 500 game property keys across all game sessions and all fleets per region. If the limit is exceeded, there will potentially be game session entries missing from SearchGameSessions API results.</p></li>
/// </ul>
/// </note>
pub fn game_properties(mut self, input: crate::types::GameProperty) -> Self {
let mut v = self.game_properties.unwrap_or_default();
v.push(input);
self.game_properties = ::std::option::Option::Some(v);
self
}
/// <p>A set of key-value pairs that can store custom data in a game session. For example: <code>{"Key": "difficulty", "Value": "novice"}</code>. You can use this parameter to modify game properties in an active game session. This action adds new properties and modifies existing properties. There is no way to delete properties. For an example, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#game-properties-update">Update the value of a game property</a>.</p><note>
/// <ul>
/// <li>
/// <p>Avoid using periods (".") in property keys if you plan to search for game sessions by properties. Property keys containing periods cannot be searched and will be filtered out from search results due to search index limitations.</p></li>
/// <li>
/// <p>If you use SearchGameSessions API, there is a limit of 500 game property keys across all game sessions and all fleets per region. If the limit is exceeded, there will potentially be game session entries missing from SearchGameSessions API results.</p></li>
/// </ul>
/// </note>
pub fn set_game_properties(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GameProperty>>) -> Self {
self.game_properties = input;
self
}
/// <p>A set of key-value pairs that can store custom data in a game session. For example: <code>{"Key": "difficulty", "Value": "novice"}</code>. You can use this parameter to modify game properties in an active game session. This action adds new properties and modifies existing properties. There is no way to delete properties. For an example, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#game-properties-update">Update the value of a game property</a>.</p><note>
/// <ul>
/// <li>
/// <p>Avoid using periods (".") in property keys if you plan to search for game sessions by properties. Property keys containing periods cannot be searched and will be filtered out from search results due to search index limitations.</p></li>
/// <li>
/// <p>If you use SearchGameSessions API, there is a limit of 500 game property keys across all game sessions and all fleets per region. If the limit is exceeded, there will potentially be game session entries missing from SearchGameSessions API results.</p></li>
/// </ul>
/// </note>
pub fn get_game_properties(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GameProperty>> {
&self.game_properties
}
/// Consumes the builder and constructs a [`UpdateGameSessionInput`](crate::operation::update_game_session::UpdateGameSessionInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::update_game_session::UpdateGameSessionInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::update_game_session::UpdateGameSessionInput {
game_session_id: self.game_session_id,
maximum_player_session_count: self.maximum_player_session_count,
name: self.name,
player_session_creation_policy: self.player_session_creation_policy,
protection_policy: self.protection_policy,
game_properties: self.game_properties,
})
}
}