GS2-Matchmaking SDK API Reference

Specification of models and API references for GS2-Matchmaking SDK for various programming languages

Models

Namespace

Namespace

A Namespace allows multiple independent instances of the same service within a single project by separating data spaces and usage contexts. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the namespace differs, the data is treated as a completely independent data space.

Therefore, you must create a namespace before you can start using each service.

Details
Type Condition Required Default Value Limits Description
namespaceId string
*
~ 1024 chars Namespace GRN
* Set automatically by the server
name string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
transactionSetting TransactionSetting Transaction Settings
Configuration for controlling how transactions are processed when executing matchmaking operations.
enableRating bool false Enable Rating
Whether to enable the Glicko-2 based rating calculation function.
When enabled, players can submit match results via the Vote system and have their ratings automatically updated.
Requires RatingModel master data to be configured. Defaults to false.
enableDisconnectDetection string (enum)
enum {
  “disable”,
  “enable”
}
“disable” Disconnect Detection
Controls whether players in matchmaking must periodically report they are still waiting.
When enabled, if a player does not send a keep-alive within the configured timeout period, they are automatically removed from the Gathering.
This prevents “ghost” players from blocking matchmaking completion. Defaults to “disable”.
DefinitionDescription
“disable”Disable
“enable”Enable
disconnectDetectionTimeoutSeconds int {enableDisconnectDetection} == “enable”
✓*
15 ~ 600 Disconnect Detection Timeout (seconds)
The number of seconds to wait without a keep-alive report before a player is considered disconnected and removed from the Gathering.
Only applies when disconnect detection is enabled. Must be between 15 and 600 seconds.
* Required if enableDisconnectDetection is “enable”
createGatheringTriggerType string (enum)
enum {
  “none”,
  “gs2_realtime”,
  “gs2_script”
}
“none” Create Gathering Trigger Type
The type of action to execute when a new Gathering is created.
Can trigger GS2-Realtime room creation for real-time communication, or execute a GS2-Script for custom logic. Defaults to “none”.
DefinitionDescription
“none”None
“gs2_realtime”GS2-Realtime Room Creation
“gs2_script”GS2-Script Execution
createGatheringTriggerRealtimeNamespaceId string {createGatheringTriggerType} == “gs2_realtime”
✓*
~ 1024 chars GS2-Realtime namespace to create rooms when creating a gathering
* Required if createGatheringTriggerType is “gs2_realtime”
createGatheringTriggerScriptId string {createGatheringTriggerType} == “gs2_script”
✓*
~ 1024 chars GS2-Script script GRN to be executed when creating a gathering
Script Trigger Reference - createGathering
* Required if createGatheringTriggerType is “gs2_script”
completeMatchmakingTriggerType string (enum)
enum {
  “none”,
  “gs2_realtime”,
  “gs2_script”
}
“none” Complete Matchmaking Trigger Type
The type of action to execute when matchmaking completes (all role slots are filled).
Can trigger GS2-Realtime room creation for the matched players, or execute a GS2-Script for custom post-match logic. Defaults to “none”.
DefinitionDescription
“none”None
“gs2_realtime”GS2-Realtime Room Creation
“gs2_script”GS2-Script Execution
completeMatchmakingTriggerRealtimeNamespaceId string {completeMatchmakingTriggerType} == “gs2_realtime”
✓*
~ 1024 chars GS2-Realtime namespace GRN to create rooms when matchmaking is complete
* Required if completeMatchmakingTriggerType is “gs2_realtime”
completeMatchmakingTriggerScriptId string {completeMatchmakingTriggerType} == “gs2_script”
✓*
~ 1024 chars GS2-Script script GRN to be executed when matchmaking is complete
Script Trigger Reference - completeMatchmaking
* Required if completeMatchmakingTriggerType is “gs2_script”
enableCollaborateSeasonRating string (enum)
enum {
  “enable”,
  “disable”
}
“disable” Enable Season Rating Collaboration
Whether to enable integration with GS2-SeasonRating for season-based rating calculations.
When enabled, a rating calculation session is automatically created in the specified GS2-SeasonRating namespace when matchmaking completes.
Defaults to “disable”.
DefinitionDescription
“enable”Enable
“disable”Disable
collaborateSeasonRatingNamespaceId string {enableCollaborateSeasonRating} == “enable”
✓*
~ 1024 chars Season Rating Namespace GRN
The GRN of the GS2-SeasonRating namespace where rating calculation sessions are created when matchmaking completes.
Only applicable when Season Rating collaboration is enabled.
* Required if enableCollaborateSeasonRating is “enable”
collaborateSeasonRatingTtl int {enableCollaborateSeasonRating} == “enable” 60 60 ~ 7200 Season Rating Result TTL (seconds)
The maximum time in seconds to wait for match result submissions via GS2-SeasonRating after matchmaking completes.
If results are not submitted within this period, the rating session expires. Must be between 60 and 7200 seconds. Defaults to 60.
* Enabled only if enableCollaborateSeasonRating is “enable”
changeRatingScript ScriptSetting Script setting to be executed when the rating value changes
Script Trigger Reference - changeRating
joinNotification NotificationSetting Join Notification
Push Notification Setting for when a new player joins a Gathering.
Notifies existing participants that a new player has joined, allowing the game client to update the matchmaking UI.
leaveNotification NotificationSetting Leave Notification
Push Notification Setting for when a player leaves a Gathering.
Notifies remaining participants that a player has left, allowing the game client to reflect the change.
completeNotification NotificationSetting Complete Notification
Push Notification Setting for when matchmaking completes (all role slots are filled).
Notifies all participants that the Gathering is full and the match can begin.
changeRatingNotification NotificationSetting Change Rating Notification
Push Notification Setting for when a player’s rating value changes after vote processing.
Notifies the affected player of their new rating, allowing the game client to display the updated value.
logSetting LogSetting Log Output Setting
Configuration for outputting API request/response logs to GS2-Log.
When configured, matchmaking operations (create/join/leave gathering, vote, rating changes, etc.) are logged for monitoring and analysis.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

TransactionSetting

Transaction Settings

Transaction Settings control how transactions are executed, their consistency, asynchronous processing, and conflict avoidance mechanisms. Combining features like AutoRun, AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, and asynchronous processing of Acquire Actions via GS2-JobQueue enables robust transaction management tailored to game logic.

Details
Type Condition Required Default Value Limits Description
enableAutoRun bool false Whether to automatically execute issued transactions on the server side
enableAtomicCommit bool {enableAutoRun} == true false Whether to commit the execution of transactions atomically
* Enabled only if enableAutoRun is true
transactionUseDistributor bool {enableAtomicCommit} == true false Whether to execute transactions asynchronously
* Enabled only if enableAtomicCommit is true
commitScriptResultInUseDistributor bool {transactionUseDistributor} == true false Whether to execute the commit processing of the script result asynchronously
* Enabled only if transactionUseDistributor is true
acquireActionUseJobQueue bool {enableAtomicCommit} == true false Whether to use GS2-JobQueue to execute the acquire action
* Enabled only if enableAtomicCommit is true
distributorNamespaceId string “grn:gs2:{region}:{ownerId}:distributor:default” ~ 1024 chars GS2-Distributor Namespace GRN used to execute transactions
queueNamespaceId string “grn:gs2:{region}:{ownerId}:queue:default” ~ 1024 chars GS2-JobQueue Namespace GRN used to execute transactions

ScriptSetting

Script Setting

In GS2, you can associate custom scripts with microservice events and execute them. This model holds the settings for triggering script execution.

There are two main ways to execute a script: synchronous execution and asynchronous execution. Because synchronous execution blocks processing until the script finishes executing, you can use the script result to stop the API execution or control the API response.

In contrast, asynchronous execution does not block processing until the script has finished executing. However, because the script result cannot be used to stop the API execution or modify the API response, asynchronous execution does not affect the API response flow and is generally recommended.

There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge. By using Amazon EventBridge, you can write processing in languages other than Lua.

Details
Type Condition Required Default Value Limits Description
triggerScriptId string ~ 1024 chars GS2-Script script GRN executed synchronously when the API is executed
Must be specified in GRN format starting with “grn:gs2:”.
doneTriggerTargetType string (enum)
enum {
  “none”,
  “gs2_script”,
  “aws”
}
“none” How to execute asynchronous scripts
Specifies the type of script to use for asynchronous execution.
You can choose from “Do not use asynchronous execution (none)”, “Use GS2-Script (gs2_script)”, and “Use Amazon EventBridge (aws)”.
DefinitionDescription
“none”None
“gs2_script”GS2-Script
“aws”Amazon EventBridge
doneTriggerScriptId string {doneTriggerTargetType} == “gs2_script” ~ 1024 chars GS2-Script script GRN for asynchronous execution
Must be specified in GRN format starting with “grn:gs2:”.
* Enabled only if doneTriggerTargetType is “gs2_script”
doneTriggerQueueNamespaceId string {doneTriggerTargetType} == “gs2_script” ~ 1024 chars GS2-JobQueue namespace GRN to execute asynchronous execution scripts
If you want to execute asynchronous execution scripts via GS2-JobQueue instead of executing them directly, specify the GS2-JobQueue namespace GRN.
There are not many cases where GS2-JobQueue is required, so you generally do not need to specify it unless you have a specific reason.
* Enabled only if doneTriggerTargetType is “gs2_script”

NotificationSetting

Push Notification Setting

Configuration for sending push notifications when events occur in GS2 microservices. The push notification here refers to the processing via the WebSocket interface provided by GS2-Gateway, and is different from the push notification of a smartphone. For example, when matchmaking is completed or a friend request is received, the GS2-Gateway can send a push notification via the WebSocket interface, and the game client can detect the change of the state.

GS2-Gateway’s push notifications can be used to forward notifications to mobile push notification services when the destination device is offline. By properly utilizing mobile push notifications, you can implement a flow in which players are notified even if they exit the game during matchmaking and later return to it.

Details
Type Condition Required Default Value Limits Description
gatewayNamespaceId string “grn:gs2:{region}:{ownerId}:gateway:default” ~ 1024 chars GS2-Gateway namespace to use for push notifications
Specify the GS2-Gateway namespace ID in GRN format starting with “grn:gs2:”.
enableTransferMobileNotification bool? false Whether to forward the notification as a mobile push notification
When an attempt is made to send this notification and the destination device is offline, specify whether it should be forwarded as a mobile push notification.
sound string {enableTransferMobileNotification} == true ~ 1024 chars Sound file name to be used for mobile push notifications
The sound file name specified here is used when sending mobile push notifications, and you can send notifications with a special sound.
* Enabled only if enableTransferMobileNotification is true
enable string (enum)
enum {
  “Enabled”,
  “Disabled”
}
“Enabled” Whether to enable push notifications
DefinitionDescription
“Enabled”Enabled
“Disabled”Disabled

LogSetting

Log Output Setting

Log Output Setting defines how log data is exported. This type holds the GS2-Log namespace identifier (Namespace ID), which is used to export log data. Specify the GS2-Log namespace where log data is collected and stored in the GRN format for the Log Namespace ID (loggingNamespaceId). Configuring this setting ensures that log data for API requests and responses occurring within the specified namespace is output to the target GS2-Log namespace. GS2-Log provides real-time logs that can be used for system monitoring, analysis, debugging, and other operational purposes.

Details
Type Condition Required Default Value Limits Description
loggingNamespaceId string
~ 1024 chars GS2-Log namespace GRN to output logs
Must be specified in GRN format starting with “grn:gs2:”.

GitHubCheckoutSetting

Setting for checking out master data from GitHub

Details
Type Condition Required Default Value Limits Description
apiKeyId string
~ 1024 chars GitHub API Key GRN
repositoryName string
~ 1024 chars Repository Name
sourcePath string
~ 1024 chars Master data (JSON) file path
referenceType string (enum)
enum {
  “commit_hash”,
  “branch”,
  “tag”
}
Source of code
DefinitionDescription
“commit_hash”Commit hash
“branch”Branch
“tag”Tag
commitHash string {referenceType} == “commit_hash”
✓*
~ 1024 chars Commit hash
* Required if referenceType is “commit_hash”
branchName string {referenceType} == “branch”
✓*
~ 1024 chars Branch Name
* Required if referenceType is “branch”
tagName string {referenceType} == “tag”
✓*
~ 1024 chars Tag Name
* Required if referenceType is “tag”

Gathering

Gathering

An entity representing a group of game players brought together by matchmaking. It has multiple parameters for matchmaking, and the players are grouped based on the totality of the parameters. Players join a Gathering by specifying their role, attributes, and optionally a blacklist of users they do not wish to play with. Joining is validated against attribute range requirements, role capacity limits, and whitelist restrictions (allowUserIds). When all role slots are filled to capacity, the Gathering is considered complete and matchmaking finishes. Gathering names are automatically generated in UUID format, and an optional expiration time can be set for automatic cleanup.

Details
Type Condition Required Default Value Limits Description
gatheringId string
*
~ 1024 chars Gathering GRN
* Set automatically by the server
name string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.
attributeRanges List<AttributeRange> [] 0 ~ 5 items Recruitment Requirements
A list of attribute range conditions that players must satisfy to join this Gathering.
Each entry specifies a named attribute and its acceptable min/max range.
A player’s own attribute values must fall within these ranges to participate. Maximum 5 conditions.
capacityOfRoles List<CapacityOfRole> [] 1 ~ 5 items List of Role Capacities
Defines the recruitment slots for this Gathering.
Each entry specifies a role name, its aliases, and the maximum number of players that can fill that role.
When all role slots reach their capacity, matchmaking is considered complete. At least 1, maximum 5 roles.
allowUserIds List<string> [] 0 ~ 100 items Allowed User IDs
A whitelist of user IDs that are permitted to join this Gathering.
When specified, only the listed users can participate in matchmaking for this Gathering.
Useful for friend-only or invitation-based matchmaking scenarios. Maximum 100 entries.
metadata string ~ 1024 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
expiresAt long Gathering Expiration Time
The time at which this Gathering automatically expires and is deleted.
If matchmaking does not complete before this time, the Gathering is cleaned up.
When not specified, the Gathering persists until matchmaking completes or it is manually deleted.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

SeasonGathering

Season Gathering

A persistent gathering within a season that collects players over the season period. Unlike regular Gatherings that dissolve once matchmaking completes, Season Gatherings persist throughout the season and accumulate participants. Players are grouped by tier (based on GS2-Experience rank) and season number, and each Season Gathering has a maximum participant limit defined by the SeasonModel.

Details
Type Condition Required Default Value Limits Description
seasonGatheringId string
*
~ 1024 chars Season Gathering GRN
* Set automatically by the server
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long
0 ~ 9223372036854775805 Season
tier long
0 ~ 9223372036854775805 Tier
The tier level used to group players of similar rank together.
Determined by the player’s rank in the GS2-Experience model specified in the SeasonModel.
Players are only matched with others in the same tier, ensuring fair competition.
name string
UUID ~ 128 chars Season Gathering Name
Season Gathering-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
participants List<string> [] 0 ~ 1000 items List of Participant User IDs
The list of user IDs of players who have joined this Season Gathering.
Players are added to this list when they join and the list grows throughout the season until the maximum participant limit is reached.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

JoinedSeasonGathering

Joined Season Gathering

A record that tracks which Season Gathering a player has joined within a specific season and tier. Created automatically when a player joins a Season Gathering, serving as an index to quickly look up the player’s current gathering. Each player can belong to at most one Season Gathering per season and tier combination.

Details
Type Condition Required Default Value Limits Description
joinedSeasonGatheringId string
*
~ 1024 chars Joined Season Gathering GRN
* Set automatically by the server
userId string
~ 128 chars User ID
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long
0 ~ 9223372036854775805 Season
tier long
0 ~ 9223372036854775805 Tier
The tier level used to group players of similar rank together.
Determined by the player’s rank in the GS2-Experience model specified in the SeasonModel.
Players are only matched with others in the same tier, ensuring fair competition.
seasonGatheringName string
~ 128 chars Season Gathering Name
The name of the Season Gathering that this player has joined.
Used to reference the specific Season Gathering entity within the same season and tier.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server

Rating

Rating

An entity that holds the current rating value for each game player. Created automatically when a player first participates in rated matchmaking. The rating is calculated using the Glicko-2 algorithm, with an initial rate value and rating deviation (rd) that represents the uncertainty of the rating. The rate value converges toward the player’s true skill level as more matches are played.

Details
Type Condition Required Default Value Limits Description
ratingId string
*
~ 1024 chars Rating GRN
* Set automatically by the server
name string
~ 128 chars Rating name
Rating-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
rateValue float 1500.0 0 ~ 65535.0 Rate Value
The player’s current rating score calculated by the Glicko-2 algorithm.
Defaults to the initial value defined in the RatingModel (typically 1500.0).
The value increases or decreases based on match results and the relative strength of opponents.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

Ballot

Ballot

A ballot paper issued to each player for reporting match results after a rated matchmaking game. Contains the context of the match: the rating model name, gathering name, and number of players. Each player receives a ballot signed by the server, which they fill in with game results and submit to the Vote API. The voting system requires more than 50% consensus among submitted ballots to finalize rating calculations.

Details
Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
ratingName string
~ 128 chars Rating Name
The name of the RatingModel to use for rating calculations after this match.
Identifies which rating system’s parameters (initial value, volatility) apply to this match’s result processing.
gatheringName string
~ 128 chars Gathering Name
The name of the Gathering for which match results are being reported.
Used to identify the specific matchmaking session and correlate votes from all participants in the same match.
numberOfPlayer int
2 ~ 10 Number of Players
The total number of players who participated in this match.
Used to determine the expected number of ballots and validate consensus (more than 50% of players must submit matching results).
Must be between 2 and 10.

Vote

Vote

An entity that aggregates submitted ballots for a specific match to determine the final match results for rating calculation. Each Vote is identified by the combination of rating model name and gathering name. Ballots are collected from match participants, and when enough ballots with consistent results are submitted (more than 50% consensus), the vote is considered complete and the rating values of the participants are updated accordingly.

Details
Type Condition Required Default Value Limits Description
voteId string
*
~ 1024 chars Vote GRN
* Set automatically by the server
ratingName string
~ 128 chars Rating Model name
Rating Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gatheringName string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.
writtenBallots List<WrittenBallot> [] 0 ~ 10 items List of Written Ballots
The collection of submitted ballots from match participants.
Each written ballot contains the signed ballot paper and the game results (player rankings) as reported by that participant.
When more than 50% of the expected ballots contain consistent results, the vote is finalized and rating calculations proceed. Maximum 10 entries.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server

RatingModel

Rating Model

GS2 uses Glicko-2 as its rating algorithm. Glicko-2 has several parameters, but GS2-Matchmaking aggregates them into a single parameter, volatility, which represents the totality of the parameters. Volatility is a parameter that expresses the magnitude of change; the larger the value, the greater the change in the rating value.

Details
Type Condition Required Default Value Limits Description
ratingModelId string
*
~ 1024 chars Rating Model GRN
* Set automatically by the server
name string
~ 128 chars Rating Model name
Rating Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
initialValue int 1500 100 ~ 10000 Initial Rating Value
The starting rate value assigned to new players when they first participate in rated matchmaking.
Defaults to 1500. All players begin at the same rating and it adjusts based on match results.
volatility int 100 1 ~ 20000 Rating Volatility
A Glicko-2 parameter that controls how much the rating value changes after each match.
Higher values cause larger rating fluctuations, making ratings adjust more quickly.
Lower values result in more stable ratings that change gradually. Defaults to 100.

SeasonModel

Season Model

Defines the season-specific settings for Season Matchmaking, including the period of persistent gatherings, maximum participant count, and tier integration settings. Managed by GS2-Schedule for period control, and can be linked with GS2-Experience for persistent gathering within the same tier as needed.

Details
Type Condition Required Default Value Limits Description
seasonModelId string
*
~ 1024 chars Season Model GRN
* Set automatically by the server
name string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
maximumParticipants int
2 ~ 1000 Maximum Number of Participants
The maximum number of players that can join a single Season Gathering.
Once this limit is reached, the Season Gathering is considered full and no more players can join.
Must be between 2 and 1000.
experienceModelId string ~ 1024 chars Experience Model GRN for Tier Management
The GRN of the GS2-Experience experience model used to determine player tiers.
The player’s rank within this experience model is used as their tier for matchmaking, ensuring players are grouped with others at a similar level.
If not specified, tier-based grouping is disabled and all players are matched together regardless of level.
challengePeriodEventId string
~ 1024 chars Challenge Period Event GRN
The GRN of the GS2-Schedule event that defines the active period for this season.
Season Gatherings can only be created and joined while this event is active.
When the event period ends, the season closes and new matchmaking is no longer possible.

AttributeRange

Attribute Range

A condition that defines the acceptable range of a named attribute for joining a Gathering. When a player attempts to join, their attribute value with the matching name must fall within the specified min/max range. Used to create skill-based or level-based matchmaking filters.

Details
Type Condition Required Default Value Limits Description
name string
~ 128 chars Attribute Name
The name of the attribute to apply this range condition to.
Must match the name of an attribute in the player’s attribute list for the condition to be evaluated.
min int 0 0 ~ 2147483646 Minimum Attribute Value
The minimum value of the attribute required to join the Gathering (inclusive).
Players whose attribute value is below this threshold cannot participate.
max int 0 0 ~ 2147483646 Maximum Attribute Value
The maximum value of the attribute allowed to join the Gathering (inclusive).
Players whose attribute value exceeds this threshold cannot participate.

CapacityOfRole

Capacity of Role

Defines a recruitment slot within a Gathering for a specific role. Each role has a name, optional aliases, a maximum capacity, and a list of currently participating players. Role aliases allow flexible matching: e.g., a “tank” role with aliases “paladin” and “knight” lets players specifying either sub-role fill the tank slot. When all participants in every role reach their capacity, the Gathering’s matchmaking is complete.

Details
Type Condition Required Default Value Limits Description
roleName string “default” ~ 128 chars Role Name
The name of the role for this recruitment slot.
Defaults to “default” for general matchmaking without role distinctions.
For role-based matchmaking (e.g., “tank”, “healer”, “attacker”), specify the role category name here.
roleAliases List<string> [] 0 ~ 9 items List of Role Name Aliases
Alternative role names that are accepted for this recruitment slot.
Players specifying any of these aliases as their role name will be matched into this slot.
Enables sub-role matching: e.g., “paladin” and “knight” aliases for a “tank” role. Maximum 9 aliases.
capacity int
1 ~ 256 Role Capacity
The maximum number of players that can fill this role slot.
When the number of participants reaches this capacity, the role is considered full and no more players with this role can join.
Must be between 1 and 256.
participants List<Player> [] 0 ~ 1000 items List of Participant Players
The list of players currently occupying this role slot.
Players are added when they join the Gathering and removed when they leave.
Each player entry includes their user ID, attributes, role name, and blacklist. Uniqueness is enforced by user ID.

Attribute

Attribute

A named numeric attribute associated with a player for matchmaking purposes. Attributes are used in conjunction with AttributeRange conditions on Gatherings to filter which players can join. For example, a “level” attribute with value 50 would match a Gathering requiring level between 40 and 60. Each player can have up to 5 attributes.

Details
Type Condition Required Default Value Limits Description
name string
~ 128 chars Attribute Name
Attribute-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
value int 0 0 ~ 2147483646 Attribute Value
The numeric value of this attribute for the player.
This value is checked against the min/max range specified in the Gathering’s AttributeRange conditions during matchmaking.

Player

Player

Represents a player participating in matchmaking, containing their identity, attributes, role, and blacklist. When joining a Gathering, a Player object is created with the player’s attribute values, desired role, and a list of users they refuse to play with. The player’s attributes are validated against the Gathering’s attribute range conditions, and their deny list is cross-checked to prevent unwanted pairings.

Details
Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
attributes List<Attribute> [] 0 ~ 5 items List of Attributes
The player’s named numeric attributes used for matchmaking condition evaluation.
Each attribute is checked against the Gathering’s AttributeRange conditions to determine eligibility.
The player’s own attribute values must also fall within any range conditions they set when creating a Gathering. Maximum 5 attributes.
roleName string “default” ~ 128 chars Role Name
The role that this player wants to fill in the Gathering.
Defaults to “default” for general matchmaking without role distinctions.
For role-based matchmaking, specify the player’s specific role (e.g., “paladin”, “knight”) which is matched against role names and aliases in the Gathering’s capacity definitions.
denyUserIds List<string> [] 0 ~ 100 items Deny User IDs
A blacklist of user IDs that this player refuses to be matched with.
During matchmaking, if any player already in the Gathering appears in this list, the player cannot join that Gathering.
Conversely, if this player is in any existing participant’s deny list, joining is also blocked. Maximum 100 entries.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server

GameResult

Game Result

Represents the result of a single player in a match, used for rating calculations via the Vote system. Each GameResult entry pairs a user ID with their rank (finishing position) in the match. Lower rank values indicate better performance (1st place = rank 1). Players with the same rank are treated as a draw.

Details
Type Condition Required Default Value Limits Description
rank int
0 ~ 2147483646 Rank
The player’s finishing position in the match. 1 is the highest rank (winner).
Used by the Glicko-2 algorithm to calculate rating changes: higher-ranked players gain rating while lower-ranked players lose rating.
Players with equal ranks are treated as draws.
userId string
~ 128 chars User ID

SignedBallot

Signed Ballot

A ballot paper with a digital signature that verifies its authenticity. The server issues signed ballots to players after matchmaking completes, ensuring that only legitimate participants can submit match results. The signature is verified when the ballot is submitted to the Vote API, preventing tampering with match context (rating name, gathering name, number of players).

Details
Type Condition Required Default Value Limits Description
body string
~ 1024 chars Ballot Body
The serialized ballot data that is the target of the digital signature.
Contains the ballot context (user ID, rating name, gathering name, number of players) in a format that can be verified against the signature.
signature string
~ 256 chars Signature
The digital signature used to verify the authenticity and integrity of the ballot body.
Generated by the server using a GS2-Key encryption key, and verified when the ballot is submitted to prevent forgery or tampering.

WrittenBallot

Written Ballot

A data model representing a ballot with written match results. It contains user IDs and ranks, and is submitted with a signature to the Vote API.

Details
Type Condition Required Default Value Limits Description
ballot Ballot
Ballot
gameResults List<GameResult> 0 ~ 10 items List of Match Results

TimeSpan

Time Span

Represents a duration of time composed of days, hours, and minutes. Used to specify relative time offsets, such as the expiration time of a Gathering from the current time. The total duration is calculated by combining all three components.

Details
Type Condition Required Default Value Limits Description
days int 0 0 ~ 365 Days
The number of days in the time span. Maximum 365 days. Defaults to 0.
hours int 0 0 ~ 24 Hours
The number of hours in the time span. Maximum 24 hours. Defaults to 0.
minutes int 0 0 ~ 60 Minutes
The number of minutes in the time span. Maximum 60 minutes. Defaults to 0.

CurrentModelMaster

Currently active Models master data

This master data defines the Models currently active within the namespace. GS2 uses JSON format files for managing master data. By uploading these files, the master data are updated on the server.

To create JSON files, GS2 provides a master data editor within the management console. Additionally, you can create tools better suited for game operations and export JSON files in the appropriate format.

Details
Type Condition Required Default Value Limits Description
namespaceId string
*
~ 1024 chars Namespace GRN
* Set automatically by the server
settings string
~ 5242880 bytes (5MB) Master Data

RatingModelMaster

Rating Model Master

Rating Model Master is data used to edit and manage Rating Model within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as Rating Model actually referenced by the game.

GS2 uses Glicko-2 as its rating algorithm. Glicko-2 has several parameters, but GS2-Matchmaking aggregates them into a single parameter, volatility, which represents the totality of the parameters. Volatility is a parameter that expresses the magnitude of change; the larger the value, the greater the change in the rating value.

Details
Type Condition Required Default Value Limits Description
ratingModelId string
*
~ 1024 chars Rating Model Master GRN
* Set automatically by the server
name string
~ 128 chars Rating Model name
Rating Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
description string ~ 1024 chars Description
initialValue int 1500 100 ~ 10000 Initial Rating Value
The starting rate value assigned to new players when they first participate in rated matchmaking.
Defaults to 1500. All players begin at the same rating and it adjusts based on match results.
volatility int 100 1 ~ 20000 Rating Volatility
A Glicko-2 parameter that controls how much the rating value changes after each match.
Higher values cause larger rating fluctuations, making ratings adjust more quickly.
Lower values result in more stable ratings that change gradually. Defaults to 100.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

SeasonModelMaster

Season Model Master

Season Model Master is data used to edit and manage Season Model within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as Season Model actually referenced by the game.

Season Model is master data that defines the period of persistent gatherings active for a fixed period, the maximum number of participants, and tier integration settings in Season Matchmaking. The period is managed by GS2-Schedule, and it can optionally integrate with GS2-Experience to form persistent gatherings within the same tier.

Details
Type Condition Required Default Value Limits Description
seasonModelId string
*
~ 1024 chars Season Model Master GRN
* Set automatically by the server
name string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
description string ~ 1024 chars Description
maximumParticipants int
2 ~ 1000 Maximum Number of Participants
The maximum number of players that can join a single Season Gathering.
Once this limit is reached, the Season Gathering is considered full and no more players can join.
Must be between 2 and 1000.
experienceModelId string ~ 1024 chars Experience Model GRN for Tier Management
The GRN of the GS2-Experience experience model used to determine player tiers.
The player’s rank within this experience model is used as their tier for matchmaking, ensuring players are grouped with others at a similar level.
If not specified, tier-based grouping is disabled and all players are matched together regardless of level.
challengePeriodEventId string
~ 1024 chars Challenge Period Event GRN
The GRN of the GS2-Schedule event that defines the active period for this season.
Season Gatherings can only be created and joined while this event is active.
When the event period ends, the season closes and new matchmaking is no longer possible.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

Methods

describeNamespaces

Get a list of Namespaces

Retrieves a list of namespaces that have been created on a per-service basis within the project. You can use the optional page token to start acquiring data from a specific location in the list. You can also limit the number of namespaces to be acquired.

Details

Request

Type Condition Required Default Value Limits Description
namePrefix string ~ 64 chars Filter by Namespace name prefix
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<Namespace> List of Namespaces
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &matchmaking.DescribeNamespacesRequest {
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeNamespacesRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->describeNamespaces(
        (new DescribeNamespacesRequest())
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeNamespacesRequest;
import io.gs2.matchmaking.result.DescribeNamespacesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DescribeNamespacesResult result = client.describeNamespaces(
        new DescribeNamespacesRequest()
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<Namespace> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Matchmaking.Request.DescribeNamespacesRequest()
        .WithNamePrefix(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.describeNamespaces(
        new Gs2Matchmaking.DescribeNamespacesRequest()
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.describe_namespaces(
        matchmaking.DescribeNamespacesRequest()
            .with_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_namespaces({
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('matchmaking')

api_result_handler = client.describe_namespaces_async({
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createNamespace

Create a new Namespace

You must specify detailed information including the name, description, and various settings of the namespace.

Details

Request

Type Condition Required Default Value Limits Description
name string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
transactionSetting TransactionSetting Transaction Settings
Configuration for controlling how transactions are processed when executing matchmaking operations.
enableRating bool false Enable Rating
Whether to enable the Glicko-2 based rating calculation function.
When enabled, players can submit match results via the Vote system and have their ratings automatically updated.
Requires RatingModel master data to be configured. Defaults to false.
enableDisconnectDetection string (enum)
enum {
  “disable”,
  “enable”
}
“disable” Disconnect Detection
Controls whether players in matchmaking must periodically report they are still waiting.
When enabled, if a player does not send a keep-alive within the configured timeout period, they are automatically removed from the Gathering.
This prevents “ghost” players from blocking matchmaking completion. Defaults to “disable”.
DefinitionDescription
“disable”Disable
“enable”Enable
disconnectDetectionTimeoutSeconds int {enableDisconnectDetection} == “enable”
✓*
15 ~ 600 Disconnect Detection Timeout (seconds)
The number of seconds to wait without a keep-alive report before a player is considered disconnected and removed from the Gathering.
Only applies when disconnect detection is enabled. Must be between 15 and 600 seconds.
* Required if enableDisconnectDetection is “enable”
createGatheringTriggerType string (enum)
enum {
  “none”,
  “gs2_realtime”,
  “gs2_script”
}
“none” Create Gathering Trigger Type
The type of action to execute when a new Gathering is created.
Can trigger GS2-Realtime room creation for real-time communication, or execute a GS2-Script for custom logic. Defaults to “none”.
DefinitionDescription
“none”None
“gs2_realtime”GS2-Realtime Room Creation
“gs2_script”GS2-Script Execution
createGatheringTriggerRealtimeNamespaceId string {createGatheringTriggerType} == “gs2_realtime”
✓*
~ 1024 chars GS2-Realtime namespace to create rooms when creating a gathering
* Required if createGatheringTriggerType is “gs2_realtime”
createGatheringTriggerScriptId string {createGatheringTriggerType} == “gs2_script”
✓*
~ 1024 chars GS2-Script script GRN to be executed when creating a gathering
* Required if createGatheringTriggerType is “gs2_script”
completeMatchmakingTriggerType string (enum)
enum {
  “none”,
  “gs2_realtime”,
  “gs2_script”
}
“none” Complete Matchmaking Trigger Type
The type of action to execute when matchmaking completes (all role slots are filled).
Can trigger GS2-Realtime room creation for the matched players, or execute a GS2-Script for custom post-match logic. Defaults to “none”.
DefinitionDescription
“none”None
“gs2_realtime”GS2-Realtime Room Creation
“gs2_script”GS2-Script Execution
completeMatchmakingTriggerRealtimeNamespaceId string {completeMatchmakingTriggerType} == “gs2_realtime”
✓*
~ 1024 chars GS2-Realtime namespace GRN to create rooms when matchmaking is complete
* Required if completeMatchmakingTriggerType is “gs2_realtime”
completeMatchmakingTriggerScriptId string {completeMatchmakingTriggerType} == “gs2_script”
✓*
~ 1024 chars GS2-Script script GRN to be executed when matchmaking is complete
* Required if completeMatchmakingTriggerType is “gs2_script”
enableCollaborateSeasonRating string (enum)
enum {
  “enable”,
  “disable”
}
“disable” Enable Season Rating Collaboration
Whether to enable integration with GS2-SeasonRating for season-based rating calculations.
When enabled, a rating calculation session is automatically created in the specified GS2-SeasonRating namespace when matchmaking completes.
Defaults to “disable”.
DefinitionDescription
“enable”Enable
“disable”Disable
collaborateSeasonRatingNamespaceId string {enableCollaborateSeasonRating} == “enable”
✓*
~ 1024 chars Season Rating Namespace GRN
* Required if enableCollaborateSeasonRating is “enable”
collaborateSeasonRatingTtl int {enableCollaborateSeasonRating} == “enable” 60 60 ~ 7200 Season Rating Result TTL (seconds)
The maximum time in seconds to wait for match result submissions via GS2-SeasonRating after matchmaking completes.
If results are not submitted within this period, the rating session expires. Must be between 60 and 7200 seconds. Defaults to 60.
* Required if enableCollaborateSeasonRating is “enable”
changeRatingScript ScriptSetting Script setting to be executed when the rating value changes
Script Trigger Reference - changeRating
joinNotification NotificationSetting Join Notification
Push Notification Setting for when a new player joins a Gathering.
Notifies existing participants that a new player has joined, allowing the game client to update the matchmaking UI.
leaveNotification NotificationSetting Leave Notification
Push Notification Setting for when a player leaves a Gathering.
Notifies remaining participants that a player has left, allowing the game client to reflect the change.
completeNotification NotificationSetting Complete Notification
Push Notification Setting for when matchmaking completes (all role slots are filled).
Notifies all participants that the Gathering is full and the match can begin.
changeRatingNotification NotificationSetting Change Rating Notification
Push Notification Setting for when a player’s rating value changes after vote processing.
Notifies the affected player of their new rating, allowing the game client to display the updated value.
logSetting LogSetting Log Output Setting
Configuration for outputting API request/response logs to GS2-Log.
When configured, matchmaking operations (create/join/leave gathering, vote, rating changes, etc.) are logged for monitoring and analysis.

Result

Type Description
item Namespace Namespace created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &matchmaking.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSetting: nil,
        EnableRating: pointy.Bool(true),
        EnableDisconnectDetection: nil,
        DisconnectDetectionTimeoutSeconds: nil,
        CreateGatheringTriggerType: pointy.String("none"),
        CreateGatheringTriggerRealtimeNamespaceId: nil,
        CreateGatheringTriggerScriptId: nil,
        CompleteMatchmakingTriggerType: pointy.String("none"),
        CompleteMatchmakingTriggerRealtimeNamespaceId: nil,
        CompleteMatchmakingTriggerScriptId: nil,
        EnableCollaborateSeasonRating: pointy.String("disable"),
        CollaborateSeasonRatingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001"),
        CollaborateSeasonRatingTtl: pointy.Int32(60),
        ChangeRatingScript: nil,
        JoinNotification: nil,
        LeaveNotification: nil,
        CompleteNotification: nil,
        ChangeRatingNotification: nil,
        LogSetting: &matchmaking.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CreateNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withEnableRating(true)
            ->withEnableDisconnectDetection(null)
            ->withDisconnectDetectionTimeoutSeconds(null)
            ->withCreateGatheringTriggerType("none")
            ->withCreateGatheringTriggerRealtimeNamespaceId(null)
            ->withCreateGatheringTriggerScriptId(null)
            ->withCompleteMatchmakingTriggerType("none")
            ->withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
            ->withCompleteMatchmakingTriggerScriptId(null)
            ->withEnableCollaborateSeasonRating("disable")
            ->withCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
            ->withCollaborateSeasonRatingTtl(60)
            ->withChangeRatingScript(null)
            ->withJoinNotification(null)
            ->withLeaveNotification(null)
            ->withCompleteNotification(null)
            ->withChangeRatingNotification(null)
            ->withLogSetting((new \Gs2\Matchmaking\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CreateNamespaceRequest;
import io.gs2.matchmaking.result.CreateNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withEnableRating(true)
            .withEnableDisconnectDetection(null)
            .withDisconnectDetectionTimeoutSeconds(null)
            .withCreateGatheringTriggerType("none")
            .withCreateGatheringTriggerRealtimeNamespaceId(null)
            .withCreateGatheringTriggerScriptId(null)
            .withCompleteMatchmakingTriggerType("none")
            .withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
            .withCompleteMatchmakingTriggerScriptId(null)
            .withEnableCollaborateSeasonRating("disable")
            .withCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
            .withCollaborateSeasonRatingTtl(60)
            .withChangeRatingScript(null)
            .withJoinNotification(null)
            .withLeaveNotification(null)
            .withCompleteNotification(null)
            .withChangeRatingNotification(null)
            .withLogSetting(new io.gs2.matchmaking.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Matchmaking.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithEnableRating(true)
        .WithEnableDisconnectDetection(null)
        .WithDisconnectDetectionTimeoutSeconds(null)
        .WithCreateGatheringTriggerType("none")
        .WithCreateGatheringTriggerRealtimeNamespaceId(null)
        .WithCreateGatheringTriggerScriptId(null)
        .WithCompleteMatchmakingTriggerType("none")
        .WithCompleteMatchmakingTriggerRealtimeNamespaceId(null)
        .WithCompleteMatchmakingTriggerScriptId(null)
        .WithEnableCollaborateSeasonRating("disable")
        .WithCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
        .WithCollaborateSeasonRatingTtl(60)
        .WithChangeRatingScript(null)
        .WithJoinNotification(null)
        .WithLeaveNotification(null)
        .WithCompleteNotification(null)
        .WithChangeRatingNotification(null)
        .WithLogSetting(new Gs2.Gs2Matchmaking.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.createNamespace(
        new Gs2Matchmaking.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withEnableRating(true)
            .withEnableDisconnectDetection(null)
            .withDisconnectDetectionTimeoutSeconds(null)
            .withCreateGatheringTriggerType("none")
            .withCreateGatheringTriggerRealtimeNamespaceId(null)
            .withCreateGatheringTriggerScriptId(null)
            .withCompleteMatchmakingTriggerType("none")
            .withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
            .withCompleteMatchmakingTriggerScriptId(null)
            .withEnableCollaborateSeasonRating("disable")
            .withCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
            .withCollaborateSeasonRatingTtl(60)
            .withChangeRatingScript(null)
            .withJoinNotification(null)
            .withLeaveNotification(null)
            .withCompleteNotification(null)
            .withChangeRatingNotification(null)
            .withLogSetting(new Gs2Matchmaking.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.create_namespace(
        matchmaking.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting(None)
            .with_enable_rating(True)
            .with_enable_disconnect_detection(None)
            .with_disconnect_detection_timeout_seconds(None)
            .with_create_gathering_trigger_type('none')
            .with_create_gathering_trigger_realtime_namespace_id(None)
            .with_create_gathering_trigger_script_id(None)
            .with_complete_matchmaking_trigger_type('none')
            .with_complete_matchmaking_trigger_realtime_namespace_id(None)
            .with_complete_matchmaking_trigger_script_id(None)
            .with_enable_collaborate_season_rating('disable')
            .with_collaborate_season_rating_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001')
            .with_collaborate_season_rating_ttl(60)
            .with_change_rating_script(None)
            .with_join_notification(None)
            .with_leave_notification(None)
            .with_complete_notification(None)
            .with_change_rating_notification(None)
            .with_log_setting(
                matchmaking.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    enableRating=true,
    enableDisconnectDetection=nil,
    disconnectDetectionTimeoutSeconds=nil,
    createGatheringTriggerType="none",
    createGatheringTriggerRealtimeNamespaceId=nil,
    createGatheringTriggerScriptId=nil,
    completeMatchmakingTriggerType="none",
    completeMatchmakingTriggerRealtimeNamespaceId=nil,
    completeMatchmakingTriggerScriptId=nil,
    enableCollaborateSeasonRating="disable",
    collaborateSeasonRatingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001",
    collaborateSeasonRatingTtl=60,
    changeRatingScript=nil,
    joinNotification=nil,
    leaveNotification=nil,
    completeNotification=nil,
    changeRatingNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    enableRating=true,
    enableDisconnectDetection=nil,
    disconnectDetectionTimeoutSeconds=nil,
    createGatheringTriggerType="none",
    createGatheringTriggerRealtimeNamespaceId=nil,
    createGatheringTriggerScriptId=nil,
    completeMatchmakingTriggerType="none",
    completeMatchmakingTriggerRealtimeNamespaceId=nil,
    completeMatchmakingTriggerScriptId=nil,
    enableCollaborateSeasonRating="disable",
    collaborateSeasonRatingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001",
    collaborateSeasonRatingTtl=60,
    changeRatingScript=nil,
    joinNotification=nil,
    leaveNotification=nil,
    completeNotification=nil,
    changeRatingNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getNamespaceStatus

Get Namespace status

Get the current status of the specified namespace. This includes whether the Namespace is active, pending, or in some other state.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
status string

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &matchmaking.GetNamespaceStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetNamespaceStatusRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName("namespace-0001")
    );
    $status = $result->getStatus();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetNamespaceStatusRequest;
import io.gs2.matchmaking.result.GetNamespaceStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetNamespaceStatusResult result = client.getNamespaceStatus(
        new GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Matchmaking.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getNamespaceStatus(
        new Gs2Matchmaking.GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_namespace_status(
        matchmaking.GetNamespaceStatusRequest()
            .with_namespace_name('namespace-0001')
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_namespace_status({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
status = result.status;
client = gs2('matchmaking')

api_result_handler = client.get_namespace_status_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
status = result.status;

getNamespace

Get a Namespace

Get detailed information about the specified namespace. This includes the name, description, and other settings of the namespace.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item Namespace Namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &matchmaking.GetNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetNamespaceRequest;
import io.gs2.matchmaking.result.GetNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetNamespaceResult result = client.getNamespace(
        new GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Matchmaking.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getNamespace(
        new Gs2Matchmaking.GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_namespace(
        matchmaking.GetNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_namespace({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.get_namespace_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateNamespace

Update Namespace

Update the settings of the specified Namespace. You can change the description and other settings of the Namespace.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
transactionSetting TransactionSetting Transaction Settings
Configuration for controlling how transactions are processed when executing matchmaking operations.
enableRating bool false Enable Rating
Whether to enable the Glicko-2 based rating calculation function.
When enabled, players can submit match results via the Vote system and have their ratings automatically updated.
Requires RatingModel master data to be configured. Defaults to false.
enableDisconnectDetection string (enum)
enum {
  “disable”,
  “enable”
}
“disable” Disconnect Detection
Controls whether players in matchmaking must periodically report they are still waiting.
When enabled, if a player does not send a keep-alive within the configured timeout period, they are automatically removed from the Gathering.
This prevents “ghost” players from blocking matchmaking completion. Defaults to “disable”.
DefinitionDescription
“disable”Disable
“enable”Enable
disconnectDetectionTimeoutSeconds int {enableDisconnectDetection} == “enable”
✓*
15 ~ 600 Disconnect Detection Timeout (seconds)
The number of seconds to wait without a keep-alive report before a player is considered disconnected and removed from the Gathering.
Only applies when disconnect detection is enabled. Must be between 15 and 600 seconds.
* Required if enableDisconnectDetection is “enable”
createGatheringTriggerType string (enum)
enum {
  “none”,
  “gs2_realtime”,
  “gs2_script”
}
“none” Create Gathering Trigger Type
The type of action to execute when a new Gathering is created.
Can trigger GS2-Realtime room creation for real-time communication, or execute a GS2-Script for custom logic. Defaults to “none”.
DefinitionDescription
“none”None
“gs2_realtime”GS2-Realtime Room Creation
“gs2_script”GS2-Script Execution
createGatheringTriggerRealtimeNamespaceId string {createGatheringTriggerType} == “gs2_realtime”
✓*
~ 1024 chars GS2-Realtime namespace to create rooms when creating a gathering
* Required if createGatheringTriggerType is “gs2_realtime”
createGatheringTriggerScriptId string {createGatheringTriggerType} == “gs2_script”
✓*
~ 1024 chars GS2-Script script GRN to be executed when creating a gathering
* Required if createGatheringTriggerType is “gs2_script”
completeMatchmakingTriggerType string (enum)
enum {
  “none”,
  “gs2_realtime”,
  “gs2_script”
}
“none” Complete Matchmaking Trigger Type
The type of action to execute when matchmaking completes (all role slots are filled).
Can trigger GS2-Realtime room creation for the matched players, or execute a GS2-Script for custom post-match logic. Defaults to “none”.
DefinitionDescription
“none”None
“gs2_realtime”GS2-Realtime Room Creation
“gs2_script”GS2-Script Execution
completeMatchmakingTriggerRealtimeNamespaceId string {completeMatchmakingTriggerType} == “gs2_realtime”
✓*
~ 1024 chars GS2-Realtime namespace GRN to create rooms when matchmaking is complete
* Required if completeMatchmakingTriggerType is “gs2_realtime”
completeMatchmakingTriggerScriptId string {completeMatchmakingTriggerType} == “gs2_script”
✓*
~ 1024 chars GS2-Script script GRN to be executed when matchmaking is complete
* Required if completeMatchmakingTriggerType is “gs2_script”
enableCollaborateSeasonRating string (enum)
enum {
  “enable”,
  “disable”
}
“disable” Enable Season Rating Collaboration
Whether to enable integration with GS2-SeasonRating for season-based rating calculations.
When enabled, a rating calculation session is automatically created in the specified GS2-SeasonRating namespace when matchmaking completes.
Defaults to “disable”.
DefinitionDescription
“enable”Enable
“disable”Disable
collaborateSeasonRatingNamespaceId string {enableCollaborateSeasonRating} == “enable”
✓*
~ 1024 chars Season Rating Namespace GRN
* Required if enableCollaborateSeasonRating is “enable”
collaborateSeasonRatingTtl int {enableCollaborateSeasonRating} == “enable” 60 60 ~ 7200 Season Rating Result TTL (seconds)
The maximum time in seconds to wait for match result submissions via GS2-SeasonRating after matchmaking completes.
If results are not submitted within this period, the rating session expires. Must be between 60 and 7200 seconds. Defaults to 60.
* Required if enableCollaborateSeasonRating is “enable”
changeRatingScript ScriptSetting Script setting to be executed when the rating value changes
Script Trigger Reference - changeRating
joinNotification NotificationSetting Join Notification
Push Notification Setting for when a new player joins a Gathering.
Notifies existing participants that a new player has joined, allowing the game client to update the matchmaking UI.
leaveNotification NotificationSetting Leave Notification
Push Notification Setting for when a player leaves a Gathering.
Notifies remaining participants that a player has left, allowing the game client to reflect the change.
completeNotification NotificationSetting Complete Notification
Push Notification Setting for when matchmaking completes (all role slots are filled).
Notifies all participants that the Gathering is full and the match can begin.
changeRatingNotification NotificationSetting Change Rating Notification
Push Notification Setting for when a player’s rating value changes after vote processing.
Notifies the affected player of their new rating, allowing the game client to display the updated value.
logSetting LogSetting Log Output Setting
Configuration for outputting API request/response logs to GS2-Log.
When configured, matchmaking operations (create/join/leave gathering, vote, rating changes, etc.) are logged for monitoring and analysis.

Result

Type Description
item Namespace Namespace updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &matchmaking.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        EnableRating: pointy.Bool(true),
        EnableDisconnectDetection: nil,
        DisconnectDetectionTimeoutSeconds: nil,
        CreateGatheringTriggerType: pointy.String("none"),
        CreateGatheringTriggerRealtimeNamespaceId: nil,
        CreateGatheringTriggerScriptId: nil,
        CompleteMatchmakingTriggerType: pointy.String("none"),
        CompleteMatchmakingTriggerRealtimeNamespaceId: nil,
        CompleteMatchmakingTriggerScriptId: nil,
        EnableCollaborateSeasonRating: pointy.String("enable"),
        CollaborateSeasonRatingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001"),
        CollaborateSeasonRatingTtl: pointy.Int32(60),
        ChangeRatingScript: nil,
        JoinNotification: nil,
        LeaveNotification: nil,
        CompleteNotification: nil,
        ChangeRatingNotification: nil,
        LogSetting: &matchmaking.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withEnableRating(true)
            ->withEnableDisconnectDetection(null)
            ->withDisconnectDetectionTimeoutSeconds(null)
            ->withCreateGatheringTriggerType("none")
            ->withCreateGatheringTriggerRealtimeNamespaceId(null)
            ->withCreateGatheringTriggerScriptId(null)
            ->withCompleteMatchmakingTriggerType("none")
            ->withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
            ->withCompleteMatchmakingTriggerScriptId(null)
            ->withEnableCollaborateSeasonRating("enable")
            ->withCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
            ->withCollaborateSeasonRatingTtl(60)
            ->withChangeRatingScript(null)
            ->withJoinNotification(null)
            ->withLeaveNotification(null)
            ->withCompleteNotification(null)
            ->withChangeRatingNotification(null)
            ->withLogSetting((new \Gs2\Matchmaking\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateNamespaceRequest;
import io.gs2.matchmaking.result.UpdateNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withEnableRating(true)
            .withEnableDisconnectDetection(null)
            .withDisconnectDetectionTimeoutSeconds(null)
            .withCreateGatheringTriggerType("none")
            .withCreateGatheringTriggerRealtimeNamespaceId(null)
            .withCreateGatheringTriggerScriptId(null)
            .withCompleteMatchmakingTriggerType("none")
            .withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
            .withCompleteMatchmakingTriggerScriptId(null)
            .withEnableCollaborateSeasonRating("enable")
            .withCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
            .withCollaborateSeasonRatingTtl(60)
            .withChangeRatingScript(null)
            .withJoinNotification(null)
            .withLeaveNotification(null)
            .withCompleteNotification(null)
            .withChangeRatingNotification(null)
            .withLogSetting(new io.gs2.matchmaking.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Matchmaking.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithEnableRating(true)
        .WithEnableDisconnectDetection(null)
        .WithDisconnectDetectionTimeoutSeconds(null)
        .WithCreateGatheringTriggerType("none")
        .WithCreateGatheringTriggerRealtimeNamespaceId(null)
        .WithCreateGatheringTriggerScriptId(null)
        .WithCompleteMatchmakingTriggerType("none")
        .WithCompleteMatchmakingTriggerRealtimeNamespaceId(null)
        .WithCompleteMatchmakingTriggerScriptId(null)
        .WithEnableCollaborateSeasonRating("enable")
        .WithCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
        .WithCollaborateSeasonRatingTtl(60)
        .WithChangeRatingScript(null)
        .WithJoinNotification(null)
        .WithLeaveNotification(null)
        .WithCompleteNotification(null)
        .WithChangeRatingNotification(null)
        .WithLogSetting(new Gs2.Gs2Matchmaking.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.updateNamespace(
        new Gs2Matchmaking.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withEnableRating(true)
            .withEnableDisconnectDetection(null)
            .withDisconnectDetectionTimeoutSeconds(null)
            .withCreateGatheringTriggerType("none")
            .withCreateGatheringTriggerRealtimeNamespaceId(null)
            .withCreateGatheringTriggerScriptId(null)
            .withCompleteMatchmakingTriggerType("none")
            .withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
            .withCompleteMatchmakingTriggerScriptId(null)
            .withEnableCollaborateSeasonRating("enable")
            .withCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
            .withCollaborateSeasonRatingTtl(60)
            .withChangeRatingScript(null)
            .withJoinNotification(null)
            .withLeaveNotification(null)
            .withCompleteNotification(null)
            .withChangeRatingNotification(null)
            .withLogSetting(new Gs2Matchmaking.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.update_namespace(
        matchmaking.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(None)
            .with_enable_rating(True)
            .with_enable_disconnect_detection(None)
            .with_disconnect_detection_timeout_seconds(None)
            .with_create_gathering_trigger_type('none')
            .with_create_gathering_trigger_realtime_namespace_id(None)
            .with_create_gathering_trigger_script_id(None)
            .with_complete_matchmaking_trigger_type('none')
            .with_complete_matchmaking_trigger_realtime_namespace_id(None)
            .with_complete_matchmaking_trigger_script_id(None)
            .with_enable_collaborate_season_rating('enable')
            .with_collaborate_season_rating_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001')
            .with_collaborate_season_rating_ttl(60)
            .with_change_rating_script(None)
            .with_join_notification(None)
            .with_leave_notification(None)
            .with_complete_notification(None)
            .with_change_rating_notification(None)
            .with_log_setting(
                matchmaking.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    enableRating=true,
    enableDisconnectDetection=nil,
    disconnectDetectionTimeoutSeconds=nil,
    createGatheringTriggerType="none",
    createGatheringTriggerRealtimeNamespaceId=nil,
    createGatheringTriggerScriptId=nil,
    completeMatchmakingTriggerType="none",
    completeMatchmakingTriggerRealtimeNamespaceId=nil,
    completeMatchmakingTriggerScriptId=nil,
    enableCollaborateSeasonRating="enable",
    collaborateSeasonRatingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001",
    collaborateSeasonRatingTtl=60,
    changeRatingScript=nil,
    joinNotification=nil,
    leaveNotification=nil,
    completeNotification=nil,
    changeRatingNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    enableRating=true,
    enableDisconnectDetection=nil,
    disconnectDetectionTimeoutSeconds=nil,
    createGatheringTriggerType="none",
    createGatheringTriggerRealtimeNamespaceId=nil,
    createGatheringTriggerScriptId=nil,
    completeMatchmakingTriggerType="none",
    completeMatchmakingTriggerRealtimeNamespaceId=nil,
    completeMatchmakingTriggerScriptId=nil,
    enableCollaborateSeasonRating="enable",
    collaborateSeasonRatingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001",
    collaborateSeasonRatingTtl=60,
    changeRatingScript=nil,
    joinNotification=nil,
    leaveNotification=nil,
    completeNotification=nil,
    changeRatingNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

deleteNamespace

Delete Namespace

Delete the specified Namespace. This operation is irreversible and all data associated with the deleted Namespace will be lost.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item Namespace The deleted Namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &matchmaking.DeleteNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DeleteNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DeleteNamespaceRequest;
import io.gs2.matchmaking.result.DeleteNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DeleteNamespaceResult result = client.deleteNamespace(
        new DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Matchmaking.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.deleteNamespace(
        new Gs2Matchmaking.DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.delete_namespace(
        matchmaking.DeleteNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.delete_namespace({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.delete_namespace_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getServiceVersion

Get the microservice version

Details

Request

Request parameters: None

Result

Type Description
item string Version

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetServiceVersion(
    &matchmaking.GetServiceVersionRequest {
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetServiceVersionRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getServiceVersion(
        (new GetServiceVersionRequest())
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetServiceVersionRequest;
import io.gs2.matchmaking.result.GetServiceVersionResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetServiceVersionResult result = client.getServiceVersion(
        new GetServiceVersionRequest()
    );
    String item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
    new Gs2.Gs2Matchmaking.Request.GetServiceVersionRequest(),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getServiceVersion(
        new Gs2Matchmaking.GetServiceVersionRequest()
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_service_version(
        matchmaking.GetServiceVersionRequest()
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_service_version({
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.get_service_version_async({
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

dumpUserDataByUserId

Dump data associated with the specified user ID

Can be used to meet legal requirements for the protection of personal information, or to back up or migrate data.

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &matchmaking.DumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DumpUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->dumpUserDataByUserId(
        (new DumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DumpUserDataByUserIdRequest;
import io.gs2.matchmaking.result.DumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
        new DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Matchmaking.Request.DumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.dumpUserDataByUserId(
        new Gs2Matchmaking.DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.dump_user_data_by_user_id(
        matchmaking.DumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
client = gs2('matchmaking')

api_result_handler = client.dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

checkDumpUserDataByUserId

Check if the dump of the data associated with the specified user ID is complete

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
url string URL of output data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &matchmaking.CheckDumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CheckDumpUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->checkDumpUserDataByUserId(
        (new CheckDumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.matchmaking.result.CheckDumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
        new CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Matchmaking.Request.CheckDumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.checkDumpUserDataByUserId(
        new Gs2Matchmaking.CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.check_dump_user_data_by_user_id(
        matchmaking.CheckDumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.check_dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;
client = gs2('matchmaking')

api_result_handler = client.check_dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;

cleanUserDataByUserId

Delete user data

Execute cleaning of data associated with the specified user ID This allows you to safely delete specific user data from the project.

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &matchmaking.CleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CleanUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->cleanUserDataByUserId(
        (new CleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CleanUserDataByUserIdRequest;
import io.gs2.matchmaking.result.CleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
        new CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Matchmaking.Request.CleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.cleanUserDataByUserId(
        new Gs2Matchmaking.CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.clean_user_data_by_user_id(
        matchmaking.CleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
client = gs2('matchmaking')

api_result_handler = client.clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

checkCleanUserDataByUserId

Check if the cleaning of the data associated with the specified user ID is complete

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &matchmaking.CheckCleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CheckCleanUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->checkCleanUserDataByUserId(
        (new CheckCleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.matchmaking.result.CheckCleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
        new CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Matchmaking.Request.CheckCleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.checkCleanUserDataByUserId(
        new Gs2Matchmaking.CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.check_clean_user_data_by_user_id(
        matchmaking.CheckCleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.check_clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
client = gs2('matchmaking')

api_result_handler = client.check_clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

prepareImportUserDataByUserId

Execute import of data associated with the specified user ID

The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.

You can start the actual import process by uploading the exported zip file to the URL returned in the return value of this API and calling importUserDataByUserId.

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
uploadToken string Token used to reflect results after upload
uploadUrl string URL used to upload user data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &matchmaking.PrepareImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\PrepareImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->prepareImportUserDataByUserId(
        (new PrepareImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.matchmaking.result.PrepareImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
        new PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Matchmaking.Request.PrepareImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.prepareImportUserDataByUserId(
        new Gs2Matchmaking.PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.prepare_import_user_data_by_user_id(
        matchmaking.PrepareImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.prepare_import_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('matchmaking')

api_result_handler = client.prepare_import_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

importUserDataByUserId

Execute import of data associated with the specified user ID

The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.

Before calling this API, you must call prepareImportUserDataByUserId to complete the upload preparation.

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
uploadToken string
~ 1024 chars Token received in preparation for upload
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &matchmaking.ImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\ImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->importUserDataByUserId(
        (new ImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.ImportUserDataByUserIdRequest;
import io.gs2.matchmaking.result.ImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    ImportUserDataByUserIdResult result = client.importUserDataByUserId(
        new ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2Matchmaking.Request.ImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.importUserDataByUserId(
        new Gs2Matchmaking.ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.import_user_data_by_user_id(
        matchmaking.ImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
client = gs2('matchmaking')

api_result_handler = client.import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

checkImportUserDataByUserId

Check if the import of the data associated with the specified user ID is complete

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
uploadToken string
~ 1024 chars Token received in preparation for upload
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
url string URL of log data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &matchmaking.CheckImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CheckImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->checkImportUserDataByUserId(
        (new CheckImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CheckImportUserDataByUserIdRequest;
import io.gs2.matchmaking.result.CheckImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
        new CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2Matchmaking.Request.CheckImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.checkImportUserDataByUserId(
        new Gs2Matchmaking.CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.check_import_user_data_by_user_id(
        matchmaking.CheckImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.check_import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;
client = gs2('matchmaking')

api_result_handler = client.check_import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;

describeGatherings

Get a list of Gatherings

Retrieves a paginated list of all gatherings in the specified namespace. This includes gatherings that are currently recruiting participants as well as those that have been completed.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired

Result

Type Description
items List<Gathering> List of Gathering
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DescribeGatherings(
    &matchmaking.DescribeGatheringsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeGatheringsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->describeGatherings(
        (new DescribeGatheringsRequest())
            ->withNamespaceName("namespace-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeGatheringsRequest;
import io.gs2.matchmaking.result.DescribeGatheringsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DescribeGatheringsResult result = client.describeGatherings(
        new DescribeGatheringsRequest()
            .withNamespaceName("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Gathering> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeGatheringsResult> asyncResult = null;
yield return client.DescribeGatherings(
    new Gs2.Gs2Matchmaking.Request.DescribeGatheringsRequest()
        .WithNamespaceName("namespace-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.describeGatherings(
        new Gs2Matchmaking.DescribeGatheringsRequest()
            .withNamespaceName("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.describe_gatherings(
        matchmaking.DescribeGatheringsRequest()
            .with_namespace_name('namespace-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_gatherings({
    namespaceName="namespace-0001",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('matchmaking')

api_result_handler = client.describe_gatherings_async({
    namespaceName="namespace-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createGathering

Create a Gathering and start recruiting

The recruitment criteria are the ranges of each attribute value that will be allowed to participate in the created gathering.

For example, if you want to recruit players who want to participate in the same game mode, you can use the following formula to matchmaking with participation criteria players whose attribute values correspond exactly to the game mode

  • attribute name: game mode
  • attribute minimum: a number representing the game mode
  • attribute maximum: a number representing the game mode

to allow matchmaking between players who wish to play in the same game mode.

If you wish to implement other rating-based matchmaking, you can use the By specifying a range of attribute values centered on the room creator’s rating value, you can matchmaking between players with similar rating values. You can update this recruitment criteria later, so you can gradually relax the criteria.

Roles are used when you want to set the number of recruits for each role, such as 1 shield, 1 healer, 2 attackers, etc. Roles can have aliases. For example, a shield role can be further classified into two jobs : paladin and knight. In this case, the game could be implemented to advertise for recruits with the role name Shield and the alias Paladin Knight. The player then specifies their own Job as the role in their player information.

In this way, both paladin and knight can participate in a gathering where the recruiting condition is shield. On the other hand, if, when creating a gathering, you only want to recruit paladins and not knights, you can specify This can be accomplished by specifying paladin directly in the name of the role to be recruited, or by not including knight in the alias.

The Number of players in the Participants field specifies the number of players to be recruited. By specifying role names, you can set the number of recruits for each role name.

The Participant's player info list in Participant is used when a party has been built among players in advance, or for recruiting additional players after a participant leaves.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
player Player
Own player information
attributeRanges List<AttributeRange> [] 0 ~ 5 items Recruitment Requirements
A list of attribute range conditions that players must satisfy to join this Gathering.
Each entry specifies a named attribute and its acceptable min/max range.
A player’s own attribute values must fall within these ranges to participate. Maximum 5 conditions.
capacityOfRoles List<CapacityOfRole> [] 1 ~ 5 items List of Role Capacities
Defines the recruitment slots for this Gathering.
Each entry specifies a role name, its aliases, and the maximum number of players that can fill that role.
When all role slots reach their capacity, matchmaking is considered complete. At least 1, maximum 5 roles.
allowUserIds List<string> [] 0 ~ 100 items Allowed User IDs
A whitelist of user IDs that are permitted to join this Gathering.
When specified, only the listed users can participate in matchmaking for this Gathering.
Useful for friend-only or invitation-based matchmaking scenarios. Maximum 100 entries.
expiresAt long Gathering Expiration Time
The time at which this Gathering automatically expires and is deleted.
If matchmaking does not complete before this time, the Gathering is cleaned up.
When not specified, the Gathering persists until matchmaking completes or it is manually deleted.
expiresAtTimeSpan TimeSpan Time to expiration

Result

Type Description
item Gathering Created Gathering

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CreateGathering(
    &matchmaking.CreateGatheringRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Player: &matchmaking.Player{
            Attributes: []matchmaking.Attribute{
                matchmaking.Attribute{
                    Name: pointy.String("stage"),
                    Value: pointy.Int32(1),
                },
                matchmaking.Attribute{
                    Name: pointy.String("level"),
                    Value: pointy.Int32(10),
                },
            },
        },
        AttributeRanges: []matchmaking.AttributeRange{
            matchmaking.AttributeRange{
                Name: pointy.String("stage"),
                Min: pointy.Int32(1),
                Max: pointy.Int32(1),
            },
            matchmaking.AttributeRange{
                Name: pointy.String("level"),
                Min: pointy.Int32(0),
                Max: pointy.Int32(10),
            },
        },
        CapacityOfRoles: []matchmaking.CapacityOfRole{
            matchmaking.CapacityOfRole{
                RoleName: pointy.String("default"),
                Capacity: pointy.Int32(4),
            },
        },
        AllowUserIds: nil,
        ExpiresAt: nil,
        ExpiresAtTimeSpan: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CreateGatheringRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->createGathering(
        (new CreateGatheringRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withPlayer((new \Gs2\Matchmaking\Model\Player())
                ->withAttributes([
                    (new \Gs2\Matchmaking\Model\Attribute())
                        ->withName("stage")
                        ->withValue(1),
                    (new \Gs2\Matchmaking\Model\Attribute())
                        ->withName("level")
                        ->withValue(10),
                ]))
            ->withAttributeRanges([
                (new \Gs2\Matchmaking\Model\AttributeRange())
                    ->withName("stage")
                    ->withMin(1)
                    ->withMax(1),
                (new \Gs2\Matchmaking\Model\AttributeRange())
                    ->withName("level")
                    ->withMin(0)
                    ->withMax(10),
            ])
            ->withCapacityOfRoles([
                (new \Gs2\Matchmaking\Model\CapacityOfRole())
                    ->withRoleName("default")
                    ->withCapacity(4),
            ])
            ->withAllowUserIds(null)
            ->withExpiresAt(null)
            ->withExpiresAtTimeSpan(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CreateGatheringRequest;
import io.gs2.matchmaking.result.CreateGatheringResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    CreateGatheringResult result = client.createGathering(
        new CreateGatheringRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPlayer(new io.gs2.matchmaking.model.Player()
                .withAttributes(Arrays.asList(
                    new io.gs2.matchmaking.model.Attribute()
                        .withName("stage")
                        .withValue(1),
                    new io.gs2.matchmaking.model.Attribute()
                        .withName("level")
                        .withValue(10)
                )))
            .withAttributeRanges(Arrays.asList(
                new io.gs2.matchmaking.model.AttributeRange()
                    .withName("stage")
                    .withMin(1)
                    .withMax(1),
                new io.gs2.matchmaking.model.AttributeRange()
                    .withName("level")
                    .withMin(0)
                    .withMax(10)
            ))
            .withCapacityOfRoles(Arrays.asList(
                new io.gs2.matchmaking.model.CapacityOfRole()
                    .withRoleName("default")
                    .withCapacity(4)
            ))
            .withAllowUserIds(null)
            .withExpiresAt(null)
            .withExpiresAtTimeSpan(null)
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CreateGatheringResult> asyncResult = null;
yield return client.CreateGathering(
    new Gs2.Gs2Matchmaking.Request.CreateGatheringRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithPlayer(new Gs2.Gs2Matchmaking.Model.Player()
            .WithAttributes(new Gs2.Gs2Matchmaking.Model.Attribute_[] {
                new Gs2.Gs2Matchmaking.Model.Attribute_()
                    .WithName("stage")
                    .WithValue(1),
                new Gs2.Gs2Matchmaking.Model.Attribute_()
                    .WithName("level")
                    .WithValue(10),
            }))
        .WithAttributeRanges(new Gs2.Gs2Matchmaking.Model.AttributeRange[] {
            new Gs2.Gs2Matchmaking.Model.AttributeRange()
                .WithName("stage")
                .WithMin(1)
                .WithMax(1),
            new Gs2.Gs2Matchmaking.Model.AttributeRange()
                .WithName("level")
                .WithMin(0)
                .WithMax(10),
        })
        .WithCapacityOfRoles(new Gs2.Gs2Matchmaking.Model.CapacityOfRole[] {
            new Gs2.Gs2Matchmaking.Model.CapacityOfRole()
                .WithRoleName("default")
                .WithCapacity(4),
        })
        .WithAllowUserIds(null)
        .WithExpiresAt(null)
        .WithExpiresAtTimeSpan(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.createGathering(
        new Gs2Matchmaking.CreateGatheringRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPlayer(new Gs2Matchmaking.model.Player()
                .withAttributes([
                    new Gs2Matchmaking.model.Attribute()
                        .withName("stage")
                        .withValue(1),
                    new Gs2Matchmaking.model.Attribute()
                        .withName("level")
                        .withValue(10),
                ]))
            .withAttributeRanges([
                new Gs2Matchmaking.model.AttributeRange()
                    .withName("stage")
                    .withMin(1)
                    .withMax(1),
                new Gs2Matchmaking.model.AttributeRange()
                    .withName("level")
                    .withMin(0)
                    .withMax(10),
            ])
            .withCapacityOfRoles([
                new Gs2Matchmaking.model.CapacityOfRole()
                    .withRoleName("default")
                    .withCapacity(4),
            ])
            .withAllowUserIds(null)
            .withExpiresAt(null)
            .withExpiresAtTimeSpan(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.create_gathering(
        matchmaking.CreateGatheringRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_player(
                matchmaking.Player()
                    .with_attributes([
                        matchmaking.Attribute()
                            .with_name('stage')
                            .with_value(1),
                        matchmaking.Attribute()
                            .with_name('level')
                            .with_value(10),
                    ]))
            .with_attribute_ranges([
                matchmaking.AttributeRange()
                    .with_name('stage')
                    .with_min(1)
                    .with_max(1),
                matchmaking.AttributeRange()
                    .with_name('level')
                    .with_min(0)
                    .with_max(10),
            ])
            .with_capacity_of_roles([
                matchmaking.CapacityOfRole()
                    .with_role_name('default')
                    .with_capacity(4),
            ])
            .with_allow_user_ids(None)
            .with_expires_at(None)
            .with_expires_at_time_span(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.create_gathering({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    player={
        attributes={
            {
                name="stage",
                value=1,
            },
            {
                name="level",
                value=10,
            }
        },
    },
    attributeRanges={
        {
            name="stage",
            min=1,
            max=1,
        },
        {
            name="level",
            min=0,
            max=10,
        }
    },
    capacityOfRoles={
        {
            roleName="default",
            capacity=4,
        }
    },
    allowUserIds=nil,
    expiresAt=nil,
    expiresAtTimeSpan=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.create_gathering_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    player={
        attributes={
            {
                name="stage",
                value=1,
            },
            {
                name="level",
                value=10,
            }
        },
    },
    attributeRanges={
        {
            name="stage",
            min=1,
            max=1,
        },
        {
            name="level",
            min=0,
            max=10,
        }
    },
    capacityOfRoles={
        {
            roleName="default",
            capacity=4,
        }
    },
    allowUserIds=nil,
    expiresAt=nil,
    expiresAtTimeSpan=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

createGatheringByUserId

Create a Gathering by specifying a user ID and start recruiting

The recruitment criteria are the ranges of each attribute value that will be allowed to participate in the created gathering.

For example, if you want to recruit players who want to participate in the same game mode, you can use the following formula to matchmaking with participation criteria players whose attribute values correspond exactly to the game mode attribute name: game mode attribute minimum: a number representing the game mode `attribute maximum: a number representing the game mode to allow matchmaking between players who wish to play in the same game mode.

If you wish to implement other rating-based matchmaking, you can use the By specifying a range of attribute values centered on the room creator’s rating value, you can matchmaking between players with similar rating values. You can update this recruitment criteria later, so you can gradually relax the criteria.

Roles are used when you want to set the number of recruits for each role, such as 1 shield, 1 healer, 2 attackers, etc. Roles can have aliases. For example, a shield role can be further classified into two jobs': paladin and knight. In this case, the game could be implemented to advertise for recruits with the role name Shieldand the aliasPaladin Knight. The player then specifies their own Job` as the role in their player information.

In this way, both paladin and knight can participate in a gathering where the recruiting condition is shield. On the other hand, if, when creating a gathering, you only want to recruit paladins and not knights, you can specify This can be accomplished by specifying paladin directly in the name of the role to be recruited, or by not including knight in the alias.

The Number of players in the Participants field specifies the number of players to be recruited. By specifying role names, you can set the number of recruits for each role name.

The Participant's player info list in Participant is used when a party has been built among players in advance, or for recruiting additional players after a participant leaves.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
player Player
Own player information
attributeRanges List<AttributeRange> [] 0 ~ 5 items Recruitment Requirements
A list of attribute range conditions that players must satisfy to join this Gathering.
Each entry specifies a named attribute and its acceptable min/max range.
A player’s own attribute values must fall within these ranges to participate. Maximum 5 conditions.
capacityOfRoles List<CapacityOfRole> [] 1 ~ 5 items List of Role Capacities
Defines the recruitment slots for this Gathering.
Each entry specifies a role name, its aliases, and the maximum number of players that can fill that role.
When all role slots reach their capacity, matchmaking is considered complete. At least 1, maximum 5 roles.
allowUserIds List<string> [] 0 ~ 100 items Allowed User IDs
A whitelist of user IDs that are permitted to join this Gathering.
When specified, only the listed users can participate in matchmaking for this Gathering.
Useful for friend-only or invitation-based matchmaking scenarios. Maximum 100 entries.
expiresAt long Gathering Expiration Time
The time at which this Gathering automatically expires and is deleted.
If matchmaking does not complete before this time, the Gathering is cleaned up.
When not specified, the Gathering persists until matchmaking completes or it is manually deleted.
expiresAtTimeSpan TimeSpan Time to expiration
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Gathering Created Gathering

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CreateGatheringByUserId(
    &matchmaking.CreateGatheringByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Player: &matchmaking.Player{
            UserId: pointy.String("user-0001"),
            Attributes: []Matchmaking.Attribute{    
                Matchmaking.Attribute{
                    Name: pointy.String("attr1"),
                    Value: 1,
                }
                Matchmaking.Attribute{
                    Name: pointy.String("attr2"),
                    Value: 1,
                }
            },
        },
        AttributeRanges: []matchmaking.AttributeRange{
            matchmaking.AttributeRange{
                Name: pointy.String("stage"),
                Min: pointy.Int32(1),
                Max: pointy.Int32(2),
            },
            matchmaking.AttributeRange{
                Name: pointy.String("level"),
                Min: pointy.Int32(3),
                Max: pointy.Int32(5),
            },
        },
        CapacityOfRoles: []matchmaking.CapacityOfRole{
            matchmaking.CapacityOfRole{
                Capacity: pointy.Int32(4),
            },
        },
        AllowUserIds: nil,
        ExpiresAt: nil,
        ExpiresAtTimeSpan: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CreateGatheringByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->createGatheringByUserId(
        (new CreateGatheringByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withPlayer((new Player())
                ->withUserId("user-0001")
                ->withAttributes([
                    (new \Gs2\Matchmaking\Model\Attribute())
                        ->withName("attr1")
                        ->withValue(1)
                    (new \Gs2\Matchmaking\Model\Attribute())
                        ->withName("attr2")
                        ->withValue(1)
                ]))
            ->withAttributeRanges([
                (new AttributeRange())
                    ->withName("stage")
                    ->withMin(1)
                    ->withMax(2),
                (new AttributeRange())
                    ->withName("level")
                    ->withMin(3)
                    ->withMax(5),
            ])
            ->withCapacityOfRoles([
                (new CapacityOfRole())
                    ->withCapacity(4),
            ])
            ->withAllowUserIds(null)
            ->withExpiresAt(null)
            ->withExpiresAtTimeSpan(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CreateGatheringByUserIdRequest;
import io.gs2.matchmaking.result.CreateGatheringByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    CreateGatheringByUserIdResult result = client.createGatheringByUserId(
        new CreateGatheringByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPlayer(new Player()
                .withUserId("user-0001")
                .withAttributes(Arrays.asList(
                    new io.gs2.matchmaking.model.Attribute()
                        .withName("attr1")
                        .withValue(1)
                    new io.gs2.matchmaking.model.Attribute()
                        .withName("attr2")
                        .withValue(1),
                ))
            .withAttributeRanges(Arrays.asList(
                new AttributeRange()
                    .withName("stage")
                    .withMin(1)
                    .withMax(2),
                new AttributeRange()
                    .withName("level")
                    .withMin(3)
                    .withMax(5)
            ))
            .withCapacityOfRoles(Arrays.asList(
                new CapacityOfRole()
                    .withCapacity(4)
            ))
            .withAllowUserIds(null)
            .withExpiresAt(null)
            .withExpiresAtTimeSpan(null)
            .withTimeOffsetToken(null)
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CreateGatheringByUserIdResult> asyncResult = null;
yield return client.CreateGatheringByUserId(
    new Gs2.Gs2Matchmaking.Request.CreateGatheringByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithPlayer(new Gs2.Gs2Matchmaking.Model.Player()
            .WithUserId("user-0001")
            .WithAttributes(new Gs2.Gs2Matchmaking.Model.Attribute[] {
                    .WithName("attr1")
                    .WithValue(1)
                    .WithName("attr2")
                    .WithValue(1)
            }))
        .WithAttributeRanges(new Gs2.Gs2Matchmaking.Model.AttributeRange[] {
            new Gs2.Gs2Matchmaking.Model.AttributeRange()
                .WithName("stage")
                .WithMin(1)
                .WithMax(2),
            new Gs2.Gs2Matchmaking.Model.AttributeRange()
                .WithName("level")
                .WithMin(3)
                .WithMax(5),
        })
        .WithCapacityOfRoles(new Gs2.Gs2Matchmaking.Model.CapacityOfRole[] {
            new Gs2.Gs2Matchmaking.Model.CapacityOfRole()
                .WithCapacity(4),
        })
        .WithAllowUserIds(null)
        .WithExpiresAt(null)
        .WithExpiresAtTimeSpan(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.createGatheringByUserId(
        new Gs2Matchmaking.CreateGatheringByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPlayer(new Gs2Matchmaking.model.Player()
                .withUserId("user-0001")
                .withAttributes([
                    new Gs2Matchmaking.model.Attribute()
                        .withName("attr1")
                        .withValue(1)
                    new Gs2Matchmaking.model.Attribute()
                        .withName("attr2")
                        .withValue(1)
                ]))
            .withAttributeRanges([
                new Gs2Matchmaking.model.AttributeRange()
                    .withName("stage")
                    .withMin(1)
                    .withMax(2),
                new Gs2Matchmaking.model.AttributeRange()
                    .withName("level")
                    .withMin(3)
                    .withMax(5),
            ])
            .withCapacityOfRoles([
                new Gs2Matchmaking.model.CapacityOfRole()
                    .withCapacity(4),
            ])
            .withAllowUserIds(null)
            .withExpiresAt(null)
            .withExpiresAtTimeSpan(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.create_gathering_by_user_id(
        matchmaking.CreateGatheringByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_player(matchmaking.Player()
                .with_user_id('user-0001')
                .with_attributes([
                    matchmaking.attribute()
                        .with_name('attr1')
                        .with_value(1),
                    matchmaking.attribute()
                        .with_name('attr2')
                        .with_value(1),
                ]))
            .with_attribute_ranges([
                matchmaking.AttributeRange()
                    .with_name('stage')
                    .with_min(1)
                    .with_max(2),
                matchmaking.AttributeRange()
                    .with_name('level')
                    .with_min(3)
                    .with_max(5),
            ])
            .with_capacity_of_roles([
                matchmaking.CapacityOfRole()
                    .with_capacity(4),
            ])
            .with_allow_user_ids(None)
            .with_expires_at(None)
            .with_expires_at_time_span(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.create_gathering_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    player={
        user_id="user-0001",
        attributes={
            attribute={
                name="attr1",
                value=1,
            }attribute={
                name="attr2",
                value=1,
            }
        },
    },
    attributeRanges={
        {
            name="stage",
            min=1,
            max=2,
        },
        {
            name="level",
            min=3,
            max=5,
        }
    },
    capacityOfRoles={
        {
            capacity=4,
        }
    },
    allowUserIds=nil,
    expiresAt=nil,
    expiresAtTimeSpan=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.create_gathering_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    player={
        user_id="user-0001",
        attributes={
            attribute={
                name="attr1",
                value=1,
            }attribute={
                name="attr2",
                value=1,
            }
        },
    },
    attributeRanges={
        {
            name="stage",
            min=1,
            max=2,
        },
        {
            name="level",
            min=3,
            max=5,
        }
    },
    capacityOfRoles={
        {
            capacity=4,
        }
    },
    allowUserIds=nil,
    expiresAt=nil,
    expiresAtTimeSpan=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateGathering

Update Gathering

Updates the recruitment criteria (attribute ranges) of the specified gathering. This allows you to gradually relax or tighten the matching conditions while waiting for participants.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gatheringName string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.
accessToken string
~ 128 chars Access token
attributeRanges List<AttributeRange> [] 0 ~ 5 items Recruitment Requirements
A list of attribute range conditions that players must satisfy to join this Gathering.
Each entry specifies a named attribute and its acceptable min/max range.
A player’s own attribute values must fall within these ranges to participate. Maximum 5 conditions.

Result

Type Description
item Gathering Gathering updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.UpdateGathering(
    &matchmaking.UpdateGatheringRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GatheringName: pointy.String("gathering-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        AttributeRanges: []matchmaking.AttributeRange{
            matchmaking.AttributeRange{
                Name: pointy.String("stage"),
                Min: pointy.Int32(1),
                Max: pointy.Int32(1),
            },
            matchmaking.AttributeRange{
                Name: pointy.String("level"),
                Min: pointy.Int32(0),
                Max: pointy.Int32(50),
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateGatheringRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->updateGathering(
        (new UpdateGatheringRequest())
            ->withNamespaceName("namespace-0001")
            ->withGatheringName("gathering-0001")
            ->withAccessToken("accessToken-0001")
            ->withAttributeRanges([
                (new \Gs2\Matchmaking\Model\AttributeRange())
                    ->withName("stage")
                    ->withMin(1)
                    ->withMax(1),
                (new \Gs2\Matchmaking\Model\AttributeRange())
                    ->withName("level")
                    ->withMin(0)
                    ->withMax(50),
            ])
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateGatheringRequest;
import io.gs2.matchmaking.result.UpdateGatheringResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    UpdateGatheringResult result = client.updateGathering(
        new UpdateGatheringRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withAccessToken("accessToken-0001")
            .withAttributeRanges(Arrays.asList(
                new io.gs2.matchmaking.model.AttributeRange()
                    .withName("stage")
                    .withMin(1)
                    .withMax(1),
                new io.gs2.matchmaking.model.AttributeRange()
                    .withName("level")
                    .withMin(0)
                    .withMax(50)
            ))
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateGatheringResult> asyncResult = null;
yield return client.UpdateGathering(
    new Gs2.Gs2Matchmaking.Request.UpdateGatheringRequest()
        .WithNamespaceName("namespace-0001")
        .WithGatheringName("gathering-0001")
        .WithAccessToken("accessToken-0001")
        .WithAttributeRanges(new Gs2.Gs2Matchmaking.Model.AttributeRange[] {
            new Gs2.Gs2Matchmaking.Model.AttributeRange()
                .WithName("stage")
                .WithMin(1)
                .WithMax(1),
            new Gs2.Gs2Matchmaking.Model.AttributeRange()
                .WithName("level")
                .WithMin(0)
                .WithMax(50),
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.updateGathering(
        new Gs2Matchmaking.UpdateGatheringRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withAccessToken("accessToken-0001")
            .withAttributeRanges([
                new Gs2Matchmaking.model.AttributeRange()
                    .withName("stage")
                    .withMin(1)
                    .withMax(1),
                new Gs2Matchmaking.model.AttributeRange()
                    .withName("level")
                    .withMin(0)
                    .withMax(50),
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.update_gathering(
        matchmaking.UpdateGatheringRequest()
            .with_namespace_name('namespace-0001')
            .with_gathering_name('gathering-0001')
            .with_access_token('accessToken-0001')
            .with_attribute_ranges([
                matchmaking.AttributeRange()
                    .with_name('stage')
                    .with_min(1)
                    .with_max(1),
                matchmaking.AttributeRange()
                    .with_name('level')
                    .with_min(0)
                    .with_max(50),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.update_gathering({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    accessToken="accessToken-0001",
    attributeRanges={
        {
            name="stage",
            min=1,
            max=1,
        },
        {
            name="level",
            min=0,
            max=50,
        }
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.update_gathering_async({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    accessToken="accessToken-0001",
    attributeRanges={
        {
            name="stage",
            min=1,
            max=1,
        },
        {
            name="level",
            min=0,
            max=50,
        }
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateGatheringByUserId

Update Gathering with User ID

Updates the recruitment criteria (attribute ranges) of the specified gathering for the given user.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gatheringName string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.
userId string
~ 128 chars User ID
attributeRanges List<AttributeRange> [] 0 ~ 5 items Recruitment Requirements
A list of attribute range conditions that players must satisfy to join this Gathering.
Each entry specifies a named attribute and its acceptable min/max range.
A player’s own attribute values must fall within these ranges to participate. Maximum 5 conditions.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Gathering Gathering updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.UpdateGatheringByUserId(
    &matchmaking.UpdateGatheringByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GatheringName: pointy.String("gathering-0001"),
        UserId: pointy.String("user-0001"),
        AttributeRanges: []matchmaking.AttributeRange{
            matchmaking.AttributeRange{
                Name: pointy.String("stage"),
                Min: pointy.Int32(1),
                Max: pointy.Int32(2),
            },
            matchmaking.AttributeRange{
                Name: pointy.String("level"),
                Min: pointy.Int32(3),
                Max: pointy.Int32(5),
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateGatheringByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->updateGatheringByUserId(
        (new UpdateGatheringByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withGatheringName("gathering-0001")
            ->withUserId("user-0001")
            ->withAttributeRanges([
                (new AttributeRange())
                    ->withName("stage")
                    ->withMin(1)
                    ->withMax(2),
                (new AttributeRange())
                    ->withName("level")
                    ->withMin(3)
                    ->withMax(5),
            ])
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateGatheringByUserIdRequest;
import io.gs2.matchmaking.result.UpdateGatheringByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    UpdateGatheringByUserIdResult result = client.updateGatheringByUserId(
        new UpdateGatheringByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withAttributeRanges(Arrays.asList(
                new AttributeRange()
                    .withName("stage")
                    .withMin(1)
                    .withMax(2),
                new AttributeRange()
                    .withName("level")
                    .withMin(3)
                    .withMax(5)
            ))
            .withTimeOffsetToken(null)
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateGatheringByUserIdResult> asyncResult = null;
yield return client.UpdateGatheringByUserId(
    new Gs2.Gs2Matchmaking.Request.UpdateGatheringByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithGatheringName("gathering-0001")
        .WithUserId("user-0001")
        .WithAttributeRanges(new Gs2.Gs2Matchmaking.Model.AttributeRange[] {
            new Gs2.Gs2Matchmaking.Model.AttributeRange()
                .WithName("stage")
                .WithMin(1)
                .WithMax(2),
            new Gs2.Gs2Matchmaking.Model.AttributeRange()
                .WithName("level")
                .WithMin(3)
                .WithMax(5),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.updateGatheringByUserId(
        new Gs2Matchmaking.UpdateGatheringByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withAttributeRanges([
                new Gs2Matchmaking.model.AttributeRange()
                    .withName("stage")
                    .withMin(1)
                    .withMax(2),
                new Gs2Matchmaking.model.AttributeRange()
                    .withName("level")
                    .withMin(3)
                    .withMax(5),
            ])
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.update_gathering_by_user_id(
        matchmaking.UpdateGatheringByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_gathering_name('gathering-0001')
            .with_user_id('user-0001')
            .with_attribute_ranges([
                matchmaking.AttributeRange()
                    .with_name('stage')
                    .with_min(1)
                    .with_max(2),
                matchmaking.AttributeRange()
                    .with_name('level')
                    .with_min(3)
                    .with_max(5),
            ])
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.update_gathering_by_user_id({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    userId="user-0001",
    attributeRanges={
        {
            name="stage",
            min=1,
            max=2,
        },
        {
            name="level",
            min=3,
            max=5,
        }
    },
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.update_gathering_by_user_id_async({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    userId="user-0001",
    attributeRanges={
        {
            name="stage",
            min=1,
            max=2,
        },
        {
            name="level",
            min=3,
            max=5,
        }
    },
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

doMatchmakingByPlayer

Find a Gathering in which the Player can participate and join.

Search for a certain period of time and return a matchmaking status token' if the target is not found. Next time, the search process can be resumed from the previous time by submitting a request again with a token to keep the matchmaking status`. When all gatherings are searched but there is no gathering to join, null is returned for both the gathering and the token.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
player Player
Player Information
matchmakingContextToken string ~ 5120 chars Used to resume search Token that holds matchmaking state

Result

Type Description
item Gathering Participated Gathering
matchmakingContextToken string Token that preserves matchmaking status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DoMatchmakingByPlayer(
    &matchmaking.DoMatchmakingByPlayerRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Player: &matchmaking.Player{
            UserId: pointy.String("user-0001"),
            Attributes: []Matchmaking.Attribute{    
                Matchmaking.Attribute{
                    Name: pointy.String("attr1"),
                    Value: 1,
                }
                Matchmaking.Attribute{
                    Name: pointy.String("attr2"),
                    Value: 1,
                }
            },
        },
        MatchmakingContextToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DoMatchmakingByPlayerRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->doMatchmakingByPlayer(
        (new DoMatchmakingByPlayerRequest())
            ->withNamespaceName("namespace-0001")
            ->withPlayer((new Player())
                ->withUserId("user-0001")
                ->withAttributes([
                    (new \Gs2\Matchmaking\Model\Attribute())
                        ->withName("attr1")
                        ->withValue(1)
                    (new \Gs2\Matchmaking\Model\Attribute())
                        ->withName("attr2")
                        ->withValue(1)
                ]))
            ->withMatchmakingContextToken(null)
    );
    $item = $result->getItem();
    $matchmakingContextToken = $result->getMatchmakingContextToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DoMatchmakingByPlayerRequest;
import io.gs2.matchmaking.result.DoMatchmakingByPlayerResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DoMatchmakingByPlayerResult result = client.doMatchmakingByPlayer(
        new DoMatchmakingByPlayerRequest()
            .withNamespaceName("namespace-0001")
            .withPlayer(new Player()
                .withUserId("user-0001")
                .withAttributes(Arrays.asList(
                    new io.gs2.matchmaking.model.Attribute()
                        .withName("attr1")
                        .withValue(1)
                    new io.gs2.matchmaking.model.Attribute()
                        .withName("attr2")
                        .withValue(1),
                ))
            .withMatchmakingContextToken(null)
    );
    Gathering item = result.getItem();
    String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DoMatchmakingByPlayerResult> asyncResult = null;
yield return client.DoMatchmakingByPlayer(
    new Gs2.Gs2Matchmaking.Request.DoMatchmakingByPlayerRequest()
        .WithNamespaceName("namespace-0001")
        .WithPlayer(new Gs2.Gs2Matchmaking.Model.Player()
            .WithUserId("user-0001")
            .WithAttributes(new Gs2.Gs2Matchmaking.Model.Attribute[] {
                    .WithName("attr1")
                    .WithValue(1)
                    .WithName("attr2")
                    .WithValue(1)
            }))
        .WithMatchmakingContextToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var matchmakingContextToken = result.MatchmakingContextToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.doMatchmakingByPlayer(
        new Gs2Matchmaking.DoMatchmakingByPlayerRequest()
            .withNamespaceName("namespace-0001")
            .withPlayer(new Gs2Matchmaking.model.Player()
                .withUserId("user-0001")
                .withAttributes([
                    new Gs2Matchmaking.model.Attribute()
                        .withName("attr1")
                        .withValue(1)
                    new Gs2Matchmaking.model.Attribute()
                        .withName("attr2")
                        .withValue(1)
                ]))
            .withMatchmakingContextToken(null)
    );
    const item = result.getItem();
    const matchmakingContextToken = result.getMatchmakingContextToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.do_matchmaking_by_player(
        matchmaking.DoMatchmakingByPlayerRequest()
            .with_namespace_name('namespace-0001')
            .with_player(matchmaking.Player()
                .with_user_id('user-0001')
                .with_attributes([
                    matchmaking.attribute()
                        .with_name('attr1')
                        .with_value(1),
                    matchmaking.attribute()
                        .with_name('attr2')
                        .with_value(1),
                ]))
            .with_matchmaking_context_token(None)
    )
    item = result.item
    matchmaking_context_token = result.matchmaking_context_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.do_matchmaking_by_player({
    namespaceName="namespace-0001",
    player={
        user_id="user-0001",
        attributes={
            attribute={
                name="attr1",
                value=1,
            }attribute={
                name="attr2",
                value=1,
            }
        },
    },
    matchmakingContextToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;
client = gs2('matchmaking')

api_result_handler = client.do_matchmaking_by_player_async({
    namespaceName="namespace-0001",
    player={
        user_id="user-0001",
        attributes={
            attribute={
                name="attr1",
                value=1,
            }attribute={
                name="attr2",
                value=1,
            }
        },
    },
    matchmakingContextToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;

doMatchmaking

Find a Gathering you can join and participate.

Search for a certain period of time and return a token holding matchmaking status if no target is found. Next time, you can resume the search process from the previous time by submitting a request again with a token to keep the matchmaking status. When all gatherings are searched but there is no gathering to join, null is returned for both the gathering and the token.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
player Player
Own player information
matchmakingContextToken string ~ 5120 chars Used to resume search Token that holds matchmaking state

Result

Type Description
item Gathering Participated Gatherings
matchmakingContextToken string Token that preserves matchmaking status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DoMatchmaking(
    &matchmaking.DoMatchmakingRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Player: &matchmaking.Player{
            UserId: pointy.String("user-0001"),
            Attributes: []Matchmaking.Attribute{    
                Matchmaking.Attribute{
                    Name: pointy.String("attr1"),
                    Value: 1,
                }
                Matchmaking.Attribute{
                    Name: pointy.String("attr2"),
                    Value: 1,
                }
            },
        },
        MatchmakingContextToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DoMatchmakingRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->doMatchmaking(
        (new DoMatchmakingRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withPlayer((new Player())
                ->withUserId("user-0001")
                ->withAttributes([
                    (new \Gs2\Matchmaking\Model\Attribute())
                        ->withName("attr1")
                        ->withValue(1)
                    (new \Gs2\Matchmaking\Model\Attribute())
                        ->withName("attr2")
                        ->withValue(1)
                ]))
            ->withMatchmakingContextToken(null)
    );
    $item = $result->getItem();
    $matchmakingContextToken = $result->getMatchmakingContextToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DoMatchmakingRequest;
import io.gs2.matchmaking.result.DoMatchmakingResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DoMatchmakingResult result = client.doMatchmaking(
        new DoMatchmakingRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPlayer(new Player()
                .withUserId("user-0001")
                .withAttributes(Arrays.asList(
                    new io.gs2.matchmaking.model.Attribute()
                        .withName("attr1")
                        .withValue(1)
                    new io.gs2.matchmaking.model.Attribute()
                        .withName("attr2")
                        .withValue(1),
                ))
            .withMatchmakingContextToken(null)
    );
    Gathering item = result.getItem();
    String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DoMatchmakingResult> asyncResult = null;
yield return client.DoMatchmaking(
    new Gs2.Gs2Matchmaking.Request.DoMatchmakingRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithPlayer(new Gs2.Gs2Matchmaking.Model.Player()
            .WithUserId("user-0001")
            .WithAttributes(new Gs2.Gs2Matchmaking.Model.Attribute[] {
                    .WithName("attr1")
                    .WithValue(1)
                    .WithName("attr2")
                    .WithValue(1)
            }))
        .WithMatchmakingContextToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var matchmakingContextToken = result.MatchmakingContextToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.doMatchmaking(
        new Gs2Matchmaking.DoMatchmakingRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPlayer(new Gs2Matchmaking.model.Player()
                .withUserId("user-0001")
                .withAttributes([
                    new Gs2Matchmaking.model.Attribute()
                        .withName("attr1")
                        .withValue(1)
                    new Gs2Matchmaking.model.Attribute()
                        .withName("attr2")
                        .withValue(1)
                ]))
            .withMatchmakingContextToken(null)
    );
    const item = result.getItem();
    const matchmakingContextToken = result.getMatchmakingContextToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.do_matchmaking(
        matchmaking.DoMatchmakingRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_player(matchmaking.Player()
                .with_user_id('user-0001')
                .with_attributes([
                    matchmaking.attribute()
                        .with_name('attr1')
                        .with_value(1),
                    matchmaking.attribute()
                        .with_name('attr2')
                        .with_value(1),
                ]))
            .with_matchmaking_context_token(None)
    )
    item = result.item
    matchmaking_context_token = result.matchmaking_context_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.do_matchmaking({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    player={
        user_id="user-0001",
        attributes={
            attribute={
                name="attr1",
                value=1,
            }attribute={
                name="attr2",
                value=1,
            }
        },
    },
    matchmakingContextToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;
client = gs2('matchmaking')

api_result_handler = client.do_matchmaking_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    player={
        user_id="user-0001",
        attributes={
            attribute={
                name="attr1",
                value=1,
            }attribute={
                name="attr2",
                value=1,
            }
        },
    },
    matchmakingContextToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;

doMatchmakingByUserId

Find a Gathering you can join and participate.

Search for a certain period of time and return a token holding matchmaking status if no target is found. Next time, you can resume the search process from the previous time by submitting a request again with a token to keep the matchmaking status. When all gatherings are searched but there is no gathering to join, null is returned for both the gathering and the token.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
player Player
Own player information
matchmakingContextToken string ~ 5120 chars Used to resume search Token that holds matchmaking state
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Gathering Participated Gatherings
matchmakingContextToken string Token that preserves matchmaking status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DoMatchmakingByUserId(
    &matchmaking.DoMatchmakingByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Player: nil,
        MatchmakingContextToken: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DoMatchmakingByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->doMatchmakingByUserId(
        (new DoMatchmakingByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withPlayer(null)
            ->withMatchmakingContextToken(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $matchmakingContextToken = $result->getMatchmakingContextToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DoMatchmakingByUserIdRequest;
import io.gs2.matchmaking.result.DoMatchmakingByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DoMatchmakingByUserIdResult result = client.doMatchmakingByUserId(
        new DoMatchmakingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPlayer(null)
            .withMatchmakingContextToken(null)
            .withTimeOffsetToken(null)
    );
    Gathering item = result.getItem();
    String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DoMatchmakingByUserIdResult> asyncResult = null;
yield return client.DoMatchmakingByUserId(
    new Gs2.Gs2Matchmaking.Request.DoMatchmakingByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithPlayer(null)
        .WithMatchmakingContextToken(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var matchmakingContextToken = result.MatchmakingContextToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.doMatchmakingByUserId(
        new Gs2Matchmaking.DoMatchmakingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPlayer(null)
            .withMatchmakingContextToken(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const matchmakingContextToken = result.getMatchmakingContextToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.do_matchmaking_by_user_id(
        matchmaking.DoMatchmakingByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_player(None)
            .with_matchmaking_context_token(None)
            .with_time_offset_token(None)
    )
    item = result.item
    matchmaking_context_token = result.matchmaking_context_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.do_matchmaking_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    player=nil,
    matchmakingContextToken=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;
client = gs2('matchmaking')

api_result_handler = client.do_matchmaking_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    player=nil,
    matchmakingContextToken=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;

ping

Notify that you are waiting for matchmaking

Sends a keep-alive ping to indicate the player is still actively waiting in the gathering. When disconnect detection is enabled, players who fail to ping within the configured timeout period are automatically removed from the gathering. This also checks for timed-out players and removes them.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gatheringName string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.
accessToken string
~ 128 chars Access token

Result

Type Description
item Gathering Gathering updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.Ping(
    &matchmaking.PingRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GatheringName: pointy.String("gathering-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\PingRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->ping(
        (new PingRequest())
            ->withNamespaceName("namespace-0001")
            ->withGatheringName("gathering-0001")
            ->withAccessToken("accessToken-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.PingRequest;
import io.gs2.matchmaking.result.PingResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    PingResult result = client.ping(
        new PingRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withAccessToken("accessToken-0001")
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.PingResult> asyncResult = null;
yield return client.Ping(
    new Gs2.Gs2Matchmaking.Request.PingRequest()
        .WithNamespaceName("namespace-0001")
        .WithGatheringName("gathering-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.ping(
        new Gs2Matchmaking.PingRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.ping(
        matchmaking.PingRequest()
            .with_namespace_name('namespace-0001')
            .with_gathering_name('gathering-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.ping({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    accessToken="accessToken-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.ping_async({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    accessToken="accessToken-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

pingByUserId

Notify that you are waiting for matchmaking by specifying user ID

Sends a keep-alive ping for the specified user. Timed-out players are automatically removed.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gatheringName string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Gathering Gathering updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.PingByUserId(
    &matchmaking.PingByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GatheringName: pointy.String("gathering-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\PingByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->pingByUserId(
        (new PingByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withGatheringName("gathering-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.PingByUserIdRequest;
import io.gs2.matchmaking.result.PingByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    PingByUserIdResult result = client.pingByUserId(
        new PingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.PingByUserIdResult> asyncResult = null;
yield return client.PingByUserId(
    new Gs2.Gs2Matchmaking.Request.PingByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithGatheringName("gathering-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.pingByUserId(
        new Gs2Matchmaking.PingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.ping_by_user_id(
        matchmaking.PingByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_gathering_name('gathering-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.ping_by_user_id({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.ping_by_user_id_async({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getGathering

Get Gathering

Retrieves the specified gathering, including its current participants, attribute ranges, capacity of roles, and expiry settings.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gatheringName string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.

Result

Type Description
item Gathering Gathering

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetGathering(
    &matchmaking.GetGatheringRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GatheringName: pointy.String("gathering-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetGatheringRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getGathering(
        (new GetGatheringRequest())
            ->withNamespaceName("namespace-0001")
            ->withGatheringName("gathering-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetGatheringRequest;
import io.gs2.matchmaking.result.GetGatheringResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetGatheringResult result = client.getGathering(
        new GetGatheringRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetGatheringResult> asyncResult = null;
yield return client.GetGathering(
    new Gs2.Gs2Matchmaking.Request.GetGatheringRequest()
        .WithNamespaceName("namespace-0001")
        .WithGatheringName("gathering-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getGathering(
        new Gs2Matchmaking.GetGatheringRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_gathering(
        matchmaking.GetGatheringRequest()
            .with_namespace_name('namespace-0001')
            .with_gathering_name('gathering-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_gathering({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.get_gathering_async({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

cancelMatchmaking

Cancel Matchmaking

If matchmaking is completed before leaving the Gathering, a NotFoundException (404 error) will be thrown and the match will fail

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gatheringName string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.
accessToken string
~ 128 chars Access token

Result

Type Description
item Gathering Canceled Gathering

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CancelMatchmaking(
    &matchmaking.CancelMatchmakingRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GatheringName: pointy.String("gathering-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CancelMatchmakingRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->cancelMatchmaking(
        (new CancelMatchmakingRequest())
            ->withNamespaceName("namespace-0001")
            ->withGatheringName("gathering-0001")
            ->withAccessToken("accessToken-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CancelMatchmakingRequest;
import io.gs2.matchmaking.result.CancelMatchmakingResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    CancelMatchmakingResult result = client.cancelMatchmaking(
        new CancelMatchmakingRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withAccessToken("accessToken-0001")
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CancelMatchmakingResult> asyncResult = null;
yield return client.CancelMatchmaking(
    new Gs2.Gs2Matchmaking.Request.CancelMatchmakingRequest()
        .WithNamespaceName("namespace-0001")
        .WithGatheringName("gathering-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.cancelMatchmaking(
        new Gs2Matchmaking.CancelMatchmakingRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.cancel_matchmaking(
        matchmaking.CancelMatchmakingRequest()
            .with_namespace_name('namespace-0001')
            .with_gathering_name('gathering-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.cancel_matchmaking({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    accessToken="accessToken-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.cancel_matchmaking_async({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    accessToken="accessToken-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

cancelMatchmakingByUserId

Cancel matchmaking by specifying user ID

If matchmaking is completed before leaving the Gathering, a NotFoundException (404 error) will be thrown and the match will fail

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gatheringName string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Gathering Canceled Gathering

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CancelMatchmakingByUserId(
    &matchmaking.CancelMatchmakingByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GatheringName: pointy.String("gathering-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CancelMatchmakingByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->cancelMatchmakingByUserId(
        (new CancelMatchmakingByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withGatheringName("gathering-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CancelMatchmakingByUserIdRequest;
import io.gs2.matchmaking.result.CancelMatchmakingByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    CancelMatchmakingByUserIdResult result = client.cancelMatchmakingByUserId(
        new CancelMatchmakingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CancelMatchmakingByUserIdResult> asyncResult = null;
yield return client.CancelMatchmakingByUserId(
    new Gs2.Gs2Matchmaking.Request.CancelMatchmakingByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithGatheringName("gathering-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.cancelMatchmakingByUserId(
        new Gs2Matchmaking.CancelMatchmakingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.cancel_matchmaking_by_user_id(
        matchmaking.CancelMatchmakingByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_gathering_name('gathering-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.cancel_matchmaking_by_user_id({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.cancel_matchmaking_by_user_id_async({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

earlyComplete

Early Complete Matchmaking

Matchmaking will be completed early if the number of participants is less than the specified number. Only the player who created the Gathering can complete the match early.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gatheringName string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.
accessToken string
~ 128 chars Access token

Result

Type Description
item Gathering Canceled Gathering

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.EarlyComplete(
    &matchmaking.EarlyCompleteRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GatheringName: pointy.String("gathering-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\EarlyCompleteRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->earlyComplete(
        (new EarlyCompleteRequest())
            ->withNamespaceName("namespace-0001")
            ->withGatheringName("gathering-0001")
            ->withAccessToken("accessToken-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.EarlyCompleteRequest;
import io.gs2.matchmaking.result.EarlyCompleteResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    EarlyCompleteResult result = client.earlyComplete(
        new EarlyCompleteRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withAccessToken("accessToken-0001")
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.EarlyCompleteResult> asyncResult = null;
yield return client.EarlyComplete(
    new Gs2.Gs2Matchmaking.Request.EarlyCompleteRequest()
        .WithNamespaceName("namespace-0001")
        .WithGatheringName("gathering-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.earlyComplete(
        new Gs2Matchmaking.EarlyCompleteRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.early_complete(
        matchmaking.EarlyCompleteRequest()
            .with_namespace_name('namespace-0001')
            .with_gathering_name('gathering-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.early_complete({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    accessToken="accessToken-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.early_complete_async({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    accessToken="accessToken-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

earlyCompleteByUserId

Early Complete Matchmaking by specifying user ID

Matchmaking will be completed early if the number of participants is less than the specified number. Only the player who created the Gathering can complete the match early.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gatheringName string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Gathering Canceled Gathering

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.EarlyCompleteByUserId(
    &matchmaking.EarlyCompleteByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GatheringName: pointy.String("gathering-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\EarlyCompleteByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->earlyCompleteByUserId(
        (new EarlyCompleteByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withGatheringName("gathering-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.EarlyCompleteByUserIdRequest;
import io.gs2.matchmaking.result.EarlyCompleteByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    EarlyCompleteByUserIdResult result = client.earlyCompleteByUserId(
        new EarlyCompleteByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.EarlyCompleteByUserIdResult> asyncResult = null;
yield return client.EarlyCompleteByUserId(
    new Gs2.Gs2Matchmaking.Request.EarlyCompleteByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithGatheringName("gathering-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.earlyCompleteByUserId(
        new Gs2Matchmaking.EarlyCompleteByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.early_complete_by_user_id(
        matchmaking.EarlyCompleteByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_gathering_name('gathering-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.early_complete_by_user_id({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.early_complete_by_user_id_async({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

deleteGathering

Delete Gathering

Completely removes the specified gathering and all associated participant data.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gatheringName string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.

Result

Type Description
item Gathering Gathering deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DeleteGathering(
    &matchmaking.DeleteGatheringRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GatheringName: pointy.String("gathering-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DeleteGatheringRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->deleteGathering(
        (new DeleteGatheringRequest())
            ->withNamespaceName("namespace-0001")
            ->withGatheringName("gathering-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DeleteGatheringRequest;
import io.gs2.matchmaking.result.DeleteGatheringResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DeleteGatheringResult result = client.deleteGathering(
        new DeleteGatheringRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteGatheringResult> asyncResult = null;
yield return client.DeleteGathering(
    new Gs2.Gs2Matchmaking.Request.DeleteGatheringRequest()
        .WithNamespaceName("namespace-0001")
        .WithGatheringName("gathering-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.deleteGathering(
        new Gs2Matchmaking.DeleteGatheringRequest()
            .withNamespaceName("namespace-0001")
            .withGatheringName("gathering-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.delete_gathering(
        matchmaking.DeleteGatheringRequest()
            .with_namespace_name('namespace-0001')
            .with_gathering_name('gathering-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.delete_gathering({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.delete_gathering_async({
    namespaceName="namespace-0001",
    gatheringName="gathering-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeSeasonGatherings

Get a list of Season Gatherings

Retrieves a paginated list of season gatherings for the specified season. Can optionally filter by tier to show only gatherings at a specific skill level.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long
0 ~ 9223372036854775805 Season
tier long 0 ~ 9223372036854775805 Tier
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired

Result

Type Description
items List<SeasonGathering> List of Season Gathering
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DescribeSeasonGatherings(
    &matchmaking.DescribeSeasonGatheringsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("season-0001"),
        Season: pointy.Int64(0),
        Tier: pointy.Int64(0),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeSeasonGatheringsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->describeSeasonGatherings(
        (new DescribeSeasonGatheringsRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("season-0001")
            ->withSeason(0)
            ->withTier(0)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeSeasonGatheringsRequest;
import io.gs2.matchmaking.result.DescribeSeasonGatheringsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DescribeSeasonGatheringsResult result = client.describeSeasonGatherings(
        new DescribeSeasonGatheringsRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSeason(0L)
            .withTier(0L)
            .withPageToken(null)
            .withLimit(null)
    );
    List<SeasonGathering> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeSeasonGatheringsResult> asyncResult = null;
yield return client.DescribeSeasonGatherings(
    new Gs2.Gs2Matchmaking.Request.DescribeSeasonGatheringsRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("season-0001")
        .WithSeason(0L)
        .WithTier(0L)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.describeSeasonGatherings(
        new Gs2Matchmaking.DescribeSeasonGatheringsRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSeason(0)
            .withTier(0)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.describe_season_gatherings(
        matchmaking.DescribeSeasonGatheringsRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('season-0001')
            .with_season(0)
            .with_tier(0)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_season_gatherings({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    season=0,
    tier=0,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('matchmaking')

api_result_handler = client.describe_season_gatherings_async({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    season=0,
    tier=0,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

describeMatchmakingSeasonGatherings

Get a list of matchmaking Season Gatherings

Retrieves a paginated list of season gatherings that are currently available for matchmaking. Can optionally filter by tier. Only gatherings that have not yet reached the maximum number of participants are returned.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long
0 ~ 9223372036854775805 Season
tier long 0 ~ 9223372036854775805 Tier
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired

Result

Type Description
items List<SeasonGathering> List of Season Gathering
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DescribeMatchmakingSeasonGatherings(
    &matchmaking.DescribeMatchmakingSeasonGatheringsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("season-0001"),
        Season: pointy.Int64(0),
        Tier: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeMatchmakingSeasonGatheringsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->describeMatchmakingSeasonGatherings(
        (new DescribeMatchmakingSeasonGatheringsRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("season-0001")
            ->withSeason(0)
            ->withTier(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeMatchmakingSeasonGatheringsRequest;
import io.gs2.matchmaking.result.DescribeMatchmakingSeasonGatheringsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DescribeMatchmakingSeasonGatheringsResult result = client.describeMatchmakingSeasonGatherings(
        new DescribeMatchmakingSeasonGatheringsRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSeason(0L)
            .withTier(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<SeasonGathering> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeMatchmakingSeasonGatheringsResult> asyncResult = null;
yield return client.DescribeMatchmakingSeasonGatherings(
    new Gs2.Gs2Matchmaking.Request.DescribeMatchmakingSeasonGatheringsRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("season-0001")
        .WithSeason(0L)
        .WithTier(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.describeMatchmakingSeasonGatherings(
        new Gs2Matchmaking.DescribeMatchmakingSeasonGatheringsRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSeason(0)
            .withTier(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.describe_matchmaking_season_gatherings(
        matchmaking.DescribeMatchmakingSeasonGatheringsRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('season-0001')
            .with_season(0)
            .with_tier(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_matchmaking_season_gatherings({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    season=0,
    tier=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('matchmaking')

api_result_handler = client.describe_matchmaking_season_gatherings_async({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    season=0,
    tier=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

doSeasonMatchmaking

Find a Season Gathering you can join and participate.

Search for a certain period of time and return a token holding matchmaking status if no target is found. Next time, you can resume the search process from the previous time by submitting a request again with a token to keep the matchmaking status. When all seasonGatherings are searched but there is no seasonGathering to join, null is returned for both the seasonGathering and the token.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
matchmakingContextToken string ~ 5120 chars Used to resume search Token that holds matchmaking state

Result

Type Description
item SeasonGathering Participated Season Gatherings
matchmakingContextToken string Token that preserves matchmaking status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DoSeasonMatchmaking(
    &matchmaking.DoSeasonMatchmakingRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("season-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        MatchmakingContextToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DoSeasonMatchmakingRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->doSeasonMatchmaking(
        (new DoSeasonMatchmakingRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("season-0001")
            ->withAccessToken("accessToken-0001")
            ->withMatchmakingContextToken(null)
    );
    $item = $result->getItem();
    $matchmakingContextToken = $result->getMatchmakingContextToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DoSeasonMatchmakingRequest;
import io.gs2.matchmaking.result.DoSeasonMatchmakingResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DoSeasonMatchmakingResult result = client.doSeasonMatchmaking(
        new DoSeasonMatchmakingRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withAccessToken("accessToken-0001")
            .withMatchmakingContextToken(null)
    );
    SeasonGathering item = result.getItem();
    String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DoSeasonMatchmakingResult> asyncResult = null;
yield return client.DoSeasonMatchmaking(
    new Gs2.Gs2Matchmaking.Request.DoSeasonMatchmakingRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("season-0001")
        .WithAccessToken("accessToken-0001")
        .WithMatchmakingContextToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var matchmakingContextToken = result.MatchmakingContextToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.doSeasonMatchmaking(
        new Gs2Matchmaking.DoSeasonMatchmakingRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withAccessToken("accessToken-0001")
            .withMatchmakingContextToken(null)
    );
    const item = result.getItem();
    const matchmakingContextToken = result.getMatchmakingContextToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.do_season_matchmaking(
        matchmaking.DoSeasonMatchmakingRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('season-0001')
            .with_access_token('accessToken-0001')
            .with_matchmaking_context_token(None)
    )
    item = result.item
    matchmaking_context_token = result.matchmaking_context_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.do_season_matchmaking({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    accessToken="accessToken-0001",
    matchmakingContextToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;
client = gs2('matchmaking')

api_result_handler = client.do_season_matchmaking_async({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    accessToken="accessToken-0001",
    matchmakingContextToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;

doSeasonMatchmakingByUserId

Find a Season Gathering you can join and participate.

Search for a certain period of time and return a token holding matchmaking status if no target is found. Next time, you can resume the search process from the previous time by submitting a request again with a token to keep the matchmaking status. When all seasonGatherings are searched but there is no seasonGathering to join, null is returned for both the seasonGathering and the token.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
matchmakingContextToken string ~ 5120 chars Used to resume search Token that holds matchmaking state
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item SeasonGathering Participated Season Gatherings
matchmakingContextToken string Token that preserves matchmaking status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DoSeasonMatchmakingByUserId(
    &matchmaking.DoSeasonMatchmakingByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("season-0001"),
        UserId: pointy.String("user-0001"),
        MatchmakingContextToken: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DoSeasonMatchmakingByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->doSeasonMatchmakingByUserId(
        (new DoSeasonMatchmakingByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("season-0001")
            ->withUserId("user-0001")
            ->withMatchmakingContextToken(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $matchmakingContextToken = $result->getMatchmakingContextToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DoSeasonMatchmakingByUserIdRequest;
import io.gs2.matchmaking.result.DoSeasonMatchmakingByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DoSeasonMatchmakingByUserIdResult result = client.doSeasonMatchmakingByUserId(
        new DoSeasonMatchmakingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withUserId("user-0001")
            .withMatchmakingContextToken(null)
            .withTimeOffsetToken(null)
    );
    SeasonGathering item = result.getItem();
    String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DoSeasonMatchmakingByUserIdResult> asyncResult = null;
yield return client.DoSeasonMatchmakingByUserId(
    new Gs2.Gs2Matchmaking.Request.DoSeasonMatchmakingByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("season-0001")
        .WithUserId("user-0001")
        .WithMatchmakingContextToken(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var matchmakingContextToken = result.MatchmakingContextToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.doSeasonMatchmakingByUserId(
        new Gs2Matchmaking.DoSeasonMatchmakingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withUserId("user-0001")
            .withMatchmakingContextToken(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const matchmakingContextToken = result.getMatchmakingContextToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.do_season_matchmaking_by_user_id(
        matchmaking.DoSeasonMatchmakingByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('season-0001')
            .with_user_id('user-0001')
            .with_matchmaking_context_token(None)
            .with_time_offset_token(None)
    )
    item = result.item
    matchmaking_context_token = result.matchmaking_context_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.do_season_matchmaking_by_user_id({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    userId="user-0001",
    matchmakingContextToken=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;
client = gs2('matchmaking')

api_result_handler = client.do_season_matchmaking_by_user_id_async({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    userId="user-0001",
    matchmakingContextToken=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
matchmakingContextToken = result.matchmakingContextToken;

getSeasonGathering

Get Season Gathering

Retrieves the specified season gathering, including its participants and tier information.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long 0 ~ 9223372036854775805 Season
tier long
0 ~ 9223372036854775805 Tier
The tier level used to group players of similar rank together.
Determined by the player’s rank in the GS2-Experience model specified in the SeasonModel.
Players are only matched with others in the same tier, ensuring fair competition.
seasonGatheringName string
UUID ~ 128 chars Season Gathering Name
Season Gathering-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item SeasonGathering SeasonGathering

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetSeasonGathering(
    &matchmaking.GetSeasonGatheringRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("season-0001"),
        Season: pointy.Int64(0),
        Tier: pointy.Int64(0),
        SeasonGatheringName: pointy.String("gathering-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetSeasonGatheringRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getSeasonGathering(
        (new GetSeasonGatheringRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("season-0001")
            ->withSeason(0)
            ->withTier(0)
            ->withSeasonGatheringName("gathering-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetSeasonGatheringRequest;
import io.gs2.matchmaking.result.GetSeasonGatheringResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetSeasonGatheringResult result = client.getSeasonGathering(
        new GetSeasonGatheringRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSeason(0L)
            .withTier(0L)
            .withSeasonGatheringName("gathering-0001")
    );
    SeasonGathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetSeasonGatheringResult> asyncResult = null;
yield return client.GetSeasonGathering(
    new Gs2.Gs2Matchmaking.Request.GetSeasonGatheringRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("season-0001")
        .WithSeason(0L)
        .WithTier(0L)
        .WithSeasonGatheringName("gathering-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getSeasonGathering(
        new Gs2Matchmaking.GetSeasonGatheringRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSeason(0)
            .withTier(0)
            .withSeasonGatheringName("gathering-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_season_gathering(
        matchmaking.GetSeasonGatheringRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('season-0001')
            .with_season(0)
            .with_tier(0)
            .with_season_gathering_name('gathering-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_season_gathering({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName="gathering-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.get_season_gathering_async({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName="gathering-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

verifyIncludeParticipant

Verify if persistent gathering includes user ID

Verifies whether a user is or is not a participant of the specified season gathering. The verify type can be ‘include’ (assert user is a participant) or ’notInclude’ (assert user is not a participant). Returns an error if the verification condition is not met.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long
0 ~ 9223372036854775805 Season
tier long
0 ~ 9223372036854775805 Tier
The tier level used to group players of similar rank together.
Determined by the player’s rank in the GS2-Experience model specified in the SeasonModel.
Players are only matched with others in the same tier, ensuring fair competition.
seasonGatheringName string
UUID ~ 128 chars Season Gathering Name
Season Gathering-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
verifyType string (enum)
enum {
  “include”,
  “notInclude”
}
Type of verification
DefinitionDescription
“include”Specified user is included in the Season Gathering
“notInclude”Specified user is not included in the Season Gathering

Result

Type Description
item SeasonGathering SeasonGathering

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.VerifyIncludeParticipant(
    &matchmaking.VerifyIncludeParticipantRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("season-0001"),
        Season: pointy.Int64(0),
        Tier: pointy.Int64(0),
        SeasonGatheringName: pointy.String("gathering-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        VerifyType: pointy.String("include"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\VerifyIncludeParticipantRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->verifyIncludeParticipant(
        (new VerifyIncludeParticipantRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("season-0001")
            ->withSeason(0)
            ->withTier(0)
            ->withSeasonGatheringName("gathering-0001")
            ->withAccessToken("accessToken-0001")
            ->withVerifyType("include")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.VerifyIncludeParticipantRequest;
import io.gs2.matchmaking.result.VerifyIncludeParticipantResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    VerifyIncludeParticipantResult result = client.verifyIncludeParticipant(
        new VerifyIncludeParticipantRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSeason(0L)
            .withTier(0L)
            .withSeasonGatheringName("gathering-0001")
            .withAccessToken("accessToken-0001")
            .withVerifyType("include")
    );
    SeasonGathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.VerifyIncludeParticipantResult> asyncResult = null;
yield return client.VerifyIncludeParticipant(
    new Gs2.Gs2Matchmaking.Request.VerifyIncludeParticipantRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("season-0001")
        .WithSeason(0L)
        .WithTier(0L)
        .WithSeasonGatheringName("gathering-0001")
        .WithAccessToken("accessToken-0001")
        .WithVerifyType("include"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.verifyIncludeParticipant(
        new Gs2Matchmaking.VerifyIncludeParticipantRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSeason(0)
            .withTier(0)
            .withSeasonGatheringName("gathering-0001")
            .withAccessToken("accessToken-0001")
            .withVerifyType("include")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.verify_include_participant(
        matchmaking.VerifyIncludeParticipantRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('season-0001')
            .with_season(0)
            .with_tier(0)
            .with_season_gathering_name('gathering-0001')
            .with_access_token('accessToken-0001')
            .with_verify_type('include')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.verify_include_participant({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName="gathering-0001",
    accessToken="accessToken-0001",
    verifyType="include",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.verify_include_participant_async({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName="gathering-0001",
    accessToken="accessToken-0001",
    verifyType="include",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

verifyIncludeParticipantByUserId

Verify if persistent gathering includes user ID by specifying a user ID

Verifies whether the specified user is or is not a participant of the season gathering.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long
0 ~ 9223372036854775805 Season
tier long
0 ~ 9223372036854775805 Tier
The tier level used to group players of similar rank together.
Determined by the player’s rank in the GS2-Experience model specified in the SeasonModel.
Players are only matched with others in the same tier, ensuring fair competition.
seasonGatheringName string
UUID ~ 128 chars Season Gathering Name
Season Gathering-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
verifyType string (enum)
enum {
  “include”,
  “notInclude”
}
Type of verification
DefinitionDescription
“include”Specified user is included in the Season Gathering
“notInclude”Specified user is not included in the Season Gathering
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item SeasonGathering SeasonGathering

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.VerifyIncludeParticipantByUserId(
    &matchmaking.VerifyIncludeParticipantByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("season-0001"),
        Season: pointy.Int64(0),
        Tier: pointy.Int64(0),
        SeasonGatheringName: pointy.String("gathering-0001"),
        UserId: pointy.String("user-0001"),
        VerifyType: pointy.String("include"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\VerifyIncludeParticipantByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->verifyIncludeParticipantByUserId(
        (new VerifyIncludeParticipantByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("season-0001")
            ->withSeason(0)
            ->withTier(0)
            ->withSeasonGatheringName("gathering-0001")
            ->withUserId("user-0001")
            ->withVerifyType("include")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.VerifyIncludeParticipantByUserIdRequest;
import io.gs2.matchmaking.result.VerifyIncludeParticipantByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    VerifyIncludeParticipantByUserIdResult result = client.verifyIncludeParticipantByUserId(
        new VerifyIncludeParticipantByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSeason(0L)
            .withTier(0L)
            .withSeasonGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withVerifyType("include")
            .withTimeOffsetToken(null)
    );
    SeasonGathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.VerifyIncludeParticipantByUserIdResult> asyncResult = null;
yield return client.VerifyIncludeParticipantByUserId(
    new Gs2.Gs2Matchmaking.Request.VerifyIncludeParticipantByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("season-0001")
        .WithSeason(0L)
        .WithTier(0L)
        .WithSeasonGatheringName("gathering-0001")
        .WithUserId("user-0001")
        .WithVerifyType("include")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.verifyIncludeParticipantByUserId(
        new Gs2Matchmaking.VerifyIncludeParticipantByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSeason(0)
            .withTier(0)
            .withSeasonGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withVerifyType("include")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.verify_include_participant_by_user_id(
        matchmaking.VerifyIncludeParticipantByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('season-0001')
            .with_season(0)
            .with_tier(0)
            .with_season_gathering_name('gathering-0001')
            .with_user_id('user-0001')
            .with_verify_type('include')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.verify_include_participant_by_user_id({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName="gathering-0001",
    userId="user-0001",
    verifyType="include",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.verify_include_participant_by_user_id_async({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName="gathering-0001",
    userId="user-0001",
    verifyType="include",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

deleteSeasonGathering

Delete Season Gathering

Deletes the specified season gathering and all associated participant records.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long
0 ~ 9223372036854775805 Season
tier long
0 ~ 9223372036854775805 Tier
The tier level used to group players of similar rank together.
Determined by the player’s rank in the GS2-Experience model specified in the SeasonModel.
Players are only matched with others in the same tier, ensuring fair competition.
seasonGatheringName string
UUID ~ 128 chars Season Gathering Name
Season Gathering-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item SeasonGathering Season Gathering deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DeleteSeasonGathering(
    &matchmaking.DeleteSeasonGatheringRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("season-0001"),
        Season: pointy.Int64(0),
        Tier: pointy.Int64(0),
        SeasonGatheringName: pointy.String("gathering-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DeleteSeasonGatheringRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->deleteSeasonGathering(
        (new DeleteSeasonGatheringRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("season-0001")
            ->withSeason(0)
            ->withTier(0)
            ->withSeasonGatheringName("gathering-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DeleteSeasonGatheringRequest;
import io.gs2.matchmaking.result.DeleteSeasonGatheringResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DeleteSeasonGatheringResult result = client.deleteSeasonGathering(
        new DeleteSeasonGatheringRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSeason(0L)
            .withTier(0L)
            .withSeasonGatheringName("gathering-0001")
    );
    SeasonGathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteSeasonGatheringResult> asyncResult = null;
yield return client.DeleteSeasonGathering(
    new Gs2.Gs2Matchmaking.Request.DeleteSeasonGatheringRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("season-0001")
        .WithSeason(0L)
        .WithTier(0L)
        .WithSeasonGatheringName("gathering-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.deleteSeasonGathering(
        new Gs2Matchmaking.DeleteSeasonGatheringRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withSeason(0)
            .withTier(0)
            .withSeasonGatheringName("gathering-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.delete_season_gathering(
        matchmaking.DeleteSeasonGatheringRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('season-0001')
            .with_season(0)
            .with_tier(0)
            .with_season_gathering_name('gathering-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.delete_season_gathering({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName="gathering-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.delete_season_gathering_async({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName="gathering-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeJoinedSeasonGatherings

Get a list of joined Season Gatherings

Retrieves a paginated list of season gatherings that the requesting user has joined. Can optionally filter by season name. This allows players to see which season matchmaking groups they belong to.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
seasonName string ~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired

Result

Type Description
items List<JoinedSeasonGathering> List of Season Gathering
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DescribeJoinedSeasonGatherings(
    &matchmaking.DescribeJoinedSeasonGatheringsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        SeasonName: pointy.String("season-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeJoinedSeasonGatheringsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->describeJoinedSeasonGatherings(
        (new DescribeJoinedSeasonGatheringsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeasonName("season-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeJoinedSeasonGatheringsRequest;
import io.gs2.matchmaking.result.DescribeJoinedSeasonGatheringsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DescribeJoinedSeasonGatheringsResult result = client.describeJoinedSeasonGatherings(
        new DescribeJoinedSeasonGatheringsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withSeasonName("season-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<JoinedSeasonGathering> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeJoinedSeasonGatheringsResult> asyncResult = null;
yield return client.DescribeJoinedSeasonGatherings(
    new Gs2.Gs2Matchmaking.Request.DescribeJoinedSeasonGatheringsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeasonName("season-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.describeJoinedSeasonGatherings(
        new Gs2Matchmaking.DescribeJoinedSeasonGatheringsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withSeasonName("season-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.describe_joined_season_gatherings(
        matchmaking.DescribeJoinedSeasonGatheringsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_season_name('season-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_joined_season_gatherings({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    seasonName="season-0001",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('matchmaking')

api_result_handler = client.describe_joined_season_gatherings_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    seasonName="season-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

describeJoinedSeasonGatheringsByUserId

Get a list of joined Season Gatherings by specifying a user ID

Retrieves a paginated list of season gatherings that the specified user has joined.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
seasonName string ~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
items List<JoinedSeasonGathering> List of Season Gathering
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DescribeJoinedSeasonGatheringsByUserId(
    &matchmaking.DescribeJoinedSeasonGatheringsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        SeasonName: pointy.String("season-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeJoinedSeasonGatheringsByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->describeJoinedSeasonGatheringsByUserId(
        (new DescribeJoinedSeasonGatheringsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withSeasonName("season-0001")
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeJoinedSeasonGatheringsByUserIdRequest;
import io.gs2.matchmaking.result.DescribeJoinedSeasonGatheringsByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DescribeJoinedSeasonGatheringsByUserIdResult result = client.describeJoinedSeasonGatheringsByUserId(
        new DescribeJoinedSeasonGatheringsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withSeasonName("season-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<JoinedSeasonGathering> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeJoinedSeasonGatheringsByUserIdResult> asyncResult = null;
yield return client.DescribeJoinedSeasonGatheringsByUserId(
    new Gs2.Gs2Matchmaking.Request.DescribeJoinedSeasonGatheringsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithSeasonName("season-0001")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.describeJoinedSeasonGatheringsByUserId(
        new Gs2Matchmaking.DescribeJoinedSeasonGatheringsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withSeasonName("season-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.describe_joined_season_gatherings_by_user_id(
        matchmaking.DescribeJoinedSeasonGatheringsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_season_name('season-0001')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_joined_season_gatherings_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    seasonName="season-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('matchmaking')

api_result_handler = client.describe_joined_season_gatherings_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    seasonName="season-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

getJoinedSeasonGathering

Get joined Season Gathering

Retrieves the season gathering that the requesting user has joined for the specified season. If the target gathering no longer exists, the joined record is automatically cleaned up.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long 0 ~ 9223372036854775805 Season

Result

Type Description
item JoinedSeasonGathering JoinedSeasonGathering

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetJoinedSeasonGathering(
    &matchmaking.GetJoinedSeasonGatheringRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        SeasonName: pointy.String("season-0001"),
        Season: pointy.Int64(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetJoinedSeasonGatheringRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getJoinedSeasonGathering(
        (new GetJoinedSeasonGatheringRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeasonName("season-0001")
            ->withSeason(0)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetJoinedSeasonGatheringRequest;
import io.gs2.matchmaking.result.GetJoinedSeasonGatheringResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetJoinedSeasonGatheringResult result = client.getJoinedSeasonGathering(
        new GetJoinedSeasonGatheringRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withSeasonName("season-0001")
            .withSeason(0L)
    );
    JoinedSeasonGathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetJoinedSeasonGatheringResult> asyncResult = null;
yield return client.GetJoinedSeasonGathering(
    new Gs2.Gs2Matchmaking.Request.GetJoinedSeasonGatheringRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeasonName("season-0001")
        .WithSeason(0L),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getJoinedSeasonGathering(
        new Gs2Matchmaking.GetJoinedSeasonGatheringRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withSeasonName("season-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_joined_season_gathering(
        matchmaking.GetJoinedSeasonGatheringRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_season_name('season-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_joined_season_gathering({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    seasonName="season-0001",
    season=0,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.get_joined_season_gathering_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    seasonName="season-0001",
    season=0,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getJoinedSeasonGatheringByUserId

Get joined Season Gathering by specifying the user ID

Retrieves the season gathering that the specified user has joined for the given season.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long 0 ~ 9223372036854775805 Season
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item JoinedSeasonGathering JoinedSeasonGathering

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetJoinedSeasonGatheringByUserId(
    &matchmaking.GetJoinedSeasonGatheringByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        SeasonName: pointy.String("season-0001"),
        Season: pointy.Int64(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetJoinedSeasonGatheringByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getJoinedSeasonGatheringByUserId(
        (new GetJoinedSeasonGatheringByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withSeasonName("season-0001")
            ->withSeason(0)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetJoinedSeasonGatheringByUserIdRequest;
import io.gs2.matchmaking.result.GetJoinedSeasonGatheringByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetJoinedSeasonGatheringByUserIdResult result = client.getJoinedSeasonGatheringByUserId(
        new GetJoinedSeasonGatheringByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withSeasonName("season-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    JoinedSeasonGathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetJoinedSeasonGatheringByUserIdResult> asyncResult = null;
yield return client.GetJoinedSeasonGatheringByUserId(
    new Gs2.Gs2Matchmaking.Request.GetJoinedSeasonGatheringByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithSeasonName("season-0001")
        .WithSeason(0L)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getJoinedSeasonGatheringByUserId(
        new Gs2Matchmaking.GetJoinedSeasonGatheringByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withSeasonName("season-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_joined_season_gathering_by_user_id(
        matchmaking.GetJoinedSeasonGatheringByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_season_name('season-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_joined_season_gathering_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    seasonName="season-0001",
    season=0,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.get_joined_season_gathering_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    seasonName="season-0001",
    season=0,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeRatings

Get a list of ratings

Retrieves a paginated list of all rating entries for the requesting user. Each rating entry contains the current rating value and rating deviation (RD) based on the Glicko-2 algorithm.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired

Result

Type Description
items List<Rating> List of Rating
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DescribeRatings(
    &matchmaking.DescribeRatingsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeRatingsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->describeRatings(
        (new DescribeRatingsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeRatingsRequest;
import io.gs2.matchmaking.result.DescribeRatingsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DescribeRatingsResult result = client.describeRatings(
        new DescribeRatingsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Rating> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeRatingsResult> asyncResult = null;
yield return client.DescribeRatings(
    new Gs2.Gs2Matchmaking.Request.DescribeRatingsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.describeRatings(
        new Gs2Matchmaking.DescribeRatingsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.describe_ratings(
        matchmaking.DescribeRatingsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_ratings({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('matchmaking')

api_result_handler = client.describe_ratings_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

describeRatingsByUserId

Get a list of ratings by specifying a user ID

Retrieves a paginated list of all rating entries for the specified user.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
items List<Rating> List of Rating
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DescribeRatingsByUserId(
    &matchmaking.DescribeRatingsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeRatingsByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->describeRatingsByUserId(
        (new DescribeRatingsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeRatingsByUserIdRequest;
import io.gs2.matchmaking.result.DescribeRatingsByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DescribeRatingsByUserIdResult result = client.describeRatingsByUserId(
        new DescribeRatingsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Rating> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeRatingsByUserIdResult> asyncResult = null;
yield return client.DescribeRatingsByUserId(
    new Gs2.Gs2Matchmaking.Request.DescribeRatingsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.describeRatingsByUserId(
        new Gs2Matchmaking.DescribeRatingsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.describe_ratings_by_user_id(
        matchmaking.DescribeRatingsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_ratings_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('matchmaking')

api_result_handler = client.describe_ratings_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

getRating

Get Rating

Retrieves the current rating value and rating deviation (RD) for the specified rating model.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
ratingName string
~ 128 chars Rating name
Rating-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item Rating Rating

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetRating(
    &matchmaking.GetRatingRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RatingName: pointy.String("rating-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetRatingRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getRating(
        (new GetRatingRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRatingName("rating-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetRatingRequest;
import io.gs2.matchmaking.result.GetRatingResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetRatingResult result = client.getRating(
        new GetRatingRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRatingName("rating-0001")
    );
    Rating item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetRatingResult> asyncResult = null;
yield return client.GetRating(
    new Gs2.Gs2Matchmaking.Request.GetRatingRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRatingName("rating-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getRating(
        new Gs2Matchmaking.GetRatingRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRatingName("rating-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_rating(
        matchmaking.GetRatingRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_rating_name('rating-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_rating({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    ratingName="rating-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.get_rating_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    ratingName="rating-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getRatingByUserId

Get Rating by specifying a user ID

Retrieves the current rating value and rating deviation (RD) for the specified user and rating model.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
ratingName string
~ 128 chars Rating name
Rating-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Rating Rating

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetRatingByUserId(
    &matchmaking.GetRatingByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RatingName: pointy.String("rating-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetRatingByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getRatingByUserId(
        (new GetRatingByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRatingName("rating-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetRatingByUserIdRequest;
import io.gs2.matchmaking.result.GetRatingByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetRatingByUserIdResult result = client.getRatingByUserId(
        new GetRatingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRatingName("rating-0001")
            .withTimeOffsetToken(null)
    );
    Rating item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetRatingByUserIdResult> asyncResult = null;
yield return client.GetRatingByUserId(
    new Gs2.Gs2Matchmaking.Request.GetRatingByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRatingName("rating-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getRatingByUserId(
        new Gs2Matchmaking.GetRatingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRatingName("rating-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_rating_by_user_id(
        matchmaking.GetRatingByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_rating_name('rating-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_rating_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    ratingName="rating-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.get_rating_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    ratingName="rating-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

putResult

Recalculate rating values

The rating calculation process uses a calculation algorithm based on the Glicko-2 rating system. The initial rating value is 1500, and the more a player wins against a distant opponent, the greater the increase in rating value, and the greater the decrease in rating value for the losing side.

The rating calculation requires list of participating user IDs. Therefore, it is not appropriate to call this API directly from the client. It should be called from the game server, which can determine whether the game has been won or lost. If a client-driven game, such as a P2P game, is being realized, please use the voting function to determine the winner.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
ratingName string
~ 128 chars Rating name
Rating-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gameResults List<GameResult> 0 ~ 10 items List of Results

Result

Type Description
items List<Rating> List of Updated Rating

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.PutResult(
    &matchmaking.PutResultRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RatingName: pointy.String("rating-0001"),
        GameResults: []matchmaking.GameResult{
            matchmaking.GameResult{
                Rank: pointy.Int32(1),
                UserId: pointy.String("user-0001"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0002"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0003"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(3),
                UserId: pointy.String("user-0004"),
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\PutResultRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->putResult(
        (new PutResultRequest())
            ->withNamespaceName("namespace-0001")
            ->withRatingName("rating-0001")
            ->withGameResults([
                (new GameResult())
                    ->withRank(1)
                    ->withUserId("user-0001"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0002"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0003"),
                (new GameResult())
                    ->withRank(3)
                    ->withUserId("user-0004"),
            ])
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.PutResultRequest;
import io.gs2.matchmaking.result.PutResultResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    PutResultResult result = client.putResult(
        new PutResultRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("rating-0001")
            .withGameResults(Arrays.asList(
                new GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new GameResult()
                    .withRank(3)
                    .withUserId("user-0004")
            ))
    );
    List<Rating> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.PutResultResult> asyncResult = null;
yield return client.PutResult(
    new Gs2.Gs2Matchmaking.Request.PutResultRequest()
        .WithNamespaceName("namespace-0001")
        .WithRatingName("rating-0001")
        .WithGameResults(new Gs2.Gs2Matchmaking.Model.GameResult[] {
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(1)
                .WithUserId("user-0001"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0002"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0003"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(3)
                .WithUserId("user-0004"),
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.putResult(
        new Gs2Matchmaking.PutResultRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("rating-0001")
            .withGameResults([
                new Gs2Matchmaking.model.GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(3)
                    .withUserId("user-0004"),
            ])
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.put_result(
        matchmaking.PutResultRequest()
            .with_namespace_name('namespace-0001')
            .with_rating_name('rating-0001')
            .with_game_results([
                matchmaking.GameResult()
                    .with_rank(1)
                    .with_user_id('user-0001'),
                matchmaking.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0002'),
                matchmaking.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0003'),
                matchmaking.GameResult()
                    .with_rank(3)
                    .with_user_id('user-0004'),
            ])
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.put_result({
    namespaceName="namespace-0001",
    ratingName="rating-0001",
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
client = gs2('matchmaking')

api_result_handler = client.put_result_async({
    namespaceName="namespace-0001",
    ratingName="rating-0001",
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;

deleteRating

Delete Rating

Deletes the specified user’s rating record, resetting their rating to the initial value on next calculation.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
ratingName string
~ 128 chars Rating name
Rating-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Rating Rating deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DeleteRating(
    &matchmaking.DeleteRatingRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RatingName: pointy.String("rating-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DeleteRatingRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->deleteRating(
        (new DeleteRatingRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRatingName("rating-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DeleteRatingRequest;
import io.gs2.matchmaking.result.DeleteRatingResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DeleteRatingResult result = client.deleteRating(
        new DeleteRatingRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRatingName("rating-0001")
            .withTimeOffsetToken(null)
    );
    Rating item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteRatingResult> asyncResult = null;
yield return client.DeleteRating(
    new Gs2.Gs2Matchmaking.Request.DeleteRatingRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRatingName("rating-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.deleteRating(
        new Gs2Matchmaking.DeleteRatingRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRatingName("rating-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.delete_rating(
        matchmaking.DeleteRatingRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_rating_name('rating-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.delete_rating({
    namespaceName="namespace-0001",
    userId="user-0001",
    ratingName="rating-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.delete_rating_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    ratingName="rating-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getBallot

Prepared ballot along with signatures

Generates a cryptographically signed ballot for the requesting user to use in the voting process. The ballot contains the rating name, gathering name, user ID, and number of participants, and is signed using the specified GS2-Key for tamper detection. The returned body and signature should be submitted to the Vote or VoteMultiple endpoint.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
ratingName string
~ 128 chars Rating Model name
Rating Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gatheringName string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.
accessToken string
~ 128 chars Access token
numberOfPlayer int
2 ~ 10 Number of participants
keyId string “grn:gs2:{region}:{ownerId}:key:default:key:default” ~ 1024 chars Encryption Key GRN

Result

Type Description
item Ballot Ballot
body string Data to be signed
signature string Signature

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetBallot(
    &matchmaking.GetBallotRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RatingName: pointy.String("rating-0001"),
        GatheringName: pointy.String("gathering-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        NumberOfPlayer: pointy.Int32(4),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetBallotRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getBallot(
        (new GetBallotRequest())
            ->withNamespaceName("namespace-0001")
            ->withRatingName("rating-0001")
            ->withGatheringName("gathering-0001")
            ->withAccessToken("accessToken-0001")
            ->withNumberOfPlayer(4)
            ->withKeyId("key-0001")
    );
    $item = $result->getItem();
    $body = $result->getBody();
    $signature = $result->getSignature();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetBallotRequest;
import io.gs2.matchmaking.result.GetBallotResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetBallotResult result = client.getBallot(
        new GetBallotRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
            .withAccessToken("accessToken-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
    );
    Ballot item = result.getItem();
    String body = result.getBody();
    String signature = result.getSignature();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetBallotResult> asyncResult = null;
yield return client.GetBallot(
    new Gs2.Gs2Matchmaking.Request.GetBallotRequest()
        .WithNamespaceName("namespace-0001")
        .WithRatingName("rating-0001")
        .WithGatheringName("gathering-0001")
        .WithAccessToken("accessToken-0001")
        .WithNumberOfPlayer(4)
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getBallot(
        new Gs2Matchmaking.GetBallotRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
            .withAccessToken("accessToken-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
    );
    const item = result.getItem();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_ballot(
        matchmaking.GetBallotRequest()
            .with_namespace_name('namespace-0001')
            .with_rating_name('rating-0001')
            .with_gathering_name('gathering-0001')
            .with_access_token('accessToken-0001')
            .with_number_of_player(4)
            .with_key_id('key-0001')
    )
    item = result.item
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_ballot({
    namespaceName="namespace-0001",
    ratingName="rating-0001",
    gatheringName="gathering-0001",
    accessToken="accessToken-0001",
    numberOfPlayer=4,
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;
client = gs2('matchmaking')

api_result_handler = client.get_ballot_async({
    namespaceName="namespace-0001",
    ratingName="rating-0001",
    gatheringName="gathering-0001",
    accessToken="accessToken-0001",
    numberOfPlayer=4,
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;

getBallotByUserId

Create ballot with signatures, specifying user ID

Generates a cryptographically signed ballot for the specified user to use in the voting process.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
ratingName string
~ 128 chars Rating Model name
Rating Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gatheringName string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.
userId string
~ 128 chars User ID
numberOfPlayer int
2 ~ 10 Number of participants
keyId string “grn:gs2:{region}:{ownerId}:key:default:key:default” ~ 1024 chars Encryption Key GRN
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Ballot Ballot
body string Data to be signed
signature string Signature

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetBallotByUserId(
    &matchmaking.GetBallotByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RatingName: pointy.String("rating-0001"),
        GatheringName: pointy.String("gathering-0001"),
        UserId: pointy.String("user-0001"),
        NumberOfPlayer: pointy.Int32(4),
        KeyId: pointy.String("key-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetBallotByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getBallotByUserId(
        (new GetBallotByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRatingName("rating-0001")
            ->withGatheringName("gathering-0001")
            ->withUserId("user-0001")
            ->withNumberOfPlayer(4)
            ->withKeyId("key-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $body = $result->getBody();
    $signature = $result->getSignature();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetBallotByUserIdRequest;
import io.gs2.matchmaking.result.GetBallotByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetBallotByUserIdResult result = client.getBallotByUserId(
        new GetBallotByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
            .withTimeOffsetToken(null)
    );
    Ballot item = result.getItem();
    String body = result.getBody();
    String signature = result.getSignature();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetBallotByUserIdResult> asyncResult = null;
yield return client.GetBallotByUserId(
    new Gs2.Gs2Matchmaking.Request.GetBallotByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRatingName("rating-0001")
        .WithGatheringName("gathering-0001")
        .WithUserId("user-0001")
        .WithNumberOfPlayer(4)
        .WithKeyId("key-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getBallotByUserId(
        new Gs2Matchmaking.GetBallotByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_ballot_by_user_id(
        matchmaking.GetBallotByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_rating_name('rating-0001')
            .with_gathering_name('gathering-0001')
            .with_user_id('user-0001')
            .with_number_of_player(4)
            .with_key_id('key-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_ballot_by_user_id({
    namespaceName="namespace-0001",
    ratingName="rating-0001",
    gatheringName="gathering-0001",
    userId="user-0001",
    numberOfPlayer=4,
    keyId="key-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;
client = gs2('matchmaking')

api_result_handler = client.get_ballot_by_user_id_async({
    namespaceName="namespace-0001",
    ratingName="rating-0001",
    gatheringName="gathering-0001",
    userId="user-0001",
    numberOfPlayer=4,
    keyId="key-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;

vote

Vote on match results

Voting must take place within 5 minutes of the first vote being cast. This means that the results will not be reflected immediately, but approximately 5 minutes after the start of voting or when all players have cast their votes. If all ballots are not collected within 5 minutes, the result will be determined by a majority vote based on the votes cast at that time. If the number of votes for each result is the same, the result will be discarded (the behavior can be changed by script).

If you want to reflect the result immediately, the representative player of the winning side can collect ballots from each player and call voteMultiple to reflect the result immediately.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
ballotBody string
~ 1024 chars Data for ballot signature targets
ballotSignature string
~ 256 chars Signature
gameResults List<GameResult> 0 ~ 10 items List of Results
keyId string “grn:gs2:{region}:{ownerId}:key:default:key:default” ~ 1024 chars Encryption Key GRN

Result

Type Description
item Ballot Ballot

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.Vote(
    &matchmaking.VoteRequest {
        NamespaceName: pointy.String("namespace-0001"),
        BallotBody: pointy.String("ballotBody..."),
        BallotSignature: pointy.String("ballotSignature..."),
        GameResults: []matchmaking.GameResult{
            matchmaking.GameResult{
                Rank: pointy.Int32(1),
                UserId: pointy.String("user-0001"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0002"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0003"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(3),
                UserId: pointy.String("user-0004"),
            },
        },
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\VoteRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->vote(
        (new VoteRequest())
            ->withNamespaceName("namespace-0001")
            ->withBallotBody("ballotBody...")
            ->withBallotSignature("ballotSignature...")
            ->withGameResults([
                (new GameResult())
                    ->withRank(1)
                    ->withUserId("user-0001"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0002"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0003"),
                (new GameResult())
                    ->withRank(3)
                    ->withUserId("user-0004"),
            ])
            ->withKeyId("key-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.VoteRequest;
import io.gs2.matchmaking.result.VoteResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    VoteResult result = client.vote(
        new VoteRequest()
            .withNamespaceName("namespace-0001")
            .withBallotBody("ballotBody...")
            .withBallotSignature("ballotSignature...")
            .withGameResults(Arrays.asList(
                new GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new GameResult()
                    .withRank(3)
                    .withUserId("user-0004")
            ))
            .withKeyId("key-0001")
    );
    Ballot item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.VoteResult> asyncResult = null;
yield return client.Vote(
    new Gs2.Gs2Matchmaking.Request.VoteRequest()
        .WithNamespaceName("namespace-0001")
        .WithBallotBody("ballotBody...")
        .WithBallotSignature("ballotSignature...")
        .WithGameResults(new Gs2.Gs2Matchmaking.Model.GameResult[] {
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(1)
                .WithUserId("user-0001"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0002"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0003"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(3)
                .WithUserId("user-0004"),
        })
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.vote(
        new Gs2Matchmaking.VoteRequest()
            .withNamespaceName("namespace-0001")
            .withBallotBody("ballotBody...")
            .withBallotSignature("ballotSignature...")
            .withGameResults([
                new Gs2Matchmaking.model.GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(3)
                    .withUserId("user-0004"),
            ])
            .withKeyId("key-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.vote(
        matchmaking.VoteRequest()
            .with_namespace_name('namespace-0001')
            .with_ballot_body('ballotBody...')
            .with_ballot_signature('ballotSignature...')
            .with_game_results([
                matchmaking.GameResult()
                    .with_rank(1)
                    .with_user_id('user-0001'),
                matchmaking.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0002'),
                matchmaking.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0003'),
                matchmaking.GameResult()
                    .with_rank(3)
                    .with_user_id('user-0004'),
            ])
            .with_key_id('key-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.vote({
    namespaceName="namespace-0001",
    ballotBody="ballotBody...",
    ballotSignature="ballotSignature...",
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.vote_async({
    namespaceName="namespace-0001",
    ballotBody="ballotBody...",
    ballotSignature="ballotSignature...",
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

voteMultiple

Compile match results and vote

The side that wins the game collects the ballots of other players and uses them to vote collectively. We say ’the winning side’ because there is an incentive for the losing side to report that they won, but not vice versa. It is possible that the losing side will not hand in their ballots, but even in that case, if there is a majority of ballots, the results can still be passed.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
signedBallots List<SignedBallot> 0 ~ 10 items List of Ballot with signatures
gameResults List<GameResult> 0 ~ 10 items List of Results
keyId string “grn:gs2:{region}:{ownerId}:key:default:key:default” ~ 1024 chars Encryption Key GRN

Result

Type Description
item Ballot Ballot

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.VoteMultiple(
    &matchmaking.VoteMultipleRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SignedBallots: []matchmaking.SignedBallot{
            matchmaking.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
            matchmaking.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
            matchmaking.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
            matchmaking.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
        },
        GameResults: []matchmaking.GameResult{
            matchmaking.GameResult{
                Rank: pointy.Int32(1),
                UserId: pointy.String("user-0001"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0002"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0003"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(3),
                UserId: pointy.String("user-0004"),
            },
        },
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\VoteMultipleRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->voteMultiple(
        (new VoteMultipleRequest())
            ->withNamespaceName("namespace-0001")
            ->withSignedBallots([
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
            ])
            ->withGameResults([
                (new GameResult())
                    ->withRank(1)
                    ->withUserId("user-0001"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0002"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0003"),
                (new GameResult())
                    ->withRank(3)
                    ->withUserId("user-0004"),
            ])
            ->withKeyId("key-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.VoteMultipleRequest;
import io.gs2.matchmaking.result.VoteMultipleResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    VoteMultipleResult result = client.voteMultiple(
        new VoteMultipleRequest()
            .withNamespaceName("namespace-0001")
            .withSignedBallots(Arrays.asList(
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb")
            ))
            .withGameResults(Arrays.asList(
                new GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new GameResult()
                    .withRank(3)
                    .withUserId("user-0004")
            ))
            .withKeyId("key-0001")
    );
    Ballot item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.VoteMultipleResult> asyncResult = null;
yield return client.VoteMultiple(
    new Gs2.Gs2Matchmaking.Request.VoteMultipleRequest()
        .WithNamespaceName("namespace-0001")
        .WithSignedBallots(new Gs2.Gs2Matchmaking.Model.SignedBallot[] {
            new Gs2.Gs2Matchmaking.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
            new Gs2.Gs2Matchmaking.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
            new Gs2.Gs2Matchmaking.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
            new Gs2.Gs2Matchmaking.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
        })
        .WithGameResults(new Gs2.Gs2Matchmaking.Model.GameResult[] {
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(1)
                .WithUserId("user-0001"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0002"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0003"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(3)
                .WithUserId("user-0004"),
        })
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.voteMultiple(
        new Gs2Matchmaking.VoteMultipleRequest()
            .withNamespaceName("namespace-0001")
            .withSignedBallots([
                new Gs2Matchmaking.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new Gs2Matchmaking.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new Gs2Matchmaking.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new Gs2Matchmaking.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
            ])
            .withGameResults([
                new Gs2Matchmaking.model.GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(3)
                    .withUserId("user-0004"),
            ])
            .withKeyId("key-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.vote_multiple(
        matchmaking.VoteMultipleRequest()
            .with_namespace_name('namespace-0001')
            .with_signed_ballots([
                matchmaking.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
                matchmaking.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
                matchmaking.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
                matchmaking.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
            ])
            .with_game_results([
                matchmaking.GameResult()
                    .with_rank(1)
                    .with_user_id('user-0001'),
                matchmaking.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0002'),
                matchmaking.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0003'),
                matchmaking.GameResult()
                    .with_rank(3)
                    .with_user_id('user-0004'),
            ])
            .with_key_id('key-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.vote_multiple({
    namespaceName="namespace-0001",
    signedBallots={
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        }
    },
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.vote_multiple_async({
    namespaceName="namespace-0001",
    signedBallots={
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        }
    },
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

commitVote

Forced determination of voting status

Forces the completion of the voting process for the specified gathering. The result is determined by majority vote based on the ballots collected so far. If votes are tied, the result is discarded (behavior can be changed by script).

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
ratingName string
~ 128 chars Rating Model name
Rating Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gatheringName string
UUID ~ 128 chars Gathering name
Maintains a unique name for each Gathering.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each Gathering.

Result

Type Description

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CommitVote(
    &matchmaking.CommitVoteRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RatingName: pointy.String("rating-0001"),
        GatheringName: pointy.String("gathering-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CommitVoteRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->commitVote(
        (new CommitVoteRequest())
            ->withNamespaceName("namespace-0001")
            ->withRatingName("rating-0001")
            ->withGatheringName("gathering-0001")
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CommitVoteRequest;
import io.gs2.matchmaking.result.CommitVoteResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    CommitVoteResult result = client.commitVote(
        new CommitVoteRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CommitVoteResult> asyncResult = null;
yield return client.CommitVote(
    new Gs2.Gs2Matchmaking.Request.CommitVoteRequest()
        .WithNamespaceName("namespace-0001")
        .WithRatingName("rating-0001")
        .WithGatheringName("gathering-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.commitVote(
        new Gs2Matchmaking.CommitVoteRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.commit_vote(
        matchmaking.CommitVoteRequest()
            .with_namespace_name('namespace-0001')
            .with_rating_name('rating-0001')
            .with_gathering_name('gathering-0001')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.commit_vote({
    namespaceName="namespace-0001",
    ratingName="rating-0001",
    gatheringName="gathering-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
client = gs2('matchmaking')

api_result_handler = client.commit_vote_async({
    namespaceName="namespace-0001",
    ratingName="rating-0001",
    gatheringName="gathering-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

describeRatingModels

Get a list of Rating Models

Retrieves the list of currently active rating models for the specified namespace. Rating models define the Glicko-2 algorithm parameters such as initial value and volatility.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
items List<RatingModel> List of Rating Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DescribeRatingModels(
    &matchmaking.DescribeRatingModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeRatingModelsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->describeRatingModels(
        (new DescribeRatingModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeRatingModelsRequest;
import io.gs2.matchmaking.result.DescribeRatingModelsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DescribeRatingModelsResult result = client.describeRatingModels(
        new DescribeRatingModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<RatingModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeRatingModelsResult> asyncResult = null;
yield return client.DescribeRatingModels(
    new Gs2.Gs2Matchmaking.Request.DescribeRatingModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.describeRatingModels(
        new Gs2Matchmaking.DescribeRatingModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.describe_rating_models(
        matchmaking.DescribeRatingModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_rating_models({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
client = gs2('matchmaking')

api_result_handler = client.describe_rating_models_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;

getRatingModel

Get Rating Model

Retrieves the specified rating model, including its initial value and volatility settings for the Glicko-2 algorithm.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
ratingName string
~ 128 chars Rating Model name
Rating Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item RatingModel Rating Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetRatingModel(
    &matchmaking.GetRatingModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RatingName: pointy.String("mode1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetRatingModelRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getRatingModel(
        (new GetRatingModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withRatingName("mode1")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetRatingModelRequest;
import io.gs2.matchmaking.result.GetRatingModelResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetRatingModelResult result = client.getRatingModel(
        new GetRatingModelRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("mode1")
    );
    RatingModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetRatingModelResult> asyncResult = null;
yield return client.GetRatingModel(
    new Gs2.Gs2Matchmaking.Request.GetRatingModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithRatingName("mode1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getRatingModel(
        new Gs2Matchmaking.GetRatingModelRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("mode1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_rating_model(
        matchmaking.GetRatingModelRequest()
            .with_namespace_name('namespace-0001')
            .with_rating_name('mode1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_rating_model({
    namespaceName="namespace-0001",
    ratingName="mode1",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.get_rating_model_async({
    namespaceName="namespace-0001",
    ratingName="mode1",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeSeasonModels

Get a list of Season Models

Retrieves the list of currently active season models for the specified namespace. Season models define the maximum number of participants, tier calculation using an experience model, and challenge period events.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
items List<SeasonModel> List of Season Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DescribeSeasonModels(
    &matchmaking.DescribeSeasonModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeSeasonModelsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->describeSeasonModels(
        (new DescribeSeasonModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeSeasonModelsRequest;
import io.gs2.matchmaking.result.DescribeSeasonModelsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DescribeSeasonModelsResult result = client.describeSeasonModels(
        new DescribeSeasonModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<SeasonModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeSeasonModelsResult> asyncResult = null;
yield return client.DescribeSeasonModels(
    new Gs2.Gs2Matchmaking.Request.DescribeSeasonModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.describeSeasonModels(
        new Gs2Matchmaking.DescribeSeasonModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.describe_season_models(
        matchmaking.DescribeSeasonModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_season_models({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
client = gs2('matchmaking')

api_result_handler = client.describe_season_models_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;

getSeasonModel

Get Season Model

Retrieves the specified season model, including its maximum participants, experience model ID for tier calculation, and challenge period event ID.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item SeasonModel Season Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetSeasonModel(
    &matchmaking.GetSeasonModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("season-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetSeasonModelRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getSeasonModel(
        (new GetSeasonModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("season-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetSeasonModelRequest;
import io.gs2.matchmaking.result.GetSeasonModelResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetSeasonModelResult result = client.getSeasonModel(
        new GetSeasonModelRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
    );
    SeasonModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetSeasonModelResult> asyncResult = null;
yield return client.GetSeasonModel(
    new Gs2.Gs2Matchmaking.Request.GetSeasonModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("season-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getSeasonModel(
        new Gs2Matchmaking.GetSeasonModelRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_season_model(
        matchmaking.GetSeasonModelRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('season-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_season_model({
    namespaceName="namespace-0001",
    seasonName="season-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.get_season_model_async({
    namespaceName="namespace-0001",
    seasonName="season-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

exportMaster

Export Model Master in a master data format that can be activated

Exports the currently active rating and season model masters in a format suitable for activation. The exported data can be used to update master data in another namespace or stored as a backup.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item CurrentModelMaster Models master data that can be activated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &matchmaking.ExportMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\ExportMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->exportMaster(
        (new ExportMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.ExportMasterRequest;
import io.gs2.matchmaking.result.ExportMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Matchmaking.Request.ExportMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.exportMaster(
        new Gs2Matchmaking.ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.export_master(
        matchmaking.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.export_master({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.export_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getCurrentModelMaster

Get currently active model master data

Retrieves the currently active rating and season model master data for the specified namespace.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item CurrentModelMaster Currently active Models master data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetCurrentModelMaster(
    &matchmaking.GetCurrentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetCurrentModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getCurrentModelMaster(
        (new GetCurrentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetCurrentModelMasterRequest;
import io.gs2.matchmaking.result.GetCurrentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetCurrentModelMasterResult result = client.getCurrentModelMaster(
        new GetCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetCurrentModelMasterResult> asyncResult = null;
yield return client.GetCurrentModelMaster(
    new Gs2.Gs2Matchmaking.Request.GetCurrentModelMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getCurrentModelMaster(
        new Gs2Matchmaking.GetCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_current_model_master(
        matchmaking.GetCurrentModelMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_current_model_master({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.get_current_model_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

preUpdateCurrentModelMaster

Update currently active Models master data (3-phase version)

When uploading master data larger than 1MB, the update is performed in 3 phases.

  1. Execute this API to obtain a token and URL for uploading.
  2. Upload the master data to the obtained URL.
  3. Execute UpdateCurrentModelMaster by passing the token obtained from the the upload to reflect the master data.
Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
uploadToken string Token used to reflect results after upload
uploadUrl string URL used to upload

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentModelMaster(
    &matchmaking.PreUpdateCurrentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\PreUpdateCurrentModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentModelMaster(
        (new PreUpdateCurrentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.PreUpdateCurrentModelMasterRequest;
import io.gs2.matchmaking.result.PreUpdateCurrentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    PreUpdateCurrentModelMasterResult result = client.preUpdateCurrentModelMaster(
        new PreUpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.PreUpdateCurrentModelMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentModelMaster(
    new Gs2.Gs2Matchmaking.Request.PreUpdateCurrentModelMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.preUpdateCurrentModelMaster(
        new Gs2Matchmaking.PreUpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.pre_update_current_model_master(
        matchmaking.PreUpdateCurrentModelMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.pre_update_current_model_master({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('matchmaking')

api_result_handler = client.pre_update_current_model_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

updateCurrentModelMaster

Update currently active Models master data

Updates the currently active model master data. Supports two modes: ‘direct’ for inline settings, and ‘preUpload’ for applying settings previously uploaded via the 3-phase update process.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
mode string (enum)
enum {
  “direct”,
  “preUpload”
}
“direct” Update mode
DefinitionDescription
“direct”Directly update master data
“preUpload”Upload master data and then update
settings string {mode} == “direct”
✓*
~ 5242880 chars Master Data
* Required if mode is “direct”
uploadToken string {mode} == “preUpload”
✓*
~ 1024 chars Token obtained by pre-upload
Used to apply the uploaded master data.
* Required if mode is “preUpload”

Result

Type Description
item CurrentModelMaster Updated master data of the currently active Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentModelMaster(
    &matchmaking.UpdateCurrentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100, \"initialValue\": 1500}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150, \"initialValue\": 1500}], \"seasonModels\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}"),
        UploadToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateCurrentModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->updateCurrentModelMaster(
        (new UpdateCurrentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100, \"initialValue\": 1500}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150, \"initialValue\": 1500}], \"seasonModels\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}")
            ->withUploadToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateCurrentModelMasterRequest;
import io.gs2.matchmaking.result.UpdateCurrentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    UpdateCurrentModelMasterResult result = client.updateCurrentModelMaster(
        new UpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100, \"initialValue\": 1500}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150, \"initialValue\": 1500}], \"seasonModels\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}")
            .withUploadToken(null)
    );
    CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateCurrentModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentModelMaster(
    new Gs2.Gs2Matchmaking.Request.UpdateCurrentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100, \"initialValue\": 1500}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150, \"initialValue\": 1500}], \"seasonModels\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}")
        .WithUploadToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.updateCurrentModelMaster(
        new Gs2Matchmaking.UpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100, \"initialValue\": 1500}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150, \"initialValue\": 1500}], \"seasonModels\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.update_current_model_master(
        matchmaking.UpdateCurrentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{"version": "2020-06-24", "ratingModels": [{"name": "rating-0001", "metadata": "RATING_0001", "volatility": 100, "initialValue": 1500}, {"name": "rating-0002", "metadata": "RATING_0002", "volatility": 150, "initialValue": 1500}], "seasonModels": [{"name": "season-0001", "maximumParticipants": 50, "challengePeriodEventId": "grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"}, {"name": "season-0002", "maximumParticipants": 100, "challengePeriodEventId": "grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002"}]}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.update_current_model_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100, \"initialValue\": 1500}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150, \"initialValue\": 1500}], \"seasonModels\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}",
    uploadToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.update_current_model_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100, \"initialValue\": 1500}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150, \"initialValue\": 1500}], \"seasonModels\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}",
    uploadToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateCurrentModelMasterFromGitHub

Update currently active Models master data from GitHub

Updates the currently active model master data by fetching it from a specified GitHub repository. The API key stored in GS2-Key is used for authentication, and you can specify the branch, tag, or commit hash to checkout.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
checkoutSetting GitHubCheckoutSetting
Setting for checking out master data from GitHub

Result

Type Description
item CurrentModelMaster Updated master data of the currently active Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentModelMasterFromGitHub(
    &matchmaking.UpdateCurrentModelMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateCurrentModelMasterFromGitHubRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->updateCurrentModelMasterFromGitHub(
        (new UpdateCurrentModelMasterFromGitHubRequest())
            ->withNamespaceName("namespace-0001")
            ->withCheckoutSetting(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateCurrentModelMasterFromGitHubRequest;
import io.gs2.matchmaking.result.UpdateCurrentModelMasterFromGitHubResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    UpdateCurrentModelMasterFromGitHubResult result = client.updateCurrentModelMasterFromGitHub(
        new UpdateCurrentModelMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(null)
    );
    CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateCurrentModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentModelMasterFromGitHub(
    new Gs2.Gs2Matchmaking.Request.UpdateCurrentModelMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.updateCurrentModelMasterFromGitHub(
        new Gs2Matchmaking.UpdateCurrentModelMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.update_current_model_master_from_git_hub(
        matchmaking.UpdateCurrentModelMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.update_current_model_master_from_git_hub({
    namespaceName="namespace-0001",
    checkoutSetting=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.update_current_model_master_from_git_hub_async({
    namespaceName="namespace-0001",
    checkoutSetting=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeRatingModelMasters

Get a list of Rating Model Masters

Retrieves a paginated list of rating model masters for the specified namespace. Can optionally filter by name prefix.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefix string ~ 64 chars Filter by Rating Model name prefix
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired

Result

Type Description
items List<RatingModelMaster> List of Rating Model Masters
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DescribeRatingModelMasters(
    &matchmaking.DescribeRatingModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeRatingModelMastersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->describeRatingModelMasters(
        (new DescribeRatingModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeRatingModelMastersRequest;
import io.gs2.matchmaking.result.DescribeRatingModelMastersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DescribeRatingModelMastersResult result = client.describeRatingModelMasters(
        new DescribeRatingModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<RatingModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeRatingModelMastersResult> asyncResult = null;
yield return client.DescribeRatingModelMasters(
    new Gs2.Gs2Matchmaking.Request.DescribeRatingModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.describeRatingModelMasters(
        new Gs2Matchmaking.DescribeRatingModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.describe_rating_model_masters(
        matchmaking.DescribeRatingModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_rating_model_masters({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('matchmaking')

api_result_handler = client.describe_rating_model_masters_async({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createRatingModelMaster

Create a new Rating Model Master

Creates a new rating model master with the specified Glicko-2 algorithm parameters. You can configure the initial rating value (default: 1500) and volatility for rating calculations.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
name string
~ 128 chars Rating Model name
Rating Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
initialValue int 1500 100 ~ 10000 Initial Rating Value
The starting rate value assigned to new players when they first participate in rated matchmaking.
Defaults to 1500. All players begin at the same rating and it adjusts based on match results.
volatility int 100 1 ~ 20000 Rating Volatility
A Glicko-2 parameter that controls how much the rating value changes after each match.
Higher values cause larger rating fluctuations, making ratings adjust more quickly.
Lower values result in more stable ratings that change gradually. Defaults to 100.

Result

Type Description
item RatingModelMaster Created Rating Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CreateRatingModelMaster(
    &matchmaking.CreateRatingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("mode1"),
        Description: nil,
        Metadata: nil,
        InitialValue: nil,
        Volatility: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CreateRatingModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->createRatingModelMaster(
        (new CreateRatingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("mode1")
            ->withDescription(null)
            ->withMetadata(null)
            ->withInitialValue(null)
            ->withVolatility(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CreateRatingModelMasterRequest;
import io.gs2.matchmaking.result.CreateRatingModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    CreateRatingModelMasterResult result = client.createRatingModelMaster(
        new CreateRatingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("mode1")
            .withDescription(null)
            .withMetadata(null)
            .withInitialValue(null)
            .withVolatility(null)
    );
    RatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CreateRatingModelMasterResult> asyncResult = null;
yield return client.CreateRatingModelMaster(
    new Gs2.Gs2Matchmaking.Request.CreateRatingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("mode1")
        .WithDescription(null)
        .WithMetadata(null)
        .WithInitialValue(null)
        .WithVolatility(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.createRatingModelMaster(
        new Gs2Matchmaking.CreateRatingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("mode1")
            .withDescription(null)
            .withMetadata(null)
            .withInitialValue(null)
            .withVolatility(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.create_rating_model_master(
        matchmaking.CreateRatingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('mode1')
            .with_description(None)
            .with_metadata(None)
            .with_initial_value(None)
            .with_volatility(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.create_rating_model_master({
    namespaceName="namespace-0001",
    name="mode1",
    description=nil,
    metadata=nil,
    initialValue=nil,
    volatility=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.create_rating_model_master_async({
    namespaceName="namespace-0001",
    name="mode1",
    description=nil,
    metadata=nil,
    initialValue=nil,
    volatility=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getRatingModelMaster

Get Rating Model Master

Retrieves the specified rating model master, including its initial value and volatility settings.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
ratingName string
~ 128 chars Rating Model name
Rating Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item RatingModelMaster Rating Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetRatingModelMaster(
    &matchmaking.GetRatingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RatingName: pointy.String("mode1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetRatingModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getRatingModelMaster(
        (new GetRatingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRatingName("mode1")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetRatingModelMasterRequest;
import io.gs2.matchmaking.result.GetRatingModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetRatingModelMasterResult result = client.getRatingModelMaster(
        new GetRatingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("mode1")
    );
    RatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetRatingModelMasterResult> asyncResult = null;
yield return client.GetRatingModelMaster(
    new Gs2.Gs2Matchmaking.Request.GetRatingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRatingName("mode1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getRatingModelMaster(
        new Gs2Matchmaking.GetRatingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("mode1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_rating_model_master(
        matchmaking.GetRatingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_rating_name('mode1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_rating_model_master({
    namespaceName="namespace-0001",
    ratingName="mode1",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.get_rating_model_master_async({
    namespaceName="namespace-0001",
    ratingName="mode1",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateRatingModelMaster

Update Rating Model Master

Updates the specified rating model master. You can modify the description, metadata, initial value, and volatility settings.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
ratingName string
~ 128 chars Rating Model name
Rating Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
initialValue int 1500 100 ~ 10000 Initial Rating Value
The starting rate value assigned to new players when they first participate in rated matchmaking.
Defaults to 1500. All players begin at the same rating and it adjusts based on match results.
volatility int 100 1 ~ 20000 Rating Volatility
A Glicko-2 parameter that controls how much the rating value changes after each match.
Higher values cause larger rating fluctuations, making ratings adjust more quickly.
Lower values result in more stable ratings that change gradually. Defaults to 100.

Result

Type Description
item RatingModelMaster Rating Model Master updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.UpdateRatingModelMaster(
    &matchmaking.UpdateRatingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RatingName: pointy.String("mode1"),
        Description: pointy.String("description1"),
        Metadata: nil,
        InitialValue: nil,
        Volatility: pointy.Int32(50),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateRatingModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->updateRatingModelMaster(
        (new UpdateRatingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRatingName("mode1")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withInitialValue(null)
            ->withVolatility(50)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateRatingModelMasterRequest;
import io.gs2.matchmaking.result.UpdateRatingModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    UpdateRatingModelMasterResult result = client.updateRatingModelMaster(
        new UpdateRatingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("mode1")
            .withDescription("description1")
            .withMetadata(null)
            .withInitialValue(null)
            .withVolatility(50)
    );
    RatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateRatingModelMasterResult> asyncResult = null;
yield return client.UpdateRatingModelMaster(
    new Gs2.Gs2Matchmaking.Request.UpdateRatingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRatingName("mode1")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithInitialValue(null)
        .WithVolatility(50),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.updateRatingModelMaster(
        new Gs2Matchmaking.UpdateRatingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("mode1")
            .withDescription("description1")
            .withMetadata(null)
            .withInitialValue(null)
            .withVolatility(50)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.update_rating_model_master(
        matchmaking.UpdateRatingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_rating_name('mode1')
            .with_description('description1')
            .with_metadata(None)
            .with_initial_value(None)
            .with_volatility(50)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.update_rating_model_master({
    namespaceName="namespace-0001",
    ratingName="mode1",
    description="description1",
    metadata=nil,
    initialValue=nil,
    volatility=50,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.update_rating_model_master_async({
    namespaceName="namespace-0001",
    ratingName="mode1",
    description="description1",
    metadata=nil,
    initialValue=nil,
    volatility=50,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

deleteRatingModelMaster

Delete Rating Model Master

Deletes the specified rating model master. This does not affect the currently active master data until the next master data update.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
ratingName string
~ 128 chars Rating Model name
Rating Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item RatingModelMaster Rating Model Master deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DeleteRatingModelMaster(
    &matchmaking.DeleteRatingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RatingName: pointy.String("mode1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DeleteRatingModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->deleteRatingModelMaster(
        (new DeleteRatingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRatingName("mode1")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DeleteRatingModelMasterRequest;
import io.gs2.matchmaking.result.DeleteRatingModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DeleteRatingModelMasterResult result = client.deleteRatingModelMaster(
        new DeleteRatingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("mode1")
    );
    RatingModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteRatingModelMasterResult> asyncResult = null;
yield return client.DeleteRatingModelMaster(
    new Gs2.Gs2Matchmaking.Request.DeleteRatingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRatingName("mode1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.deleteRatingModelMaster(
        new Gs2Matchmaking.DeleteRatingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRatingName("mode1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.delete_rating_model_master(
        matchmaking.DeleteRatingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_rating_name('mode1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.delete_rating_model_master({
    namespaceName="namespace-0001",
    ratingName="mode1",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.delete_rating_model_master_async({
    namespaceName="namespace-0001",
    ratingName="mode1",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeSeasonModelMasters

Get a list of Season Model Masters

Retrieves a paginated list of season model masters for the specified namespace. Can optionally filter by name prefix.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefix string ~ 64 chars Filter by Season Model name prefix
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired

Result

Type Description
items List<SeasonModelMaster> List of Season Model Master
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DescribeSeasonModelMasters(
    &matchmaking.DescribeSeasonModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeSeasonModelMastersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->describeSeasonModelMasters(
        (new DescribeSeasonModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeSeasonModelMastersRequest;
import io.gs2.matchmaking.result.DescribeSeasonModelMastersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DescribeSeasonModelMastersResult result = client.describeSeasonModelMasters(
        new DescribeSeasonModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<SeasonModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeSeasonModelMastersResult> asyncResult = null;
yield return client.DescribeSeasonModelMasters(
    new Gs2.Gs2Matchmaking.Request.DescribeSeasonModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.describeSeasonModelMasters(
        new Gs2Matchmaking.DescribeSeasonModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.describe_season_model_masters(
        matchmaking.DescribeSeasonModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_season_model_masters({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('matchmaking')

api_result_handler = client.describe_season_model_masters_async({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createSeasonModelMaster

Create a new Season Model Master

Creates a new season model master with the specified configuration. You can configure the maximum number of participants per gathering, an experience model for tier-based matchmaking, and a challenge period event to control when matchmaking is available.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
name string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
maximumParticipants int
2 ~ 1000 Maximum Number of Participants
The maximum number of players that can join a single Season Gathering.
Once this limit is reached, the Season Gathering is considered full and no more players can join.
Must be between 2 and 1000.
experienceModelId string ~ 1024 chars Experience Model GRN for Tier Management
challengePeriodEventId string
~ 1024 chars Challenge Period Event GRN

Result

Type Description
item SeasonModelMaster Season Model Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CreateSeasonModelMaster(
    &matchmaking.CreateSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("season-0001"),
        Description: nil,
        Metadata: nil,
        MaximumParticipants: pointy.Int32(50),
        ExperienceModelId: nil,
        ChallengePeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CreateSeasonModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->createSeasonModelMaster(
        (new CreateSeasonModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("season-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withMaximumParticipants(50)
            ->withExperienceModelId(null)
            ->withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CreateSeasonModelMasterRequest;
import io.gs2.matchmaking.result.CreateSeasonModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    CreateSeasonModelMasterResult result = client.createSeasonModelMaster(
        new CreateSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("season-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMaximumParticipants(50)
            .withExperienceModelId(null)
            .withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001")
    );
    SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CreateSeasonModelMasterResult> asyncResult = null;
yield return client.CreateSeasonModelMaster(
    new Gs2.Gs2Matchmaking.Request.CreateSeasonModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("season-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithMaximumParticipants(50)
        .WithExperienceModelId(null)
        .WithChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.createSeasonModelMaster(
        new Gs2Matchmaking.CreateSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("season-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMaximumParticipants(50)
            .withExperienceModelId(null)
            .withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.create_season_model_master(
        matchmaking.CreateSeasonModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('season-0001')
            .with_description(None)
            .with_metadata(None)
            .with_maximum_participants(50)
            .with_experience_model_id(None)
            .with_challenge_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.create_season_model_master({
    namespaceName="namespace-0001",
    name="season-0001",
    description=nil,
    metadata=nil,
    maximumParticipants=50,
    experienceModelId=nil,
    challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.create_season_model_master_async({
    namespaceName="namespace-0001",
    name="season-0001",
    description=nil,
    metadata=nil,
    maximumParticipants=50,
    experienceModelId=nil,
    challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getSeasonModelMaster

Get Season Model Master

Retrieves the specified season model master, including its maximum participants, experience model ID, and challenge period event ID.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item SeasonModelMaster Season Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetSeasonModelMaster(
    &matchmaking.GetSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("season-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetSeasonModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->getSeasonModelMaster(
        (new GetSeasonModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("season-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetSeasonModelMasterRequest;
import io.gs2.matchmaking.result.GetSeasonModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetSeasonModelMasterResult result = client.getSeasonModelMaster(
        new GetSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
    );
    SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetSeasonModelMasterResult> asyncResult = null;
yield return client.GetSeasonModelMaster(
    new Gs2.Gs2Matchmaking.Request.GetSeasonModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("season-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getSeasonModelMaster(
        new Gs2Matchmaking.GetSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_season_model_master(
        matchmaking.GetSeasonModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('season-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_season_model_master({
    namespaceName="namespace-0001",
    seasonName="season-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.get_season_model_master_async({
    namespaceName="namespace-0001",
    seasonName="season-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateSeasonModelMaster

Update Season Model Master

Updates the specified season model master. You can modify the description, metadata, maximum participants, experience model ID, and challenge period event ID.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 128 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
maximumParticipants int
2 ~ 1000 Maximum Number of Participants
The maximum number of players that can join a single Season Gathering.
Once this limit is reached, the Season Gathering is considered full and no more players can join.
Must be between 2 and 1000.
experienceModelId string ~ 1024 chars Experience Model GRN for Tier Management
challengePeriodEventId string
~ 1024 chars Challenge Period Event GRN

Result

Type Description
item SeasonModelMaster Season Model Master updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.UpdateSeasonModelMaster(
    &matchmaking.UpdateSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("season-0001"),
        Description: pointy.String("description1"),
        Metadata: nil,
        MaximumParticipants: pointy.Int32(100),
        ExperienceModelId: nil,
        ChallengePeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateSeasonModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->updateSeasonModelMaster(
        (new UpdateSeasonModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("season-0001")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withMaximumParticipants(100)
            ->withExperienceModelId(null)
            ->withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateSeasonModelMasterRequest;
import io.gs2.matchmaking.result.UpdateSeasonModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    UpdateSeasonModelMasterResult result = client.updateSeasonModelMaster(
        new UpdateSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withMaximumParticipants(100)
            .withExperienceModelId(null)
            .withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002")
    );
    SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateSeasonModelMasterResult> asyncResult = null;
yield return client.UpdateSeasonModelMaster(
    new Gs2.Gs2Matchmaking.Request.UpdateSeasonModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("season-0001")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithMaximumParticipants(100)
        .WithExperienceModelId(null)
        .WithChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.updateSeasonModelMaster(
        new Gs2Matchmaking.UpdateSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withMaximumParticipants(100)
            .withExperienceModelId(null)
            .withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.update_season_model_master(
        matchmaking.UpdateSeasonModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('season-0001')
            .with_description('description1')
            .with_metadata(None)
            .with_maximum_participants(100)
            .with_experience_model_id(None)
            .with_challenge_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.update_season_model_master({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    description="description1",
    metadata=nil,
    maximumParticipants=100,
    experienceModelId=nil,
    challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.update_season_model_master_async({
    namespaceName="namespace-0001",
    seasonName="season-0001",
    description="description1",
    metadata=nil,
    maximumParticipants=100,
    experienceModelId=nil,
    challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

deleteSeasonModelMaster

Delete Season Model Master

Deletes the specified season model master. This does not affect the currently active master data until the next master data update.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
seasonName string
~ 128 chars Season Model name
Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item SeasonModelMaster Season Model Master deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/matchmaking"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DeleteSeasonModelMaster(
    &matchmaking.DeleteSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        SeasonName: pointy.String("season-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DeleteSeasonModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2MatchmakingRestClient(
    $session
);

try {
    $result = $client->deleteSeasonModelMaster(
        (new DeleteSeasonModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withSeasonName("season-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DeleteSeasonModelMasterRequest;
import io.gs2.matchmaking.result.DeleteSeasonModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DeleteSeasonModelMasterResult result = client.deleteSeasonModelMaster(
        new DeleteSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
    );
    SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteSeasonModelMasterResult> asyncResult = null;
yield return client.DeleteSeasonModelMaster(
    new Gs2.Gs2Matchmaking.Request.DeleteSeasonModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithSeasonName("season-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.deleteSeasonModelMaster(
        new Gs2Matchmaking.DeleteSeasonModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withSeasonName("season-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.delete_season_model_master(
        matchmaking.DeleteSeasonModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_season_name('season-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.delete_season_model_master({
    namespaceName="namespace-0001",
    seasonName="season-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.delete_season_model_master_async({
    namespaceName="namespace-0001",
    seasonName="season-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;