API Reference of GS2-Matchmaking SDK

Model

Namespace

Namespace

Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.

Therefore, it is necessary to create a namespace before starting to use each service.

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsNamespace GRN
namestring~ 128 charsNamespace name
descriptionstring~ 1024 charsDescription
enableRatingboolfalseUse the rating calculation function
enableDisconnectDetectionenum {
    “disable”,
    “enable”
}
“disable”~ 128 charsEnable disconnection detection of players during matchmaking
disconnectDetectionTimeoutSecondsint{enableDisconnectDetection} == “enable”15 ~ 600Time (in seconds) to wait before considering a player disconnected during matchmaking
createGatheringTriggerTypeenum {
    “none”,
    “gs2_realtime”,
    “gs2_script”
}
~ 128 charsAction when creating a new gathering
createGatheringTriggerRealtimeNamespaceIdstring{createGatheringTriggerType} == “gs2_realtime”~ 1024 charsGS2-Realtime namespace to create rooms when creating a gathering
createGatheringTriggerScriptIdstring{createGatheringTriggerType} == “gs2_script”~ 1024 charsGS2-Script script to be executed when creating a gathering
completeMatchmakingTriggerTypeenum {
    “none”,
    “gs2_realtime”,
    “gs2_script”
}
~ 128 charsAction upon completion of matchmaking
completeMatchmakingTriggerRealtimeNamespaceIdstring{completeMatchmakingTriggerType} == “gs2_realtime”~ 1024 charsGS2-Realtime namespace to create rooms when matchmaking is complete
completeMatchmakingTriggerScriptIdstring{completeMatchmakingTriggerType} == “gs2_script”~ 1024 charsGS2-Script script to be executed when matchmaking is complete
enableCollaborateSeasonRatingenum {
    “enable”,
    “disable”
}
“disable”~ 128 charsEnable collaboration with GS2-SeasonRating
collaborateSeasonRatingNamespaceIdstring{enableCollaborateSeasonRating} == “enable”~ 1024 charsGS2-SeasonRating namespace to create sessions when matchmaking is complete
collaborateSeasonRatingTtlint{enableCollaborateSeasonRating} == “enable”6060 ~ 7200Maximum time to accept GS2-SeasonRating results (seconds)
changeRatingScriptScriptSettingScript to be executed when the rating value changes
joinNotificationNotificationSettingPush notifications when new players join the Gathering
leaveNotificationNotificationSettingPush notification when a player leaves the Gathering
completeNotificationNotificationSettingPush notification when matchmaking is completed
changeRatingNotificationNotificationSettingPush notifications when rating values change
logSettingLogSettingLog output settings
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
updatedAtlongNowDatetime of last update (Unix time unit:milliseconds)
revisionlong0~ 9223372036854775805Revision

Enumeration type definition to specify as enableDisconnectDetection

Enumerator String DefinitionDescription
disableDisable
enableEnable

Enumeration type definition to specify as createGatheringTriggerType

Enumerator String DefinitionDescription
noneNone
gs2_realtimeGS2-Realtime Room Creation
gs2_scriptGS2-Script Execution

Enumeration type definition to specify as completeMatchmakingTriggerType

Enumerator String DefinitionDescription
noneNone
gs2_realtimeGS2-Realtime Room Creation
gs2_scriptGS2-Script Execution

Enumeration type definition to specify as enableCollaborateSeasonRating

Enumerator String DefinitionDescription
enableEnable
disableDisable

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.

TypeConditionRequireDefaultLimitationDescription
gatheringIdstring~ 1024 charsGathering GRN
namestringUUID~ 128 charsGathering Name
attributeRangesList<AttributeRange>[]~ 5 itemsTerms and Conditions
capacityOfRolesList<CapacityOfRole>[]1 ~ 5 itemsList of application limit
allowUserIdsList<string>[]~ 100 itemsUser ID allowed to participate
metadatastring~ 1024 charsmetadata
expiresAtlongGathering expiration date (Unix time unit:milliseconds)
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
updatedAtlongNowDatetime of last update (Unix time unit:milliseconds)
revisionlong0~ 9223372036854775805Revision

RatingModelMaster

Rating Model Master

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.

TypeConditionRequireDefaultLimitationDescription
ratingModelIdstring~ 1024 charsRating Model Master GRN
namestring~ 128 charsRating Model Name
metadatastring~ 128 charsmetadata
descriptionstring~ 1024 charsDescription
initialValueint1500100 ~ 10000Initial value of rate value
volatilityint1001 ~ 20000Magnitude of rate value fluctuation
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
updatedAtlongNowDatetime of last update (Unix time unit:milliseconds)
revisionlong0~ 9223372036854775805Revision

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.

TypeConditionRequireDefaultLimitationDescription
ratingModelIdstring~ 1024 charsRating Model GRN
namestring~ 128 charsRating Model Name
metadatastring~ 128 charsmetadata
initialValueint1500100 ~ 10000Initial value of rate value
volatilityint1001 ~ 20000Magnitude of rate value fluctuation

CurrentModelMaster

Currently available master data

GS2 uses JSON format files for master data management. By uploading the file, you can actually reflect the settings on the server.

We provide a master data editor on the management console as a way to create JSON files, but you can also create JSON files using the The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsCurrently available Master GRN
settingsstring~ 5242880 charsMaster data

SeasonModel

Season Model Master

TypeConditionRequireDefaultLimitationDescription
seasonModelIdstring~ 1024 charsSeason Model GRN
namestring~ 128 charsSeason Model Name
metadatastring~ 128 charsmetadata
maximumParticipantsint2 ~ 1000Maximum number of participants
experienceModelIdstring~ 1024 charsExperience model that holds the tier
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN that sets the period during which the season is open.

SeasonModelMaster

Season Model Master

TypeConditionRequireDefaultLimitationDescription
seasonModelIdstring~ 1024 charsSeason Model Master GRN
namestring~ 128 charsSeason Model Name
metadatastring~ 128 charsmetadata
descriptionstring~ 1024 charsDescription
maximumParticipantsint2 ~ 1000Maximum number of participants
experienceModelIdstring~ 1024 charsExperience model that holds the tier
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN that sets the period during which the season is open.
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
updatedAtlongNowDatetime of last update (Unix time unit:milliseconds)
revisionlong0~ 9223372036854775805Revision

SeasonGathering

Season Gathering

TypeConditionRequireDefaultLimitationDescription
seasonGatheringIdstring~ 1024 charsSeason Gathering GRN
seasonNamestring~ 128 charsSeason Model Name
seasonlong~ 9223372036854775805Season
tierlong~ 9223372036854775805Tier
namestringUUID~ 128 charsGathering Name
participantsList<string>[]~ 1000 itemsList of Participant User IDs
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
revisionlong0~ 9223372036854775805Revision

JoinedSeasonGathering

Joined Season Gathering

TypeConditionRequireDefaultLimitationDescription
joinedSeasonGatheringIdstring~ 1024 charsJoined Season Gathering GRN
userIdstring~ 128 charsUser Id
seasonNamestring~ 128 charsSeason Model Name
seasonlong~ 9223372036854775805Season
tierlong~ 9223372036854775805Tier
seasonGatheringNamestring~ 128 charsGathering Name
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)

ScriptSetting

Script settings

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. Synchronous execution blocks processing until the script has finished executing. Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API.

On the other hand, asynchronous execution does not block processing until the script has finished executing. Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API. However, asynchronous execution does not block processing until the script has finished executing, so it is generally recommended to use asynchronous execution.

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.

TypeConditionRequireDefaultLimitationDescription
triggerScriptIdstring~ 1024 charsScript GRN
doneTriggerTargetTypeenum {
    “none”,
    “gs2_script”,
    “aws”
}
“none”~ 128 charsNotification of Completion
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsScript GRN
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsNamespace GRN

Enumeration type definition to specify as doneTriggerTargetType

Enumerator String DefinitionDescription
noneNone
gs2_scriptGS2-Script
awsAmazon EventBridge

NotificationSetting

Push notification settings

This is a setting for sending push notifications when an event occurs in a GS2 microservice. 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 a 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 send additional processing to mobile push notifications when the destination device is offline. If you use mobile push notifications well, you may be able to realize a flow in which you can notify the player by using mobile push notifications even if you end the game during matchmaking and return to the game.

TypeConditionRequireDefaultLimitationDescription
gatewayNamespaceIdstring“grn:gs2:{region}:{ownerId}:gateway:default”~ 1024 charsGS2-Gateway namespace to use for push notifications
enableTransferMobileNotificationbool?falseForwarding to mobile push notification
soundstring{enableTransferMobileNotification} == true~ 1024 charsSound file name to be used for mobile push notifications

LogSetting

Log setting

This type manages log output settings. This type holds the identifier of the log namespace used to output log data. The log namespace ID specifies the GS2-Log namespace to aggregate and store the log data. Through this setting, API request and response log data under this namespace will be output to the target GS2-Log. GS2-Log provides logs in real time, which can be used for system monitoring, analysis, debugging, etc.

TypeConditionRequireDefaultLimitationDescription
loggingNamespaceIdstring~ 1024 charsNamespace GRN

GitHubCheckoutSetting

Setup to check out master data from GitHub

TypeConditionRequireDefaultLimitationDescription
apiKeyIdstring~ 1024 charsGitHub API key GRN
repositoryNamestring~ 1024 charsRepository Name
sourcePathstring~ 1024 charsSource code file path
referenceTypeenum {
    “commit_hash”,
    “branch”,
    “tag”
}
~ 128 charsSource of code
commitHashstring{referenceType} == “commit_hash”~ 1024 charsCommit hash
branchNamestring{referenceType} == “branch”~ 1024 charsBranch Name
tagNamestring{referenceType} == “tag”~ 1024 charsTag Name

Enumeration type definition to specify as referenceType

Enumerator String DefinitionDescription
commit_hashCommit hash
branchBranch
tagTag

AttributeRange

Terms and Conditions

TypeConditionRequireDefaultLimitationDescription
namestring~ 128 charsAttribute Name
minint0~ 2147483646Minimum attribute values that can participate in the Gathering
maxint0~ 2147483646Maximum value of attributes that can participate in the Gathering

CapacityOfRole

Application Limit

TypeConditionRequireDefaultLimitationDescription
roleNamestring“default”~ 128 charsRole Name
roleAliasesList<string>[]~ 9 itemsList of Role Name Aliases
capacityint1 ~ 256Number of applicants
participantsList<Player>[]~ 1000 itemsList of Participant Players

Attribute

Attribute Value

TypeConditionRequireDefaultLimitationDescription
namestring~ 128 charsAttribute Name
valueint0~ 2147483646Attribute value

Player

Participant Player Information

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
attributesList<Attribute>[]~ 5 itemsList of Attributes
roleNamestring“default”~ 128 charsRole Name
denyUserIdsList<string>[]~ 100 itemsList of user IDs that are denied participation
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)

Rating

Rating

An entity that holds the current rating value for each game player.

TypeConditionRequireDefaultLimitationDescription
ratingIdstring~ 1024 charsRating GRN
namestring~ 128 charsRating Name
userIdstring~ 128 charsUser Id
rateValuefloat1500.0~ 65535.0
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
updatedAtlongNowDatetime of last update (Unix time unit:milliseconds)
revisionlong0~ 9223372036854775805Revision

GameResult

Match Results

TypeConditionRequireDefaultLimitationDescription
rankint~ 2147483646Rank
userIdstring~ 128 charsUser Id

Ballot

Ballot Paper

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
ratingNamestring~ 128 charsRating name used for rating calculations
gatheringNamestring~ 128 charsName of Gathering to be voted
numberOfPlayerint2 ~ 10Number of participants

SignedBallot

Ballot with signatures

TypeConditionRequireDefaultLimitationDescription
bodystring~ 1024 charsData for ballot signature targets
signaturestring~ 256 charsSignature

WrittenBallot

Ballot Paper

TypeConditionRequireDefaultLimitationDescription
ballotBallotBallot
gameResultsList<GameResult>~ 10 itemsList of Results

Vote

Voting Situation

TypeConditionRequireDefaultLimitationDescription
voteIdstring~ 1024 charsVote GRN
ratingNamestring~ 128 charsRating Model Name
gatheringNamestringUUID~ 128 charsGathering Name
writtenBallotsList<WrittenBallot>[]~ 10 itemsList of Ballots
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
updatedAtlongNowDatetime of last update (Unix time unit:milliseconds)

TimeSpan

Time Interval

TypeConditionRequireDefaultLimitationDescription
daysint0~ 365Number of days from current time
hoursint0~ 24Hours from current time
minutesint0~ 60Minutes from current time

Methods

describeNamespaces

Get list of namespaces

Request

TypeConditionRequireDefaultLimitationDescription
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<Namespace>List of Namespace
nextPageTokenstringPage 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 {
        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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeNamespaces(
        (new DescribeNamespacesRequest())
            ->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()
            .withPageToken(null)
            .withLimit(null)
    );
    List<Namespace> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DescribeNamespacesRequest;
using Gs2.Gs2Matchmaking.Result.DescribeNamespacesResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Matchmaking.Request.DescribeNamespacesRequest()
        .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()
            .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_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({
    pageToken=nil,
    limit=nil,
})

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

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

api_result_handler = client.describe_namespaces_async({
    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['message'])
end

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

createNamespace

Create a new namespace

Request

TypeConditionRequireDefaultLimitationDescription
namestring~ 128 charsNamespace name
descriptionstring~ 1024 charsDescription
enableRatingboolfalseUse the rating calculation function
enableDisconnectDetectionenum {
    “disable”,
    “enable”
}
“disable”~ 128 charsEnable disconnection detection of players during matchmaking
disconnectDetectionTimeoutSecondsint{enableDisconnectDetection} == “enable”15 ~ 600Time (in seconds) to wait before considering a player disconnected during matchmaking
createGatheringTriggerTypeenum {
    “none”,
    “gs2_realtime”,
    “gs2_script”
}
~ 128 charsAction when creating a new gathering
createGatheringTriggerRealtimeNamespaceIdstring{createGatheringTriggerType} == “gs2_realtime”~ 1024 charsGS2-Realtime namespace to create rooms when creating a gathering
createGatheringTriggerScriptIdstring{createGatheringTriggerType} == “gs2_script”~ 1024 charsGS2-Script script to be executed when creating a gathering
completeMatchmakingTriggerTypeenum {
    “none”,
    “gs2_realtime”,
    “gs2_script”
}
~ 128 charsAction upon completion of matchmaking
completeMatchmakingTriggerRealtimeNamespaceIdstring{completeMatchmakingTriggerType} == “gs2_realtime”~ 1024 charsGS2-Realtime namespace to create rooms when matchmaking is complete
completeMatchmakingTriggerScriptIdstring{completeMatchmakingTriggerType} == “gs2_script”~ 1024 charsGS2-Script script to be executed when matchmaking is complete
enableCollaborateSeasonRatingenum {
    “enable”,
    “disable”
}
“disable”~ 128 charsEnable collaboration with GS2-SeasonRating
collaborateSeasonRatingNamespaceIdstring{enableCollaborateSeasonRating} == “enable”~ 1024 charsGS2-SeasonRating namespace to create sessions when matchmaking is complete
collaborateSeasonRatingTtlint{enableCollaborateSeasonRating} == “enable”6060 ~ 7200Maximum time to accept GS2-SeasonRating results (seconds)
changeRatingScriptScriptSettingScript to be executed when the rating value changes
joinNotificationNotificationSettingPush notifications when new players join the Gathering
leaveNotificationNotificationSettingPush notification when a player leaves the Gathering
completeNotificationNotificationSettingPush notification when matchmaking is completed
changeRatingNotificationNotificationSettingPush notifications when rating values change
logSettingLogSettingLog output settings

Enumeration type definition to specify as enableDisconnectDetection

Enumerator String DefinitionDescription
disableDisable
enableEnable

Enumeration type definition to specify as createGatheringTriggerType

Enumerator String DefinitionDescription
noneNone
gs2_realtimeGS2-Realtime Room Creation
gs2_scriptGS2-Script Execution

Enumeration type definition to specify as completeMatchmakingTriggerType

Enumerator String DefinitionDescription
noneNone
gs2_realtimeGS2-Realtime Room Creation
gs2_scriptGS2-Script Execution

Enumeration type definition to specify as enableCollaborateSeasonRating

Enumerator String DefinitionDescription
enableEnable
disableDisable

Result

TypeDescription
itemNamespaceNamespace 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("namespace1"),
        Description: 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:experience: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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName(self::namespace1)
            ->withDescription(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:experience: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("namespace1")
            .withDescription(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:experience: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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.CreateNamespaceRequest;
using Gs2.Gs2Matchmaking.Result.CreateNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Matchmaking.Request.CreateNamespaceRequest()
        .WithName("namespace1")
        .WithDescription(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:experience: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("namespace1")
            .withDescription(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:experience: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(self.hash1)
            .with_description(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:experience: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="namespace1",
    description=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:experience: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['message'])
end

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

api_result_handler = client.create_namespace_async({
    name="namespace1",
    description=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:experience: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['message'])
end

result = api_result.result
item = result.item;

getNamespaceStatus

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Result

TypeDescription
statusstring

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("namespace1"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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("namespace1")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Matchmaking.Result.GetNamespaceStatusResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Matchmaking.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace1"),
    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("namespace1")
    );
    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(self.hash1)
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_namespace_status({
    namespaceName="namespace1",
})

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

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

api_result_handler = client.get_namespace_status_async({
    namespaceName="namespace1",
})

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['message'])
end

result = api_result.result
status = result.status;

getNamespace

Get namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Result

TypeDescription
itemNamespaceNamespace

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("namespace1"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.GetNamespaceRequest;
using Gs2.Gs2Matchmaking.Result.GetNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Matchmaking.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace1"),
    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("namespace1")
    );
    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(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_namespace({
    namespaceName="namespace1",
})

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

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

api_result_handler = client.get_namespace_async({
    namespaceName="namespace1",
})

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['message'])
end

result = api_result.result
item = result.item;

updateNamespace

Update namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
descriptionstring~ 1024 charsDescription
enableRatingboolfalseUse the rating calculation function
enableDisconnectDetectionenum {
    “disable”,
    “enable”
}
“disable”~ 128 charsEnable disconnection detection of players during matchmaking
disconnectDetectionTimeoutSecondsint{enableDisconnectDetection} == “enable”15 ~ 600Time (in seconds) to wait before considering a player disconnected during matchmaking
createGatheringTriggerTypeenum {
    “none”,
    “gs2_realtime”,
    “gs2_script”
}
~ 128 charsAction when creating a new gathering
createGatheringTriggerRealtimeNamespaceIdstring{createGatheringTriggerType} == “gs2_realtime”~ 1024 charsGS2-Realtime namespace to create rooms when creating a gathering
createGatheringTriggerScriptIdstring{createGatheringTriggerType} == “gs2_script”~ 1024 charsGS2-Script script to be executed when creating a gathering
completeMatchmakingTriggerTypeenum {
    “none”,
    “gs2_realtime”,
    “gs2_script”
}
~ 128 charsAction upon completion of matchmaking
completeMatchmakingTriggerRealtimeNamespaceIdstring{completeMatchmakingTriggerType} == “gs2_realtime”~ 1024 charsGS2-Realtime namespace to create rooms when matchmaking is complete
completeMatchmakingTriggerScriptIdstring{completeMatchmakingTriggerType} == “gs2_script”~ 1024 charsGS2-Script script to be executed when matchmaking is complete
enableCollaborateSeasonRatingenum {
    “enable”,
    “disable”
}
“disable”~ 128 charsEnable collaboration with GS2-SeasonRating
collaborateSeasonRatingNamespaceIdstring{enableCollaborateSeasonRating} == “enable”~ 1024 charsGS2-SeasonRating namespace to create sessions when matchmaking is complete
collaborateSeasonRatingTtlint{enableCollaborateSeasonRating} == “enable”6060 ~ 7200Maximum time to accept GS2-SeasonRating results (seconds)
changeRatingScriptScriptSettingScript to be executed when the rating value changes
joinNotificationNotificationSettingPush notifications when new players join the Gathering
leaveNotificationNotificationSettingPush notification when a player leaves the Gathering
completeNotificationNotificationSettingPush notification when matchmaking is completed
changeRatingNotificationNotificationSettingPush notifications when rating values change
logSettingLogSettingLog output settings

Enumeration type definition to specify as enableDisconnectDetection

Enumerator String DefinitionDescription
disableDisable
enableEnable

Enumeration type definition to specify as createGatheringTriggerType

Enumerator String DefinitionDescription
noneNone
gs2_realtimeGS2-Realtime Room Creation
gs2_scriptGS2-Script Execution

Enumeration type definition to specify as completeMatchmakingTriggerType

Enumerator String DefinitionDescription
noneNone
gs2_realtimeGS2-Realtime Room Creation
gs2_scriptGS2-Script Execution

Enumeration type definition to specify as enableCollaborateSeasonRating

Enumerator String DefinitionDescription
enableEnable
disableDisable

Result

TypeDescription
itemNamespaceUpdated 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.UpdateNamespace(
    &matchmaking.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        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:experience: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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName(self::namespace1)
            ->withDescription("description1")
            ->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:experience: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("namespace1")
            .withDescription("description1")
            .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:experience: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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.UpdateNamespaceRequest;
using Gs2.Gs2Matchmaking.Result.UpdateNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Matchmaking.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace1")
        .WithDescription("description1")
        .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:experience: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("namespace1")
            .withDescription("description1")
            .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:experience: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(self.hash1)
            .with_description('description1')
            .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:experience: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="namespace1",
    description="description1",
    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:experience: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['message'])
end

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

api_result_handler = client.update_namespace_async({
    namespaceName="namespace1",
    description="description1",
    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:experience: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['message'])
end

result = api_result.result
item = result.item;

deleteNamespace

Delete namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Result

TypeDescription
itemNamespaceDeleted 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("namespace1"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DeleteNamespaceRequest;
using Gs2.Gs2Matchmaking.Result.DeleteNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Matchmaking.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace1"),
    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("namespace1")
    );
    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(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.delete_namespace({
    namespaceName="namespace1",
})

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

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

api_result_handler = client.delete_namespace_async({
    namespaceName="namespace1",
})

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['message'])
end

result = api_result.result
item = result.item;

dumpUserDataByUserId

Get dump data of the data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

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 Gs2AccountRestClient(
    $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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.DumpUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
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['message'])
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['message'])
end

result = api_result.result

checkDumpUserDataByUserId

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

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL 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 Gs2AccountRestClient(
    $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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.CheckDumpUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
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['message'])
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['message'])
end

result = api_result.result
url = result.url;

cleanUserDataByUserId

Get clean data of the data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

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 Gs2AccountRestClient(
    $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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.CleanUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
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['message'])
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['message'])
end

result = api_result.result

checkCleanUserDataByUserId

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

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

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 Gs2AccountRestClient(
    $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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.CheckCleanUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
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['message'])
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['message'])
end

result = api_result.result

prepareImportUserDataByUserId

Start importing data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
uploadTokenstringToken used to reflect results after upload
uploadUrlstringURL 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 Gs2AccountRestClient(
    $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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.PrepareImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
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['message'])
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['message'])
end

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

importUserDataByUserId

Start importing data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
uploadTokenstring~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

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 Gs2AccountRestClient(
    $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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.ImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
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['message'])
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['message'])
end

result = api_result.result

checkImportUserDataByUserId

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

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
uploadTokenstring~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL 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 Gs2AccountRestClient(
    $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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.CheckImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
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['message'])
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['message'])
end

result = api_result.result
url = result.url;

describeGatherings

Get list of Gatherings

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<Gathering>List of Gathering
nextPageTokenstringPage 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("namespace1"),
        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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeGatherings(
        (new DescribeGatheringsRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Gathering> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DescribeGatheringsRequest;
using Gs2.Gs2Matchmaking.Result.DescribeGatheringsResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.DescribeGatheringsResult> asyncResult = null;
yield return client.DescribeGatherings(
    new Gs2.Gs2Matchmaking.Request.DescribeGatheringsRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    pageToken=nil,
    limit=nil,
})

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

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

api_result_handler = client.describe_gatherings_async({
    namespaceName="namespace1",
    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['message'])
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 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.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
accessTokenstring~ 128 charsUser Id
playerPlayerOwn player information
attributeRangesList<AttributeRange>[]~ 5 itemsTerms and Conditions
capacityOfRolesList<CapacityOfRole>[]1 ~ 5 itemsList of application limit
allowUserIdsList<string>[]~ 100 itemsUser ID allowed to participate
expiresAtlongGathering expiration date (Unix time unit:milliseconds)
expiresAtTimeSpanTimeSpanTime to expiration

Result

TypeDescription
itemGatheringCreated 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("namespace1"),
        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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createGathering(
        (new CreateGatheringRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.CreateGatheringRequest;
using Gs2.Gs2Matchmaking.Result.CreateGatheringResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CreateGatheringResult> asyncResult = null;
yield return client.CreateGathering(
    new Gs2.Gs2Matchmaking.Request.CreateGatheringRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .with_access_token(self.access_token_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="namespace1",
    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['message'])
end

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

api_result_handler = client.create_gathering_async({
    namespaceName="namespace1",
    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['message'])
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.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
userIdstring~ 128 charsUser Id
playerPlayerOwn player information
attributeRangesList<AttributeRange>[]~ 5 itemsTerms and Conditions
capacityOfRolesList<CapacityOfRole>[]1 ~ 5 itemsList of application limit
allowUserIdsList<string>[]~ 100 itemsUser ID allowed to participate
expiresAtlongGathering expiration date (Unix time unit:milliseconds)
expiresAtTimeSpanTimeSpanTime to expiration
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemGatheringCreated 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("namespace1"),
        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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createGatheringByUserId(
        (new CreateGatheringByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.CreateGatheringByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.CreateGatheringByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.CreateGatheringByUserIdResult> asyncResult = null;
yield return client.CreateGatheringByUserId(
    new Gs2.Gs2Matchmaking.Request.CreateGatheringByUserIdRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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['message'])
end

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

api_result_handler = client.create_gathering_by_user_id_async({
    namespaceName="namespace1",
    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['message'])
end

result = api_result.result
item = result.item;

updateGathering

Update Gathering

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
gatheringNamestringUUID~ 128 charsGathering Name
accessTokenstring~ 128 charsUser Id
attributeRangesList<AttributeRange>[]~ 5 itemsTerms and Conditions

Result

TypeDescription
itemGatheringUpdated 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.UpdateGathering(
    &matchmaking.UpdateGatheringRequest {
        NamespaceName: pointy.String("namespace1"),
        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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateGathering(
        (new UpdateGatheringRequest())
            ->withNamespaceName(self::namespace1)
            ->withGatheringName(self::gathering-0001)
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace1")
            .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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.UpdateGatheringRequest;
using Gs2.Gs2Matchmaking.Result.UpdateGatheringResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MatchmakingRestClient(session);

AsyncResult<Gs2.Gs2Matchmaking.Result.UpdateGatheringResult> asyncResult = null;
yield return client.UpdateGathering(
    new Gs2.Gs2Matchmaking.Request.UpdateGatheringRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .with_gathering_name(self.gathering1.name)
            .with_access_token(self.access_token_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="namespace1",
    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['message'])
end

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

api_result_handler = client.update_gathering_async({
    namespaceName="namespace1",
    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['message'])
end

result = api_result.result
item = result.item;

updateGatheringByUserId

Update Gathering with User ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
gatheringNamestringUUID~ 128 charsGathering Name
userIdstring~ 128 charsUser Id
attributeRangesList<AttributeRange>[]~ 5 itemsTerms and Conditions
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemGatheringUpdated 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{