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)]
pub struct CreatePlayerSessionInput {
    /// <p>An identifier for the game session that is unique across all regions to add a player to. 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>A unique identifier for a player. Player IDs are developer-defined.</p>
    pub player_id: ::std::option::Option<::std::string::String>,
    /// <p>Developer-defined information related to a player. Amazon GameLift Servers does not use this data, so it can be formatted as needed for use in the game.</p>
    pub player_data: ::std::option::Option<::std::string::String>,
}
impl CreatePlayerSessionInput {
    /// <p>An identifier for the game session that is unique across all regions to add a player to. 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>A unique identifier for a player. Player IDs are developer-defined.</p>
    pub fn player_id(&self) -> ::std::option::Option<&str> {
        self.player_id.as_deref()
    }
    /// <p>Developer-defined information related to a player. Amazon GameLift Servers does not use this data, so it can be formatted as needed for use in the game.</p>
    pub fn player_data(&self) -> ::std::option::Option<&str> {
        self.player_data.as_deref()
    }
}
impl ::std::fmt::Debug for CreatePlayerSessionInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreatePlayerSessionInput");
        formatter.field("game_session_id", &self.game_session_id);
        formatter.field("player_id", &"*** Sensitive Data Redacted ***");
        formatter.field("player_data", &self.player_data);
        formatter.finish()
    }
}
impl CreatePlayerSessionInput {
    /// Creates a new builder-style object to manufacture [`CreatePlayerSessionInput`](crate::operation::create_player_session::CreatePlayerSessionInput).
    pub fn builder() -> crate::operation::create_player_session::builders::CreatePlayerSessionInputBuilder {
        crate::operation::create_player_session::builders::CreatePlayerSessionInputBuilder::default()
    }
}

/// A builder for [`CreatePlayerSessionInput`](crate::operation::create_player_session::CreatePlayerSessionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreatePlayerSessionInputBuilder {
    pub(crate) game_session_id: ::std::option::Option<::std::string::String>,
    pub(crate) player_id: ::std::option::Option<::std::string::String>,
    pub(crate) player_data: ::std::option::Option<::std::string::String>,
}
impl CreatePlayerSessionInputBuilder {
    /// <p>An identifier for the game session that is unique across all regions to add a player to. 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 add a player to. 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 add a player to. 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>A unique identifier for a player. Player IDs are developer-defined.</p>
    /// This field is required.
    pub fn player_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.player_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique identifier for a player. Player IDs are developer-defined.</p>
    pub fn set_player_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.player_id = input;
        self
    }
    /// <p>A unique identifier for a player. Player IDs are developer-defined.</p>
    pub fn get_player_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.player_id
    }
    /// <p>Developer-defined information related to a player. Amazon GameLift Servers does not use this data, so it can be formatted as needed for use in the game.</p>
    pub fn player_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.player_data = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Developer-defined information related to a player. Amazon GameLift Servers does not use this data, so it can be formatted as needed for use in the game.</p>
    pub fn set_player_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.player_data = input;
        self
    }
    /// <p>Developer-defined information related to a player. Amazon GameLift Servers does not use this data, so it can be formatted as needed for use in the game.</p>
    pub fn get_player_data(&self) -> &::std::option::Option<::std::string::String> {
        &self.player_data
    }
    /// Consumes the builder and constructs a [`CreatePlayerSessionInput`](crate::operation::create_player_session::CreatePlayerSessionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_player_session::CreatePlayerSessionInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_player_session::CreatePlayerSessionInput {
            game_session_id: self.game_session_id,
            player_id: self.player_id,
            player_data: self.player_data,
        })
    }
}
impl ::std::fmt::Debug for CreatePlayerSessionInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreatePlayerSessionInputBuilder");
        formatter.field("game_session_id", &self.game_session_id);
        formatter.field("player_id", &"*** Sensitive Data Redacted ***");
        formatter.field("player_data", &self.player_data);
        formatter.finish()
    }
}