aws-sdk-gamelift 0.26.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 CreateGameSessionInput {
    /// <p>A unique identifier for the fleet to create a game session in. You can use either the fleet ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
    #[doc(hidden)]
    pub fleet_id: std::option::Option<std::string::String>,
    /// <p>A unique identifier for the alias associated with the fleet to create a game session in. You can use either the alias ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
    #[doc(hidden)]
    pub alias_id: std::option::Option<std::string::String>,
    /// <p>The maximum number of players that can be connected simultaneously to the game session.</p>
    #[doc(hidden)]
    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>
    #[doc(hidden)]
    pub name: std::option::Option<std::string::String>,
    /// <p>A set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
    #[doc(hidden)]
    pub game_properties: std::option::Option<std::vec::Vec<crate::types::GameProperty>>,
    /// <p>A unique identifier for a player or entity creating the game session. This parameter is required when requesting a new game session on a fleet with a resource creation limit policy. This type of policy limits the number of concurrent active game sessions that one player can create within a certain time span. GameLift uses the CreatorId to evaluate the new request against the policy.</p>
    #[doc(hidden)]
    pub creator_id: std::option::Option<std::string::String>,
    /// <p> <i>This parameter is deprecated. Use <code>IdempotencyToken</code> instead.</i> </p>
    /// <p>Custom string that uniquely identifies a request for a new game session. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID.</p>
    #[doc(hidden)]
    pub game_session_id: std::option::Option<std::string::String>,
    /// <p>Custom string that uniquely identifies the new game session request. This is useful for ensuring that game session requests with the same idempotency token are processed only once. Subsequent requests with the same string return the original <code>GameSession</code> object, with an updated status. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID. A game session ARN has the following format: <code>arn:aws:gamelift:
    /// <region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <custom id string or idempotency token></custom>
    /// </fleet>
    /// </region></code>. Idempotency tokens remain in use for 30 days after a game session has ended; game session objects are retained for this time period and then deleted.</p>
    #[doc(hidden)]
    pub idempotency_token: std::option::Option<std::string::String>,
    /// <p>A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
    #[doc(hidden)]
    pub game_session_data: std::option::Option<std::string::String>,
    /// <p>A fleet's remote location to place the new game session in. If this parameter is not set, the new game session is placed in the fleet's home Region. Specify a remote location with an Amazon Web Services Region code such as <code>us-west-2</code>. </p>
    #[doc(hidden)]
    pub location: std::option::Option<std::string::String>,
}
impl CreateGameSessionInput {
    /// <p>A unique identifier for the fleet to create a game session in. You can use either the fleet ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
    pub fn fleet_id(&self) -> std::option::Option<&str> {
        self.fleet_id.as_deref()
    }
    /// <p>A unique identifier for the alias associated with the fleet to create a game session in. You can use either the alias ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
    pub fn alias_id(&self) -> std::option::Option<&str> {
        self.alias_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 set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
    pub fn game_properties(&self) -> std::option::Option<&[crate::types::GameProperty]> {
        self.game_properties.as_deref()
    }
    /// <p>A unique identifier for a player or entity creating the game session. This parameter is required when requesting a new game session on a fleet with a resource creation limit policy. This type of policy limits the number of concurrent active game sessions that one player can create within a certain time span. GameLift uses the CreatorId to evaluate the new request against the policy.</p>
    pub fn creator_id(&self) -> std::option::Option<&str> {
        self.creator_id.as_deref()
    }
    /// <p> <i>This parameter is deprecated. Use <code>IdempotencyToken</code> instead.</i> </p>
    /// <p>Custom string that uniquely identifies a request for a new game session. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID.</p>
    pub fn game_session_id(&self) -> std::option::Option<&str> {
        self.game_session_id.as_deref()
    }
    /// <p>Custom string that uniquely identifies the new game session request. This is useful for ensuring that game session requests with the same idempotency token are processed only once. Subsequent requests with the same string return the original <code>GameSession</code> object, with an updated status. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID. A game session ARN has the following format: <code>arn:aws:gamelift:
    /// <region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <custom id string or idempotency token></custom>
    /// </fleet>
    /// </region></code>. Idempotency tokens remain in use for 30 days after a game session has ended; game session objects are retained for this time period and then deleted.</p>
    pub fn idempotency_token(&self) -> std::option::Option<&str> {
        self.idempotency_token.as_deref()
    }
    /// <p>A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
    pub fn game_session_data(&self) -> std::option::Option<&str> {
        self.game_session_data.as_deref()
    }
    /// <p>A fleet's remote location to place the new game session in. If this parameter is not set, the new game session is placed in the fleet's home Region. Specify a remote location with an Amazon Web Services Region code such as <code>us-west-2</code>. </p>
    pub fn location(&self) -> std::option::Option<&str> {
        self.location.as_deref()
    }
}
impl CreateGameSessionInput {
    /// Creates a new builder-style object to manufacture [`CreateGameSessionInput`](crate::operation::create_game_session::CreateGameSessionInput).
    pub fn builder(
    ) -> crate::operation::create_game_session::builders::CreateGameSessionInputBuilder {
        crate::operation::create_game_session::builders::CreateGameSessionInputBuilder::default()
    }
}

/// A builder for [`CreateGameSessionInput`](crate::operation::create_game_session::CreateGameSessionInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct CreateGameSessionInputBuilder {
    pub(crate) fleet_id: std::option::Option<std::string::String>,
    pub(crate) alias_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) game_properties: std::option::Option<std::vec::Vec<crate::types::GameProperty>>,
    pub(crate) creator_id: std::option::Option<std::string::String>,
    pub(crate) game_session_id: std::option::Option<std::string::String>,
    pub(crate) idempotency_token: std::option::Option<std::string::String>,
    pub(crate) game_session_data: std::option::Option<std::string::String>,
    pub(crate) location: std::option::Option<std::string::String>,
}
impl CreateGameSessionInputBuilder {
    /// <p>A unique identifier for the fleet to create a game session in. You can use either the fleet ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
    pub fn fleet_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.fleet_id = Some(input.into());
        self
    }
    /// <p>A unique identifier for the fleet to create a game session in. You can use either the fleet ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
    pub fn set_fleet_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.fleet_id = input;
        self
    }
    /// <p>A unique identifier for the alias associated with the fleet to create a game session in. You can use either the alias ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
    pub fn alias_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.alias_id = Some(input.into());
        self
    }
    /// <p>A unique identifier for the alias associated with the fleet to create a game session in. You can use either the alias ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
    pub fn set_alias_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.alias_id = input;
        self
    }
    /// <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 = 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>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 Into<std::string::String>) -> Self {
        self.name = 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
    }
    /// 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 custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
    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 = Some(v);
        self
    }
    /// <p>A set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
    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 unique identifier for a player or entity creating the game session. This parameter is required when requesting a new game session on a fleet with a resource creation limit policy. This type of policy limits the number of concurrent active game sessions that one player can create within a certain time span. GameLift uses the CreatorId to evaluate the new request against the policy.</p>
    pub fn creator_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.creator_id = Some(input.into());
        self
    }
    /// <p>A unique identifier for a player or entity creating the game session. This parameter is required when requesting a new game session on a fleet with a resource creation limit policy. This type of policy limits the number of concurrent active game sessions that one player can create within a certain time span. GameLift uses the CreatorId to evaluate the new request against the policy.</p>
    pub fn set_creator_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.creator_id = input;
        self
    }
    /// <p> <i>This parameter is deprecated. Use <code>IdempotencyToken</code> instead.</i> </p>
    /// <p>Custom string that uniquely identifies a request for a new game session. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID.</p>
    pub fn game_session_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.game_session_id = Some(input.into());
        self
    }
    /// <p> <i>This parameter is deprecated. Use <code>IdempotencyToken</code> instead.</i> </p>
    /// <p>Custom string that uniquely identifies a request for a new game session. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID.</p>
    pub fn set_game_session_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.game_session_id = input;
        self
    }
    /// <p>Custom string that uniquely identifies the new game session request. This is useful for ensuring that game session requests with the same idempotency token are processed only once. Subsequent requests with the same string return the original <code>GameSession</code> object, with an updated status. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID. A game session ARN has the following format: <code>arn:aws:gamelift:
    /// <region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <custom id string or idempotency token></custom>
    /// </fleet>
    /// </region></code>. Idempotency tokens remain in use for 30 days after a game session has ended; game session objects are retained for this time period and then deleted.</p>
    pub fn idempotency_token(mut self, input: impl Into<std::string::String>) -> Self {
        self.idempotency_token = Some(input.into());
        self
    }
    /// <p>Custom string that uniquely identifies the new game session request. This is useful for ensuring that game session requests with the same idempotency token are processed only once. Subsequent requests with the same string return the original <code>GameSession</code> object, with an updated status. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID. A game session ARN has the following format: <code>arn:aws:gamelift:
    /// <region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <custom id string or idempotency token></custom>
    /// </fleet>
    /// </region></code>. Idempotency tokens remain in use for 30 days after a game session has ended; game session objects are retained for this time period and then deleted.</p>
    pub fn set_idempotency_token(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.idempotency_token = input;
        self
    }
    /// <p>A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
    pub fn game_session_data(mut self, input: impl Into<std::string::String>) -> Self {
        self.game_session_data = Some(input.into());
        self
    }
    /// <p>A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
    pub fn set_game_session_data(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.game_session_data = input;
        self
    }
    /// <p>A fleet's remote location to place the new game session in. If this parameter is not set, the new game session is placed in the fleet's home Region. Specify a remote location with an Amazon Web Services Region code such as <code>us-west-2</code>. </p>
    pub fn location(mut self, input: impl Into<std::string::String>) -> Self {
        self.location = Some(input.into());
        self
    }
    /// <p>A fleet's remote location to place the new game session in. If this parameter is not set, the new game session is placed in the fleet's home Region. Specify a remote location with an Amazon Web Services Region code such as <code>us-west-2</code>. </p>
    pub fn set_location(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.location = input;
        self
    }
    /// Consumes the builder and constructs a [`CreateGameSessionInput`](crate::operation::create_game_session::CreateGameSessionInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::create_game_session::CreateGameSessionInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(
            crate::operation::create_game_session::CreateGameSessionInput {
                fleet_id: self.fleet_id,
                alias_id: self.alias_id,
                maximum_player_session_count: self.maximum_player_session_count,
                name: self.name,
                game_properties: self.game_properties,
                creator_id: self.creator_id,
                game_session_id: self.game_session_id,
                idempotency_token: self.idempotency_token,
                game_session_data: self.game_session_data,
                location: self.location,
            },
        )
    }
}