/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace GameLift { namespace Model { /** *

Represents a player session. Player sessions are created either for a * specific game session, or as part of a game session placement or matchmaking * request. A player session can represents a reserved player slot in a game * session (when status is RESERVED) or actual player activity in a * game session (when status is ACTIVE). A player session object, * including player data, is automatically passed to a game session when the player * connects to the game session and is validated. After the game session ends, * player sessions information is retained for 30 days and then removed.

* Related actions

All * APIs by task

See Also:

AWS * API Reference

*/ class PlayerSession { public: AWS_GAMELIFT_API PlayerSession(); AWS_GAMELIFT_API PlayerSession(Aws::Utils::Json::JsonView jsonValue); AWS_GAMELIFT_API PlayerSession& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_GAMELIFT_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

A unique identifier for a player session.

*/ inline const Aws::String& GetPlayerSessionId() const{ return m_playerSessionId; } /** *

A unique identifier for a player session.

*/ inline bool PlayerSessionIdHasBeenSet() const { return m_playerSessionIdHasBeenSet; } /** *

A unique identifier for a player session.

*/ inline void SetPlayerSessionId(const Aws::String& value) { m_playerSessionIdHasBeenSet = true; m_playerSessionId = value; } /** *

A unique identifier for a player session.

*/ inline void SetPlayerSessionId(Aws::String&& value) { m_playerSessionIdHasBeenSet = true; m_playerSessionId = std::move(value); } /** *

A unique identifier for a player session.

*/ inline void SetPlayerSessionId(const char* value) { m_playerSessionIdHasBeenSet = true; m_playerSessionId.assign(value); } /** *

A unique identifier for a player session.

*/ inline PlayerSession& WithPlayerSessionId(const Aws::String& value) { SetPlayerSessionId(value); return *this;} /** *

A unique identifier for a player session.

*/ inline PlayerSession& WithPlayerSessionId(Aws::String&& value) { SetPlayerSessionId(std::move(value)); return *this;} /** *

A unique identifier for a player session.

*/ inline PlayerSession& WithPlayerSessionId(const char* value) { SetPlayerSessionId(value); return *this;} /** *

A unique identifier for a player that is associated with this player * session.

*/ inline const Aws::String& GetPlayerId() const{ return m_playerId; } /** *

A unique identifier for a player that is associated with this player * session.

*/ inline bool PlayerIdHasBeenSet() const { return m_playerIdHasBeenSet; } /** *

A unique identifier for a player that is associated with this player * session.

*/ inline void SetPlayerId(const Aws::String& value) { m_playerIdHasBeenSet = true; m_playerId = value; } /** *

A unique identifier for a player that is associated with this player * session.

*/ inline void SetPlayerId(Aws::String&& value) { m_playerIdHasBeenSet = true; m_playerId = std::move(value); } /** *

A unique identifier for a player that is associated with this player * session.

*/ inline void SetPlayerId(const char* value) { m_playerIdHasBeenSet = true; m_playerId.assign(value); } /** *

A unique identifier for a player that is associated with this player * session.

*/ inline PlayerSession& WithPlayerId(const Aws::String& value) { SetPlayerId(value); return *this;} /** *

A unique identifier for a player that is associated with this player * session.

*/ inline PlayerSession& WithPlayerId(Aws::String&& value) { SetPlayerId(std::move(value)); return *this;} /** *

A unique identifier for a player that is associated with this player * session.

*/ inline PlayerSession& WithPlayerId(const char* value) { SetPlayerId(value); return *this;} /** *

A unique identifier for the game session that the player session is connected * to.

*/ inline const Aws::String& GetGameSessionId() const{ return m_gameSessionId; } /** *

A unique identifier for the game session that the player session is connected * to.

*/ inline bool GameSessionIdHasBeenSet() const { return m_gameSessionIdHasBeenSet; } /** *

A unique identifier for the game session that the player session is connected * to.

*/ inline void SetGameSessionId(const Aws::String& value) { m_gameSessionIdHasBeenSet = true; m_gameSessionId = value; } /** *

A unique identifier for the game session that the player session is connected * to.

*/ inline void SetGameSessionId(Aws::String&& value) { m_gameSessionIdHasBeenSet = true; m_gameSessionId = std::move(value); } /** *

A unique identifier for the game session that the player session is connected * to.

*/ inline void SetGameSessionId(const char* value) { m_gameSessionIdHasBeenSet = true; m_gameSessionId.assign(value); } /** *

A unique identifier for the game session that the player session is connected * to.

*/ inline PlayerSession& WithGameSessionId(const Aws::String& value) { SetGameSessionId(value); return *this;} /** *

A unique identifier for the game session that the player session is connected * to.

*/ inline PlayerSession& WithGameSessionId(Aws::String&& value) { SetGameSessionId(std::move(value)); return *this;} /** *

A unique identifier for the game session that the player session is connected * to.

*/ inline PlayerSession& WithGameSessionId(const char* value) { SetGameSessionId(value); return *this;} /** *

A unique identifier for the fleet that the player's game session is running * on.

*/ inline const Aws::String& GetFleetId() const{ return m_fleetId; } /** *

A unique identifier for the fleet that the player's game session is running * on.

*/ inline bool FleetIdHasBeenSet() const { return m_fleetIdHasBeenSet; } /** *

A unique identifier for the fleet that the player's game session is running * on.

*/ inline void SetFleetId(const Aws::String& value) { m_fleetIdHasBeenSet = true; m_fleetId = value; } /** *

A unique identifier for the fleet that the player's game session is running * on.

*/ inline void SetFleetId(Aws::String&& value) { m_fleetIdHasBeenSet = true; m_fleetId = std::move(value); } /** *

A unique identifier for the fleet that the player's game session is running * on.

*/ inline void SetFleetId(const char* value) { m_fleetIdHasBeenSet = true; m_fleetId.assign(value); } /** *

A unique identifier for the fleet that the player's game session is running * on.

*/ inline PlayerSession& WithFleetId(const Aws::String& value) { SetFleetId(value); return *this;} /** *

A unique identifier for the fleet that the player's game session is running * on.

*/ inline PlayerSession& WithFleetId(Aws::String&& value) { SetFleetId(std::move(value)); return *this;} /** *

A unique identifier for the fleet that the player's game session is running * on.

*/ inline PlayerSession& WithFleetId(const char* value) { SetFleetId(value); return *this;} /** *

The Amazon Resource Name (ARN) * associated with the GameLift fleet that the player's game session is running on. *

*/ inline const Aws::String& GetFleetArn() const{ return m_fleetArn; } /** *

The Amazon Resource Name (ARN) * associated with the GameLift fleet that the player's game session is running on. *

*/ inline bool FleetArnHasBeenSet() const { return m_fleetArnHasBeenSet; } /** *

The Amazon Resource Name (ARN) * associated with the GameLift fleet that the player's game session is running on. *

*/ inline void SetFleetArn(const Aws::String& value) { m_fleetArnHasBeenSet = true; m_fleetArn = value; } /** *

The Amazon Resource Name (ARN) * associated with the GameLift fleet that the player's game session is running on. *

*/ inline void SetFleetArn(Aws::String&& value) { m_fleetArnHasBeenSet = true; m_fleetArn = std::move(value); } /** *

The Amazon Resource Name (ARN) * associated with the GameLift fleet that the player's game session is running on. *

*/ inline void SetFleetArn(const char* value) { m_fleetArnHasBeenSet = true; m_fleetArn.assign(value); } /** *

The Amazon Resource Name (ARN) * associated with the GameLift fleet that the player's game session is running on. *

*/ inline PlayerSession& WithFleetArn(const Aws::String& value) { SetFleetArn(value); return *this;} /** *

The Amazon Resource Name (ARN) * associated with the GameLift fleet that the player's game session is running on. *

*/ inline PlayerSession& WithFleetArn(Aws::String&& value) { SetFleetArn(std::move(value)); return *this;} /** *

The Amazon Resource Name (ARN) * associated with the GameLift fleet that the player's game session is running on. *

*/ inline PlayerSession& WithFleetArn(const char* value) { SetFleetArn(value); return *this;} /** *

A time stamp indicating when this data object was created. Format is a number * expressed in Unix time as milliseconds (for example * "1469498468.057").

*/ inline const Aws::Utils::DateTime& GetCreationTime() const{ return m_creationTime; } /** *

A time stamp indicating when this data object was created. Format is a number * expressed in Unix time as milliseconds (for example * "1469498468.057").

*/ inline bool CreationTimeHasBeenSet() const { return m_creationTimeHasBeenSet; } /** *

A time stamp indicating when this data object was created. Format is a number * expressed in Unix time as milliseconds (for example * "1469498468.057").

*/ inline void SetCreationTime(const Aws::Utils::DateTime& value) { m_creationTimeHasBeenSet = true; m_creationTime = value; } /** *

A time stamp indicating when this data object was created. Format is a number * expressed in Unix time as milliseconds (for example * "1469498468.057").

*/ inline void SetCreationTime(Aws::Utils::DateTime&& value) { m_creationTimeHasBeenSet = true; m_creationTime = std::move(value); } /** *

A time stamp indicating when this data object was created. Format is a number * expressed in Unix time as milliseconds (for example * "1469498468.057").

*/ inline PlayerSession& WithCreationTime(const Aws::Utils::DateTime& value) { SetCreationTime(value); return *this;} /** *

A time stamp indicating when this data object was created. Format is a number * expressed in Unix time as milliseconds (for example * "1469498468.057").

*/ inline PlayerSession& WithCreationTime(Aws::Utils::DateTime&& value) { SetCreationTime(std::move(value)); return *this;} /** *

A time stamp indicating when this data object was terminated. Format is a * number expressed in Unix time as milliseconds (for example * "1469498468.057").

*/ inline const Aws::Utils::DateTime& GetTerminationTime() const{ return m_terminationTime; } /** *

A time stamp indicating when this data object was terminated. Format is a * number expressed in Unix time as milliseconds (for example * "1469498468.057").

*/ inline bool TerminationTimeHasBeenSet() const { return m_terminationTimeHasBeenSet; } /** *

A time stamp indicating when this data object was terminated. Format is a * number expressed in Unix time as milliseconds (for example * "1469498468.057").

*/ inline void SetTerminationTime(const Aws::Utils::DateTime& value) { m_terminationTimeHasBeenSet = true; m_terminationTime = value; } /** *

A time stamp indicating when this data object was terminated. Format is a * number expressed in Unix time as milliseconds (for example * "1469498468.057").

*/ inline void SetTerminationTime(Aws::Utils::DateTime&& value) { m_terminationTimeHasBeenSet = true; m_terminationTime = std::move(value); } /** *

A time stamp indicating when this data object was terminated. Format is a * number expressed in Unix time as milliseconds (for example * "1469498468.057").

*/ inline PlayerSession& WithTerminationTime(const Aws::Utils::DateTime& value) { SetTerminationTime(value); return *this;} /** *

A time stamp indicating when this data object was terminated. Format is a * number expressed in Unix time as milliseconds (for example * "1469498468.057").

*/ inline PlayerSession& WithTerminationTime(Aws::Utils::DateTime&& value) { SetTerminationTime(std::move(value)); return *this;} /** *

Current status of the player session.

Possible player session statuses * include the following:

  • RESERVED -- The player session * request has been received, but the player has not yet connected to the server * process and/or been validated.

  • ACTIVE -- The player * has been validated by the server process and is currently connected.

  • *
  • COMPLETED -- The player connection has been dropped.

  • *
  • TIMEDOUT -- A player session request was received, but the * player did not connect and/or was not validated within the timeout limit (60 * seconds).

*/ inline const PlayerSessionStatus& GetStatus() const{ return m_status; } /** *

Current status of the player session.

Possible player session statuses * include the following:

  • RESERVED -- The player session * request has been received, but the player has not yet connected to the server * process and/or been validated.

  • ACTIVE -- The player * has been validated by the server process and is currently connected.

  • *
  • COMPLETED -- The player connection has been dropped.

  • *
  • TIMEDOUT -- A player session request was received, but the * player did not connect and/or was not validated within the timeout limit (60 * seconds).

*/ inline bool StatusHasBeenSet() const { return m_statusHasBeenSet; } /** *

Current status of the player session.

Possible player session statuses * include the following:

  • RESERVED -- The player session * request has been received, but the player has not yet connected to the server * process and/or been validated.

  • ACTIVE -- The player * has been validated by the server process and is currently connected.

  • *
  • COMPLETED -- The player connection has been dropped.

  • *
  • TIMEDOUT -- A player session request was received, but the * player did not connect and/or was not validated within the timeout limit (60 * seconds).

*/ inline void SetStatus(const PlayerSessionStatus& value) { m_statusHasBeenSet = true; m_status = value; } /** *

Current status of the player session.

Possible player session statuses * include the following:

  • RESERVED -- The player session * request has been received, but the player has not yet connected to the server * process and/or been validated.

  • ACTIVE -- The player * has been validated by the server process and is currently connected.

  • *
  • COMPLETED -- The player connection has been dropped.

  • *
  • TIMEDOUT -- A player session request was received, but the * player did not connect and/or was not validated within the timeout limit (60 * seconds).

*/ inline void SetStatus(PlayerSessionStatus&& value) { m_statusHasBeenSet = true; m_status = std::move(value); } /** *

Current status of the player session.

Possible player session statuses * include the following:

  • RESERVED -- The player session * request has been received, but the player has not yet connected to the server * process and/or been validated.

  • ACTIVE -- The player * has been validated by the server process and is currently connected.

  • *
  • COMPLETED -- The player connection has been dropped.

  • *
  • TIMEDOUT -- A player session request was received, but the * player did not connect and/or was not validated within the timeout limit (60 * seconds).

*/ inline PlayerSession& WithStatus(const PlayerSessionStatus& value) { SetStatus(value); return *this;} /** *

Current status of the player session.

Possible player session statuses * include the following:

  • RESERVED -- The player session * request has been received, but the player has not yet connected to the server * process and/or been validated.

  • ACTIVE -- The player * has been validated by the server process and is currently connected.

  • *
  • COMPLETED -- The player connection has been dropped.

  • *
  • TIMEDOUT -- A player session request was received, but the * player did not connect and/or was not validated within the timeout limit (60 * seconds).

*/ inline PlayerSession& WithStatus(PlayerSessionStatus&& value) { SetStatus(std::move(value)); return *this;} /** *

The IP address of the game session. To connect to a Amazon GameLift game * server, an app needs both the IP address and port number.

*/ inline const Aws::String& GetIpAddress() const{ return m_ipAddress; } /** *

The IP address of the game session. To connect to a Amazon GameLift game * server, an app needs both the IP address and port number.

*/ inline bool IpAddressHasBeenSet() const { return m_ipAddressHasBeenSet; } /** *

The IP address of the game session. To connect to a Amazon GameLift game * server, an app needs both the IP address and port number.

*/ inline void SetIpAddress(const Aws::String& value) { m_ipAddressHasBeenSet = true; m_ipAddress = value; } /** *

The IP address of the game session. To connect to a Amazon GameLift game * server, an app needs both the IP address and port number.

*/ inline void SetIpAddress(Aws::String&& value) { m_ipAddressHasBeenSet = true; m_ipAddress = std::move(value); } /** *

The IP address of the game session. To connect to a Amazon GameLift game * server, an app needs both the IP address and port number.

*/ inline void SetIpAddress(const char* value) { m_ipAddressHasBeenSet = true; m_ipAddress.assign(value); } /** *

The IP address of the game session. To connect to a Amazon GameLift game * server, an app needs both the IP address and port number.

*/ inline PlayerSession& WithIpAddress(const Aws::String& value) { SetIpAddress(value); return *this;} /** *

The IP address of the game session. To connect to a Amazon GameLift game * server, an app needs both the IP address and port number.

*/ inline PlayerSession& WithIpAddress(Aws::String&& value) { SetIpAddress(std::move(value)); return *this;} /** *

The IP address of the game session. To connect to a Amazon GameLift game * server, an app needs both the IP address and port number.

*/ inline PlayerSession& WithIpAddress(const char* value) { SetIpAddress(value); return *this;} /** *

The DNS identifier assigned to the instance that is running the game session. * Values have the following format:

  • TLS-enabled fleets: * <unique identifier>.<region * identifier>.amazongamelift.com.

  • Non-TLS-enabled * fleets: ec2-<unique identifier>.compute.amazonaws.com. (See * Amazon * EC2 Instance IP Addressing.)

When connecting to a game * session that is running on a TLS-enabled fleet, you must use the DNS name, not * the IP address.

*/ inline const Aws::String& GetDnsName() const{ return m_dnsName; } /** *

The DNS identifier assigned to the instance that is running the game session. * Values have the following format:

  • TLS-enabled fleets: * <unique identifier>.<region * identifier>.amazongamelift.com.

  • Non-TLS-enabled * fleets: ec2-<unique identifier>.compute.amazonaws.com. (See * Amazon * EC2 Instance IP Addressing.)

When connecting to a game * session that is running on a TLS-enabled fleet, you must use the DNS name, not * the IP address.

*/ inline bool DnsNameHasBeenSet() const { return m_dnsNameHasBeenSet; } /** *

The DNS identifier assigned to the instance that is running the game session. * Values have the following format:

  • TLS-enabled fleets: * <unique identifier>.<region * identifier>.amazongamelift.com.

  • Non-TLS-enabled * fleets: ec2-<unique identifier>.compute.amazonaws.com. (See * Amazon * EC2 Instance IP Addressing.)

When connecting to a game * session that is running on a TLS-enabled fleet, you must use the DNS name, not * the IP address.

*/ inline void SetDnsName(const Aws::String& value) { m_dnsNameHasBeenSet = true; m_dnsName = value; } /** *

The DNS identifier assigned to the instance that is running the game session. * Values have the following format:

  • TLS-enabled fleets: * <unique identifier>.<region * identifier>.amazongamelift.com.

  • Non-TLS-enabled * fleets: ec2-<unique identifier>.compute.amazonaws.com. (See * Amazon * EC2 Instance IP Addressing.)

When connecting to a game * session that is running on a TLS-enabled fleet, you must use the DNS name, not * the IP address.

*/ inline void SetDnsName(Aws::String&& value) { m_dnsNameHasBeenSet = true; m_dnsName = std::move(value); } /** *

The DNS identifier assigned to the instance that is running the game session. * Values have the following format:

  • TLS-enabled fleets: * <unique identifier>.<region * identifier>.amazongamelift.com.

  • Non-TLS-enabled * fleets: ec2-<unique identifier>.compute.amazonaws.com. (See * Amazon * EC2 Instance IP Addressing.)

When connecting to a game * session that is running on a TLS-enabled fleet, you must use the DNS name, not * the IP address.

*/ inline void SetDnsName(const char* value) { m_dnsNameHasBeenSet = true; m_dnsName.assign(value); } /** *

The DNS identifier assigned to the instance that is running the game session. * Values have the following format:

  • TLS-enabled fleets: * <unique identifier>.<region * identifier>.amazongamelift.com.

  • Non-TLS-enabled * fleets: ec2-<unique identifier>.compute.amazonaws.com. (See * Amazon * EC2 Instance IP Addressing.)

When connecting to a game * session that is running on a TLS-enabled fleet, you must use the DNS name, not * the IP address.

*/ inline PlayerSession& WithDnsName(const Aws::String& value) { SetDnsName(value); return *this;} /** *

The DNS identifier assigned to the instance that is running the game session. * Values have the following format:

  • TLS-enabled fleets: * <unique identifier>.<region * identifier>.amazongamelift.com.

  • Non-TLS-enabled * fleets: ec2-<unique identifier>.compute.amazonaws.com. (See * Amazon * EC2 Instance IP Addressing.)

When connecting to a game * session that is running on a TLS-enabled fleet, you must use the DNS name, not * the IP address.

*/ inline PlayerSession& WithDnsName(Aws::String&& value) { SetDnsName(std::move(value)); return *this;} /** *

The DNS identifier assigned to the instance that is running the game session. * Values have the following format:

  • TLS-enabled fleets: * <unique identifier>.<region * identifier>.amazongamelift.com.

  • Non-TLS-enabled * fleets: ec2-<unique identifier>.compute.amazonaws.com. (See * Amazon * EC2 Instance IP Addressing.)

When connecting to a game * session that is running on a TLS-enabled fleet, you must use the DNS name, not * the IP address.

*/ inline PlayerSession& WithDnsName(const char* value) { SetDnsName(value); return *this;} /** *

Port number for the game session. To connect to a Amazon GameLift server * process, an app needs both the IP address and port number.

*/ inline int GetPort() const{ return m_port; } /** *

Port number for the game session. To connect to a Amazon GameLift server * process, an app needs both the IP address and port number.

*/ inline bool PortHasBeenSet() const { return m_portHasBeenSet; } /** *

Port number for the game session. To connect to a Amazon GameLift server * process, an app needs both the IP address and port number.

*/ inline void SetPort(int value) { m_portHasBeenSet = true; m_port = value; } /** *

Port number for the game session. To connect to a Amazon GameLift server * process, an app needs both the IP address and port number.

*/ inline PlayerSession& WithPort(int value) { SetPort(value); return *this;} /** *

Developer-defined information related to a player. Amazon GameLift does not * use this data, so it can be formatted as needed for use in the game.

*/ inline const Aws::String& GetPlayerData() const{ return m_playerData; } /** *

Developer-defined information related to a player. Amazon GameLift does not * use this data, so it can be formatted as needed for use in the game.

*/ inline bool PlayerDataHasBeenSet() const { return m_playerDataHasBeenSet; } /** *

Developer-defined information related to a player. Amazon GameLift does not * use this data, so it can be formatted as needed for use in the game.

*/ inline void SetPlayerData(const Aws::String& value) { m_playerDataHasBeenSet = true; m_playerData = value; } /** *

Developer-defined information related to a player. Amazon GameLift does not * use this data, so it can be formatted as needed for use in the game.

*/ inline void SetPlayerData(Aws::String&& value) { m_playerDataHasBeenSet = true; m_playerData = std::move(value); } /** *

Developer-defined information related to a player. Amazon GameLift does not * use this data, so it can be formatted as needed for use in the game.

*/ inline void SetPlayerData(const char* value) { m_playerDataHasBeenSet = true; m_playerData.assign(value); } /** *

Developer-defined information related to a player. Amazon GameLift does not * use this data, so it can be formatted as needed for use in the game.

*/ inline PlayerSession& WithPlayerData(const Aws::String& value) { SetPlayerData(value); return *this;} /** *

Developer-defined information related to a player. Amazon GameLift does not * use this data, so it can be formatted as needed for use in the game.

*/ inline PlayerSession& WithPlayerData(Aws::String&& value) { SetPlayerData(std::move(value)); return *this;} /** *

Developer-defined information related to a player. Amazon GameLift does not * use this data, so it can be formatted as needed for use in the game.

*/ inline PlayerSession& WithPlayerData(const char* value) { SetPlayerData(value); return *this;} private: Aws::String m_playerSessionId; bool m_playerSessionIdHasBeenSet = false; Aws::String m_playerId; bool m_playerIdHasBeenSet = false; Aws::String m_gameSessionId; bool m_gameSessionIdHasBeenSet = false; Aws::String m_fleetId; bool m_fleetIdHasBeenSet = false; Aws::String m_fleetArn; bool m_fleetArnHasBeenSet = false; Aws::Utils::DateTime m_creationTime; bool m_creationTimeHasBeenSet = false; Aws::Utils::DateTime m_terminationTime; bool m_terminationTimeHasBeenSet = false; PlayerSessionStatus m_status; bool m_statusHasBeenSet = false; Aws::String m_ipAddress; bool m_ipAddressHasBeenSet = false; Aws::String m_dnsName; bool m_dnsNameHasBeenSet = false; int m_port; bool m_portHasBeenSet = false; Aws::String m_playerData; bool m_playerDataHasBeenSet = false; }; } // namespace Model } // namespace GameLift } // namespace Aws