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~ 32 charsNamespace name
descriptionstring~ 1024 charsdescription of Namespace
enableRatingboolfalseUse the rating calculation function
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
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
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

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
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
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 of Namespace
initialValueint1500100 ~ 10000Initial value of rate value
volatilityint1001 ~ 20000Magnitude of rate value fluctuation
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
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

CurrentRatingModelMaster

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.

Please refer to the documentation for the format of the JSON file.

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsNamespace GRN
settingsstring~ 5242880 charsMaster data

ScriptSetting

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

NotificationSetting

TypeConditionRequireDefaultLimitationDescription
gatewayNamespaceIdstring~ 1024 charsNamespace GRN
enableTransferMobileNotificationbool?Forwarding to mobile push notification
soundstring~ 1024 charsSound file name to be used for mobile push notifications

LogSetting

TypeConditionRequireDefaultLimitationDescription
loggingNamespaceIdstring~ 1024 charsNamespace GRN

GitHubCheckoutSetting

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

AttributeRange

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

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

TypeConditionRequireDefaultLimitationDescription
namestring~ 128 charsAttribute Name
valueint0~ 2147483646Attribute value

Player

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

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
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

GameResult

TypeConditionRequireDefaultLimitationDescription
rankint~ 2147483646Rank
userIdstring~ 128 charsUser Id

Ballot

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

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

WrittenBallot

TypeConditionRequireDefaultLimitationDescription
ballotBallotBallot
gameResultsList<GameResult>~ 10 itemsList of Results

Vote

TypeConditionRequireDefaultLimitationDescription
voteIdstring~ 1024 charsVote GRN
ratingNamestring~ 128 charsRating Name
gatheringNamestring~ 128 charsGathering Name
writtenBallotsList<WrittenBallot>[]~ 10 itemsList of Ballots
createdAtlongDatetime of creation
updatedAtlongDatetime of last update

TimeSpan

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;

createNamespace

Create a new namespace

Request

TypeConditionRequireDefaultLimitationDescription
namestring~ 32 charsNamespace name
descriptionstring~ 1024 charsdescription of Namespace
enableRatingboolfalseUse the rating calculation function
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
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

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),
        CreateGatheringTriggerType: pointy.String("none"),
        CreateGatheringTriggerRealtimeNamespaceId: nil,
        CreateGatheringTriggerScriptId: nil,
        CompleteMatchmakingTriggerType: pointy.String("none"),
        CompleteMatchmakingTriggerRealtimeNamespaceId: nil,
        CompleteMatchmakingTriggerScriptId: nil,
        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)
            ->withCreateGatheringTriggerType("none")
            ->withCreateGatheringTriggerRealtimeNamespaceId(null)
            ->withCreateGatheringTriggerScriptId(null)
            ->withCompleteMatchmakingTriggerType("none")
            ->withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
            ->withCompleteMatchmakingTriggerScriptId(null)
            ->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)
            .withCreateGatheringTriggerType("none")
            .withCreateGatheringTriggerRealtimeNamespaceId(null)
            .withCreateGatheringTriggerScriptId(null)
            .withCompleteMatchmakingTriggerType("none")
            .withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
            .withCompleteMatchmakingTriggerScriptId(null)
            .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)
        .WithCreateGatheringTriggerType("none")
        .WithCreateGatheringTriggerRealtimeNamespaceId(null)
        .WithCreateGatheringTriggerScriptId(null)
        .WithCompleteMatchmakingTriggerType("none")
        .WithCompleteMatchmakingTriggerRealtimeNamespaceId(null)
        .WithCompleteMatchmakingTriggerScriptId(null)
        .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)
            .withCreateGatheringTriggerType("none")
            .withCreateGatheringTriggerRealtimeNamespaceId(null)
            .withCreateGatheringTriggerScriptId(null)
            .withCompleteMatchmakingTriggerType("none")
            .withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
            .withCompleteMatchmakingTriggerScriptId(null)
            .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_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_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,
    createGatheringTriggerType='none',
    createGatheringTriggerRealtimeNamespaceId=nil,
    createGatheringTriggerScriptId=nil,
    completeMatchmakingTriggerType='none',
    completeMatchmakingTriggerRealtimeNamespaceId=nil,
    completeMatchmakingTriggerScriptId=nil,
    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;

getNamespaceStatus

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 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;

getNamespace

Get namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 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;

updateNamespace

Update namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
descriptionstring~ 1024 charsdescription of Namespace
enableRatingboolfalseUse the rating calculation function
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
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

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),
        CreateGatheringTriggerType: pointy.String("none"),
        CreateGatheringTriggerRealtimeNamespaceId: nil,
        CreateGatheringTriggerScriptId: nil,
        CompleteMatchmakingTriggerType: pointy.String("none"),
        CompleteMatchmakingTriggerRealtimeNamespaceId: nil,
        CompleteMatchmakingTriggerScriptId: nil,
        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)
            ->withCreateGatheringTriggerType("none")
            ->withCreateGatheringTriggerRealtimeNamespaceId(null)
            ->withCreateGatheringTriggerScriptId(null)
            ->withCompleteMatchmakingTriggerType("none")
            ->withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
            ->withCompleteMatchmakingTriggerScriptId(null)
            ->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)
            .withCreateGatheringTriggerType("none")
            .withCreateGatheringTriggerRealtimeNamespaceId(null)
            .withCreateGatheringTriggerScriptId(null)
            .withCompleteMatchmakingTriggerType("none")
            .withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
            .withCompleteMatchmakingTriggerScriptId(null)
            .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)
        .WithCreateGatheringTriggerType("none")
        .WithCreateGatheringTriggerRealtimeNamespaceId(null)
        .WithCreateGatheringTriggerScriptId(null)
        .WithCompleteMatchmakingTriggerType("none")
        .WithCompleteMatchmakingTriggerRealtimeNamespaceId(null)
        .WithCompleteMatchmakingTriggerScriptId(null)
        .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)
            .withCreateGatheringTriggerType("none")
            .withCreateGatheringTriggerRealtimeNamespaceId(null)
            .withCreateGatheringTriggerScriptId(null)
            .withCompleteMatchmakingTriggerType("none")
            .withCompleteMatchmakingTriggerRealtimeNamespaceId(null)
            .withCompleteMatchmakingTriggerScriptId(null)
            .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_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_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,
    createGatheringTriggerType='none',
    createGatheringTriggerRealtimeNamespaceId=nil,
    createGatheringTriggerScriptId=nil,
    completeMatchmakingTriggerType='none',
    completeMatchmakingTriggerRealtimeNamespaceId=nil,
    completeMatchmakingTriggerScriptId=nil,
    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;

deleteNamespace

Delete namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 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;

dumpUserDataByUserId

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

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id

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"),
    }
)
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")
    );
} 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")
    );
} 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"),
    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")
    );
} 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')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.dump_user_data_by_user_id({
    userId='user-0001',
})

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

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"),
    }
)
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")
    );
    $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")
    );
    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"),
    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")
    );
    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')
    )
    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',
})

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

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"),
    }
)
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")
    );
} 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")
    );
} 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"),
    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")
    );
} 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')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.clean_user_data_by_user_id({
    userId='user-0001',
})

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

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"),
    }
)
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")
    );
} 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")
    );
} 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"),
    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")
    );
} 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')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.check_clean_user_data_by_user_id({
    userId='user-0001',
})

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

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"),
    }
)
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")
    );
    $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")
    );
    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"),
    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")
    );
    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')
    )
    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',
})

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

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"),
    }
)
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")
    );
} 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")
    );
} 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"),
    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")
    );
} 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')
    )
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',
})

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

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"),
    }
)
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")
    );
    $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")
    );
    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"),
    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")
    );
    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')
    )
    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',
})

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~ 32 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;

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~ 32 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
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("$access_token_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("$access_token_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("$access_token_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("$access_token_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='$access_token_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;

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~ 32 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
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.CreateGatheringByUserId(
    &matchmaking.CreateGatheringByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        Player: nil,
        AttributeRanges: []matchmaking.AttributeRange{
            {'name': 'stage'},
        {'name': 'level'},
        },
        CapacityOfRoles: []matchmaking.CapacityOfRole{
            {'default': 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\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(null)
            ->withAttributeRanges([    {'name': 'stage'},
            {'name': 'level'},
            ])
            ->withCapacityOfRoles([    {'default': 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.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(null)
            .withAttributeRanges(Arrays.asList(
                {'name': 'stage'},
            {'name': 'level'}
            ))
            .withCapacityOfRoles(Arrays.asList(
                {'default': 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.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(null)
        .WithAttributeRanges(new Gs2.Gs2Matchmaking.Model.AttributeRange[] {
            {'name': 'stage'},
        {'name': 'level'}
        })
        .WithCapacityOfRoles(new Gs2.Gs2Matchmaking.Model.CapacityOfRole[] {
            {'default': 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.createGatheringByUserId(
        new Gs2Matchmaking.CreateGatheringByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withPlayer(null)
            .withAttributeRanges([
                {'name': 'stage'},
            {'name': 'level'}
            ])
            .withCapacityOfRoles([
                {'default': 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_by_user_id(
        matchmaking.CreateGatheringByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_player(None)
            .with_attribute_ranges([    {'name': 'stage'},
            {'name': 'level'},
            ])
            .with_capacity_of_roles([    {'default': 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_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    player=nil,
    attributeRanges={
        {'name': 'stage'},
    {'name': 'level'}
    },
    capacityOfRoles={
        {'default': 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;

updateGathering

Update Gathering

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 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("$gathering1.name"),
        AccessToken: pointy.String("$access_token_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::$gathering1.name)
            ->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("$gathering1.name")
            .withAccessToken("$access_token_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("$gathering1.name")
        .WithAccessToken("$access_token_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("$gathering1.name")
            .withAccessToken("$access_token_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='$gathering1.name',
    accessToken='$access_token_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;

updateGatheringByUserId

Update Gathering with User ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
gatheringNamestringUUID~ 128 charsGathering Name
userIdstring~ 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.UpdateGatheringByUserId(
    &matchmaking.UpdateGatheringByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        GatheringName: pointy.String("gathering-0001"),
        UserId: pointy.String("user-0001"),
        AttributeRanges: []matchmaking.AttributeRange{
            {'name': 'stage'},
        {'name': 'level'},
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateGatheringByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateGatheringByUserId(
        (new UpdateGatheringByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withGatheringName("gathering-0001")
            ->withUserId("user-0001")
            ->withAttributeRanges([    {'name': 'stage'},
            {'name': 'level'},
            ])
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateGatheringByUserIdRequest;
import io.gs2.matchmaking.result.UpdateGatheringByUserIdResult;

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

try {
    UpdateGatheringByUserIdResult result = client.updateGatheringByUserId(
        new UpdateGatheringByUserIdRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withAttributeRanges(Arrays.asList(
                {'name': 'stage'},
            {'name': 'level'}
            ))
    );
    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.UpdateGatheringByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.UpdateGatheringByUserIdResult;

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.UpdateGatheringByUserIdResult> asyncResult = null;
yield return client.UpdateGatheringByUserId(
    new Gs2.Gs2Matchmaking.Request.UpdateGatheringByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithGatheringName("gathering-0001")
        .WithUserId("user-0001")
        .WithAttributeRanges(new Gs2.Gs2Matchmaking.Model.AttributeRange[] {
            {'name': 'stage'},
        {'name': 'level'}
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.updateGatheringByUserId(
        new Gs2Matchmaking.UpdateGatheringByUserIdRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withAttributeRanges([
                {'name': 'stage'},
            {'name': 'level'}
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.update_gathering_by_user_id(
        matchmaking.UpdateGatheringByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_gathering_name('gathering-0001')
            .with_user_id('user-0001')
            .with_attribute_ranges([    {'name': 'stage'},
            {'name': 'level'},
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.update_gathering_by_user_id({
    namespaceName='namespace1',
    gatheringName='gathering-0001',
    userId='user-0001',
    attributeRanges={
        {'name': 'stage'},
    {'name': 'level'}
    },
})

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

result = api_result.result
item = result.item;

doMatchmakingByPlayer

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

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

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
playerPlayerPlayer Information
matchmakingContextTokenstring~ 5120 charsUsed to resume search Token that holds matchmaking state

Result

TypeDescription
itemGatheringParticipated Gathering
matchmakingContextTokenstringToken that preserves matchmaking status

Implementation Example

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->doMatchmakingByPlayer(
        (new DoMatchmakingByPlayerRequest())
            ->withNamespaceName(self::namespace1)
            ->withPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
            ->withMatchmakingContextToken(null)
    );
    $item = $result->getItem();
    $matchmakingContextToken = $result->getMatchmakingContextToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DoMatchmakingByPlayerRequest;
import io.gs2.matchmaking.result.DoMatchmakingByPlayerResult;

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

try {
    DoMatchmakingByPlayerResult result = client.doMatchmakingByPlayer(
        new DoMatchmakingByPlayerRequest()
            .withNamespaceName("namespace1")
            .withPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
            .withMatchmakingContextToken(null)
    );
    Gathering item = result.getItem();
    String matchmakingContextToken = result.getMatchmakingContextToken();
} 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.DoMatchmakingByPlayerRequest;
using Gs2.Gs2Matchmaking.Result.DoMatchmakingByPlayerResult;

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.DoMatchmakingByPlayerResult> asyncResult = null;
yield return client.DoMatchmakingByPlayer(
    new Gs2.Gs2Matchmaking.Request.DoMatchmakingByPlayerRequest()
        .WithNamespaceName("namespace1")
        .WithPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
        .WithMatchmakingContextToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var matchmakingContextToken = result.MatchmakingContextToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.doMatchmakingByPlayer(
        new Gs2Matchmaking.DoMatchmakingByPlayerRequest()
            .withNamespaceName("namespace1")
            .withPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
            .withMatchmakingContextToken(null)
    );
    const item = result.getItem();
    const matchmakingContextToken = result.getMatchmakingContextToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.do_matchmaking_by_player(
        matchmaking.DoMatchmakingByPlayerRequest()
            .with_namespace_name(self.hash1)
            .with_player({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
            .with_matchmaking_context_token(None)
    )
    item = result.item
    matchmaking_context_token = result.matchmaking_context_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.do_matchmaking_by_player({
    namespaceName='namespace1',
    player={'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]},
    matchmakingContextToken=nil,
})

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

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

doMatchmaking

Find a Gathering you can join and participate.

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

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
playerPlayerOwn player information
matchmakingContextTokenstring~ 5120 charsUsed to resume search Token that holds matchmaking state

Result

TypeDescription
itemGatheringParticipated Gatherings
matchmakingContextTokenstringToken that preserves matchmaking status

Implementation Example

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DoMatchmaking(
    &matchmaking.DoMatchmakingRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        Player: {'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]},
        MatchmakingContextToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DoMatchmakingRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->doMatchmaking(
        (new DoMatchmakingRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
            ->withMatchmakingContextToken(null)
    );
    $item = $result->getItem();
    $matchmakingContextToken = $result->getMatchmakingContextToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DoMatchmakingRequest;
import io.gs2.matchmaking.result.DoMatchmakingResult;

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

try {
    DoMatchmakingResult result = client.doMatchmaking(
        new DoMatchmakingRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
            .withMatchmakingContextToken(null)
    );
    Gathering item = result.getItem();
    String matchmakingContextToken = result.getMatchmakingContextToken();
} 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.DoMatchmakingRequest;
using Gs2.Gs2Matchmaking.Result.DoMatchmakingResult;

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.DoMatchmakingResult> asyncResult = null;
yield return client.DoMatchmaking(
    new Gs2.Gs2Matchmaking.Request.DoMatchmakingRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
        .WithMatchmakingContextToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var matchmakingContextToken = result.MatchmakingContextToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.doMatchmaking(
        new Gs2Matchmaking.DoMatchmakingRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withPlayer({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
            .withMatchmakingContextToken(null)
    );
    const item = result.getItem();
    const matchmakingContextToken = result.getMatchmakingContextToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.do_matchmaking(
        matchmaking.DoMatchmakingRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_player({'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]})
            .with_matchmaking_context_token(None)
    )
    item = result.item
    matchmaking_context_token = result.matchmaking_context_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.do_matchmaking({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    player={'userId': 'user-0001', 'attributes': [{'name': 'attr1', 'value': 1}, {'name': 'attr2', 'value': 1}]},
    matchmakingContextToken=nil,
})

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

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

doMatchmakingByUserId

Find a Gathering you can join and participate.

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

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
playerPlayerOwn player information
matchmakingContextTokenstring~ 5120 charsUsed to resume search Token that holds matchmaking state

Result

TypeDescription
itemGatheringParticipated Gatherings
matchmakingContextTokenstringToken that preserves matchmaking status

Implementation Example

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DoMatchmakingByUserIdResult result = client.doMatchmakingByUserId(
        new DoMatchmakingByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withPlayer(null)
            .withMatchmakingContextToken(null)
    );
    Gathering item = result.getItem();
    String matchmakingContextToken = result.getMatchmakingContextToken();
} 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.DoMatchmakingByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.DoMatchmakingByUserIdResult;

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

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

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

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

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

api_result = client.do_matchmaking_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    player=nil,
    matchmakingContextToken=nil,
})

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

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

getGathering

Get Gathering

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
gatheringNamestringUUID~ 128 charsGathering Name

Result

TypeDescription
itemGatheringGathering

Implementation Example

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    GetGatheringResult result = client.getGathering(
        new GetGatheringRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("$gathering1.name")
    );
    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.GetGatheringRequest;
using Gs2.Gs2Matchmaking.Result.GetGatheringResult;

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.GetGatheringResult> asyncResult = null;
yield return client.GetGathering(
    new Gs2.Gs2Matchmaking.Request.GetGatheringRequest()
        .WithNamespaceName("namespace1")
        .WithGatheringName("$gathering1.name"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.getGathering(
        new Gs2Matchmaking.GetGatheringRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("$gathering1.name")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.get_gathering(
        matchmaking.GetGatheringRequest()
            .with_namespace_name(self.hash1)
            .with_gathering_name(self.gathering1.name)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_gathering({
    namespaceName='namespace1',
    gatheringName='$gathering1.name',
})

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

result = api_result.result
item = result.item;

cancelMatchmaking

Cancel Matchmaking

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

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
gatheringNamestringUUID~ 128 charsGathering Name
accessTokenstring~ 128 charsUser Id

Result

TypeDescription
itemGatheringCanceled Gathering

Implementation Example

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    CancelMatchmakingResult result = client.cancelMatchmaking(
        new CancelMatchmakingRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("$gathering1.name")
            .withAccessToken("$access_token_0001")
    );
    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.CancelMatchmakingRequest;
using Gs2.Gs2Matchmaking.Result.CancelMatchmakingResult;

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.CancelMatchmakingResult> asyncResult = null;
yield return client.CancelMatchmaking(
    new Gs2.Gs2Matchmaking.Request.CancelMatchmakingRequest()
        .WithNamespaceName("namespace1")
        .WithGatheringName("$gathering1.name")
        .WithAccessToken("$access_token_0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.cancelMatchmaking(
        new Gs2Matchmaking.CancelMatchmakingRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("$gathering1.name")
            .withAccessToken("$access_token_0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.cancel_matchmaking(
        matchmaking.CancelMatchmakingRequest()
            .with_namespace_name(self.hash1)
            .with_gathering_name(self.gathering1.name)
            .with_access_token(self.access_token_0001)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.cancel_matchmaking({
    namespaceName='namespace1',
    gatheringName='$gathering1.name',
    accessToken='$access_token_0001',
})

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

result = api_result.result
item = result.item;

cancelMatchmakingByUserId

Cancel matchmaking by specifying user ID

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

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
gatheringNamestringUUID~ 128 charsGathering Name
userIdstring~ 128 charsUser Id

Result

TypeDescription
itemGatheringCanceled Gathering

Implementation Example

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CancelMatchmakingByUserId(
    &matchmaking.CancelMatchmakingByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        GatheringName: pointy.String("gathering-0001"),
        UserId: pointy.String("user-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\CancelMatchmakingByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->cancelMatchmakingByUserId(
        (new CancelMatchmakingByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withGatheringName("gathering-0001")
            ->withUserId("user-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.CancelMatchmakingByUserIdRequest;
import io.gs2.matchmaking.result.CancelMatchmakingByUserIdResult;

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

try {
    CancelMatchmakingByUserIdResult result = client.cancelMatchmakingByUserId(
        new CancelMatchmakingByUserIdRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
    );
    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.CancelMatchmakingByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.CancelMatchmakingByUserIdResult;

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.CancelMatchmakingByUserIdResult> asyncResult = null;
yield return client.CancelMatchmakingByUserId(
    new Gs2.Gs2Matchmaking.Request.CancelMatchmakingByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithGatheringName("gathering-0001")
        .WithUserId("user-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.cancelMatchmakingByUserId(
        new Gs2Matchmaking.CancelMatchmakingByUserIdRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

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

api_result = client.cancel_matchmaking_by_user_id({
    namespaceName='namespace1',
    gatheringName='gathering-0001',
    userId='user-0001',
})

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

result = api_result.result
item = result.item;

deleteGathering

Delete Gathering

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
gatheringNamestringUUID~ 128 charsGathering Name

Result

TypeDescription
itemGatheringDeleted 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.DeleteGathering(
    &matchmaking.DeleteGatheringRequest {
        NamespaceName: pointy.String("namespace1"),
        GatheringName: pointy.String("gathering-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DeleteGatheringRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DeleteGatheringResult result = client.deleteGathering(
        new DeleteGatheringRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("gathering-0001")
    );
    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.DeleteGatheringRequest;
using Gs2.Gs2Matchmaking.Result.DeleteGatheringResult;

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

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

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

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

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

api_result = client.delete_gathering({
    namespaceName='namespace1',
    gatheringName='gathering-0001',
})

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

result = api_result.result
item = result.item;

describeRatingModelMasters

Get list of rating model masters

Request

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

Result

TypeDescription
itemsList<RatingModelMaster>List of Rating Model Master
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.DescribeRatingModelMasters(
    &matchmaking.DescribeRatingModelMastersRequest {
        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\DescribeRatingModelMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeRatingModelMasters(
        (new DescribeRatingModelMastersRequest())
            ->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.DescribeRatingModelMastersRequest;
import io.gs2.matchmaking.result.DescribeRatingModelMastersResult;

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

try {
    DescribeRatingModelMastersResult result = client.describeRatingModelMasters(
        new DescribeRatingModelMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<RatingModelMaster> 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.DescribeRatingModelMastersRequest;
using Gs2.Gs2Matchmaking.Result.DescribeRatingModelMastersResult;

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.DescribeRatingModelMastersResult> asyncResult = null;
yield return client.DescribeRatingModelMasters(
    new Gs2.Gs2Matchmaking.Request.DescribeRatingModelMastersRequest()
        .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.describeRatingModelMasters(
        new Gs2Matchmaking.DescribeRatingModelMastersRequest()
            .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_rating_model_masters(
        matchmaking.DescribeRatingModelMastersRequest()
            .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_rating_model_masters({
    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;

createRatingModelMaster

Create a new rating model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
namestring~ 128 charsRating Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata
initialValueint1500100 ~ 10000Initial value of rate value
volatilityint1001 ~ 20000Magnitude of rate value fluctuation

Result

TypeDescription
itemRatingModelMasterCreated rating model master

Implementation Example

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CreateRatingModelMaster(
    &matchmaking.CreateRatingModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("mode1"),
        Description: nil,
        Metadata: nil,
        InitialValue: nil,
        Volatility: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CreateRatingModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createRatingModelMaster(
        (new CreateRatingModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("mode1")
            ->withDescription(null)
            ->withMetadata(null)
            ->withInitialValue(null)
            ->withVolatility(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CreateRatingModelMasterRequest;
import io.gs2.matchmaking.result.CreateRatingModelMasterResult;

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

try {
    CreateRatingModelMasterResult result = client.createRatingModelMaster(
        new CreateRatingModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("mode1")
            .withDescription(null)
            .withMetadata(null)
            .withInitialValue(null)
            .withVolatility(null)
    );
    RatingModelMaster 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.CreateRatingModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.CreateRatingModelMasterResult;

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.CreateRatingModelMasterResult> asyncResult = null;
yield return client.CreateRatingModelMaster(
    new Gs2.Gs2Matchmaking.Request.CreateRatingModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithName("mode1")
        .WithDescription(null)
        .WithMetadata(null)
        .WithInitialValue(null)
        .WithVolatility(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.createRatingModelMaster(
        new Gs2Matchmaking.CreateRatingModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("mode1")
            .withDescription(null)
            .withMetadata(null)
            .withInitialValue(null)
            .withVolatility(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.create_rating_model_master(
        matchmaking.CreateRatingModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('mode1')
            .with_description(None)
            .with_metadata(None)
            .with_initial_value(None)
            .with_volatility(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.create_rating_model_master({
    namespaceName='namespace1',
    name='mode1',
    description=nil,
    metadata=nil,
    initialValue=nil,
    volatility=nil,
})

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

result = api_result.result
item = result.item;

getRatingModelMaster

Obtain rating model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
ratingNamestring~ 128 charsRating Model Name

Result

TypeDescription
itemRatingModelMasterRating Model Master

Implementation Example

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getRatingModelMaster(
        (new GetRatingModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withRatingName("mode1")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetRatingModelMasterRequest;
import io.gs2.matchmaking.result.GetRatingModelMasterResult;

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

try {
    GetRatingModelMasterResult result = client.getRatingModelMaster(
        new GetRatingModelMasterRequest()
            .withNamespaceName("namespace1")
            .withRatingName("mode1")
    );
    RatingModelMaster 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.GetRatingModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.GetRatingModelMasterResult;

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.GetRatingModelMasterResult> asyncResult = null;
yield return client.GetRatingModelMaster(
    new Gs2.Gs2Matchmaking.Request.GetRatingModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithRatingName("mode1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.getRatingModelMaster(
        new Gs2Matchmaking.GetRatingModelMasterRequest()
            .withNamespaceName("namespace1")
            .withRatingName("mode1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.get_rating_model_master(
        matchmaking.GetRatingModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_rating_name('mode1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_rating_model_master({
    namespaceName='namespace1',
    ratingName='mode1',
})

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

result = api_result.result
item = result.item;

updateRatingModelMaster

Update rating model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
ratingNamestring~ 128 charsRating Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 128 charsmetadata
initialValueint1500100 ~ 10000Initial value of rate value
volatilityint1001 ~ 20000Magnitude of rate value fluctuation

Result

TypeDescription
itemRatingModelMasterUpdated rating model master

Implementation Example

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.UpdateRatingModelMaster(
    &matchmaking.UpdateRatingModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        RatingName: pointy.String("mode1"),
        Description: pointy.String("description1"),
        Metadata: nil,
        InitialValue: nil,
        Volatility: pointy.Int32(50),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateRatingModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateRatingModelMaster(
        (new UpdateRatingModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withRatingName("mode1")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withInitialValue(null)
            ->withVolatility(50)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateRatingModelMasterRequest;
import io.gs2.matchmaking.result.UpdateRatingModelMasterResult;

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

try {
    UpdateRatingModelMasterResult result = client.updateRatingModelMaster(
        new UpdateRatingModelMasterRequest()
            .withNamespaceName("namespace1")
            .withRatingName("mode1")
            .withDescription("description1")
            .withMetadata(null)
            .withInitialValue(null)
            .withVolatility(50)
    );
    RatingModelMaster 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.UpdateRatingModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.UpdateRatingModelMasterResult;

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.UpdateRatingModelMasterResult> asyncResult = null;
yield return client.UpdateRatingModelMaster(
    new Gs2.Gs2Matchmaking.Request.UpdateRatingModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithRatingName("mode1")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithInitialValue(null)
        .WithVolatility(50),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.updateRatingModelMaster(
        new Gs2Matchmaking.UpdateRatingModelMasterRequest()
            .withNamespaceName("namespace1")
            .withRatingName("mode1")
            .withDescription("description1")
            .withMetadata(null)
            .withInitialValue(null)
            .withVolatility(50)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.update_rating_model_master(
        matchmaking.UpdateRatingModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_rating_name('mode1')
            .with_description('description1')
            .with_metadata(None)
            .with_initial_value(None)
            .with_volatility(50)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.update_rating_model_master({
    namespaceName='namespace1',
    ratingName='mode1',
    description='description1',
    metadata=nil,
    initialValue=nil,
    volatility=50,
})

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

result = api_result.result
item = result.item;

deleteRatingModelMaster

Delete Rating Model Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
ratingNamestring~ 128 charsRating Model Name

Result

TypeDescription
itemRatingModelMasterDeleted Rating Model Master

Implementation Example

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteRatingModelMaster(
        (new DeleteRatingModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withRatingName("mode1")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DeleteRatingModelMasterRequest;
import io.gs2.matchmaking.result.DeleteRatingModelMasterResult;

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

try {
    DeleteRatingModelMasterResult result = client.deleteRatingModelMaster(
        new DeleteRatingModelMasterRequest()
            .withNamespaceName("namespace1")
            .withRatingName("mode1")
    );
    RatingModelMaster 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.DeleteRatingModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.DeleteRatingModelMasterResult;

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.DeleteRatingModelMasterResult> asyncResult = null;
yield return client.DeleteRatingModelMaster(
    new Gs2.Gs2Matchmaking.Request.DeleteRatingModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithRatingName("mode1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.deleteRatingModelMaster(
        new Gs2Matchmaking.DeleteRatingModelMasterRequest()
            .withNamespaceName("namespace1")
            .withRatingName("mode1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.delete_rating_model_master(
        matchmaking.DeleteRatingModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_rating_name('mode1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.delete_rating_model_master({
    namespaceName='namespace1',
    ratingName='mode1',
})

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

result = api_result.result
item = result.item;

describeRatingModels

Get list of rating models

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemsList<RatingModel>List of Rating Model

Implementation Example

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DescribeRatingModels(
    &matchmaking.DescribeRatingModelsRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeRatingModelsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeRatingModels(
        (new DescribeRatingModelsRequest())
            ->withNamespaceName(self::namespace1)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeRatingModelsRequest;
import io.gs2.matchmaking.result.DescribeRatingModelsResult;

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

try {
    DescribeRatingModelsResult result = client.describeRatingModels(
        new DescribeRatingModelsRequest()
            .withNamespaceName("namespace1")
    );
    List<RatingModel> items = result.getItems();
} 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.DescribeRatingModelsRequest;
using Gs2.Gs2Matchmaking.Result.DescribeRatingModelsResult;

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.DescribeRatingModelsResult> asyncResult = null;
yield return client.DescribeRatingModels(
    new Gs2.Gs2Matchmaking.Request.DescribeRatingModelsRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.describeRatingModels(
        new Gs2Matchmaking.DescribeRatingModelsRequest()
            .withNamespaceName("namespace1")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.describe_rating_models(
        matchmaking.DescribeRatingModelsRequest()
            .with_namespace_name(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_rating_models({
    namespaceName='namespace1',
})

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

result = api_result.result
items = result.items;

getRatingModel

Obtain rating model

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
ratingNamestring~ 128 charsRating Model Name

Result

TypeDescription
itemRatingModelRating Model

Implementation Example

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getRatingModel(
        (new GetRatingModelRequest())
            ->withNamespaceName(self::namespace1)
            ->withRatingName("mode1")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetRatingModelRequest;
import io.gs2.matchmaking.result.GetRatingModelResult;

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

try {
    GetRatingModelResult result = client.getRatingModel(
        new GetRatingModelRequest()
            .withNamespaceName("namespace1")
            .withRatingName("mode1")
    );
    RatingModel 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.GetRatingModelRequest;
using Gs2.Gs2Matchmaking.Result.GetRatingModelResult;

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.GetRatingModelResult> asyncResult = null;
yield return client.GetRatingModel(
    new Gs2.Gs2Matchmaking.Request.GetRatingModelRequest()
        .WithNamespaceName("namespace1")
        .WithRatingName("mode1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.getRatingModel(
        new Gs2Matchmaking.GetRatingModelRequest()
            .withNamespaceName("namespace1")
            .withRatingName("mode1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.get_rating_model(
        matchmaking.GetRatingModelRequest()
            .with_namespace_name(self.hash1)
            .with_rating_name('mode1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_rating_model({
    namespaceName='namespace1',
    ratingName='mode1',
})

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

result = api_result.result
item = result.item;

exportMaster

Export master data for currently available rating masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemCurrentRatingModelMasterCurrently available rating masters

Implementation Example

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &matchmaking.ExportMasterRequest {
        NamespaceName: pointy.String("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\ExportMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->exportMaster(
        (new ExportMasterRequest())
            ->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.ExportMasterRequest;
import io.gs2.matchmaking.result.ExportMasterResult;

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

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentRatingModelMaster 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.ExportMasterRequest;
using Gs2.Gs2Matchmaking.Result.ExportMasterResult;

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.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Matchmaking.Request.ExportMasterRequest()
        .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.exportMaster(
        new Gs2Matchmaking.ExportMasterRequest()
            .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.export_master(
        matchmaking.ExportMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.export_master({
    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;

getCurrentRatingModelMaster

Get currently available rating masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemCurrentRatingModelMasterCurrently available rating masters

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.GetCurrentRatingModelMaster(
    &matchmaking.GetCurrentRatingModelMasterRequest {
        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\GetCurrentRatingModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCurrentRatingModelMaster(
        (new GetCurrentRatingModelMasterRequest())
            ->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.GetCurrentRatingModelMasterRequest;
import io.gs2.matchmaking.result.GetCurrentRatingModelMasterResult;

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

try {
    GetCurrentRatingModelMasterResult result = client.getCurrentRatingModelMaster(
        new GetCurrentRatingModelMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentRatingModelMaster 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.GetCurrentRatingModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.GetCurrentRatingModelMasterResult;

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.GetCurrentRatingModelMasterResult> asyncResult = null;
yield return client.GetCurrentRatingModelMaster(
    new Gs2.Gs2Matchmaking.Request.GetCurrentRatingModelMasterRequest()
        .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.getCurrentRatingModelMaster(
        new Gs2Matchmaking.GetCurrentRatingModelMasterRequest()
            .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_current_rating_model_master(
        matchmaking.GetCurrentRatingModelMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_current_rating_model_master({
    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;

updateCurrentRatingModelMaster

Update and currently available rating master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
settingsstring~ 5242880 charsMaster data

Result

TypeDescription
itemCurrentRatingModelMasterUpdated and currently available rating master

Implementation Example

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentRatingModelMaster(
    &matchmaking.UpdateCurrentRatingModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Settings: pointy.String("{\n  \"version\": \"2020-06-24\",\n  \"ratingModels\": [\n    {\n      \"name\": \"mode1\",\n      \"metadata\": \"MODE1\",\n      \"volatility\": 100\n    },\n    {\n      \"name\": \"mode2\",\n      \"metadata\": \"MODE2\",\n      \"volatility\": 150\n    }\n  ]\n}"),
    }
)
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\UpdateCurrentRatingModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentRatingModelMaster(
        (new UpdateCurrentRatingModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSettings("{\n  \"version\": \"2020-06-24\",\n  \"ratingModels\": [\n    {\n      \"name\": \"mode1\",\n      \"metadata\": \"MODE1\",\n      \"volatility\": 100\n    },\n    {\n      \"name\": \"mode2\",\n      \"metadata\": \"MODE2\",\n      \"volatility\": 150\n    }\n  ]\n}")
    );
    $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.UpdateCurrentRatingModelMasterRequest;
import io.gs2.matchmaking.result.UpdateCurrentRatingModelMasterResult;

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

try {
    UpdateCurrentRatingModelMasterResult result = client.updateCurrentRatingModelMaster(
        new UpdateCurrentRatingModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n  \"version\": \"2020-06-24\",\n  \"ratingModels\": [\n    {\n      \"name\": \"mode1\",\n      \"metadata\": \"MODE1\",\n      \"volatility\": 100\n    },\n    {\n      \"name\": \"mode2\",\n      \"metadata\": \"MODE2\",\n      \"volatility\": 150\n    }\n  ]\n}")
    );
    CurrentRatingModelMaster 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.UpdateCurrentRatingModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.UpdateCurrentRatingModelMasterResult;

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.UpdateCurrentRatingModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentRatingModelMaster(
    new Gs2.Gs2Matchmaking.Request.UpdateCurrentRatingModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSettings("{\n  \"version\": \"2020-06-24\",\n  \"ratingModels\": [\n    {\n      \"name\": \"mode1\",\n      \"metadata\": \"MODE1\",\n      \"volatility\": 100\n    },\n    {\n      \"name\": \"mode2\",\n      \"metadata\": \"MODE2\",\n      \"volatility\": 150\n    }\n  ]\n}"),
    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.updateCurrentRatingModelMaster(
        new Gs2Matchmaking.UpdateCurrentRatingModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n  \"version\": \"2020-06-24\",\n  \"ratingModels\": [\n    {\n      \"name\": \"mode1\",\n      \"metadata\": \"MODE1\",\n      \"volatility\": 100\n    },\n    {\n      \"name\": \"mode2\",\n      \"metadata\": \"MODE2\",\n      \"volatility\": 150\n    }\n  ]\n}")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.update_current_rating_model_master(
        matchmaking.UpdateCurrentRatingModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_settings('{\n  "version": "2020-06-24",\n  "ratingModels": [\n    {\n      "name": "mode1",\n      "metadata": "MODE1",\n      "volatility": 100\n    },\n    {\n      "name": "mode2",\n      "metadata": "MODE2",\n      "volatility": 150\n    }\n  ]\n}')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.update_current_rating_model_master({
    namespaceName='namespace1',
    settings='{\n  "version": "2020-06-24",\n  "ratingModels": [\n    {\n      "name": "mode1",\n      "metadata": "MODE1",\n      "volatility": 100\n    },\n    {\n      "name": "mode2",\n      "metadata": "MODE2",\n      "volatility": 150\n    }\n  ]\n}',
})

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

result = api_result.result
item = result.item;

updateCurrentRatingModelMasterFromGitHub

Update and currently available rating master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
checkoutSettingGitHubCheckoutSettingSetup to check out master data from GitHub

Result

TypeDescription
itemCurrentRatingModelMasterUpdated and currently available rating master

Implementation Example

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentRatingModelMasterFromGitHub(
    &matchmaking.UpdateCurrentRatingModelMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace1"),
        CheckoutSetting: {'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'},
    }
)
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\UpdateCurrentRatingModelMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentRatingModelMasterFromGitHub(
        (new UpdateCurrentRatingModelMasterFromGitHubRequest())
            ->withNamespaceName(self::namespace1)
            ->withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    $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.UpdateCurrentRatingModelMasterFromGitHubRequest;
import io.gs2.matchmaking.result.UpdateCurrentRatingModelMasterFromGitHubResult;

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

try {
    UpdateCurrentRatingModelMasterFromGitHubResult result = client.updateCurrentRatingModelMasterFromGitHub(
        new UpdateCurrentRatingModelMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    CurrentRatingModelMaster 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.UpdateCurrentRatingModelMasterFromGitHubRequest;
using Gs2.Gs2Matchmaking.Result.UpdateCurrentRatingModelMasterFromGitHubResult;

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.UpdateCurrentRatingModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentRatingModelMasterFromGitHub(
    new Gs2.Gs2Matchmaking.Request.UpdateCurrentRatingModelMasterFromGitHubRequest()
        .WithNamespaceName("namespace1")
        .WithCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'}),
    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.updateCurrentRatingModelMasterFromGitHub(
        new Gs2Matchmaking.UpdateCurrentRatingModelMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.update_current_rating_model_master_from_git_hub(
        matchmaking.UpdateCurrentRatingModelMasterFromGitHubRequest()
            .with_namespace_name(self.hash1)
            .with_checkout_setting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.update_current_rating_model_master_from_git_hub({
    namespaceName='namespace1',
    checkoutSetting={'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'},
})

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

result = api_result.result
item = result.item;

describeRatings

Get list of ratings

Request

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

Result

TypeDescription
itemsList<Rating>List of Rating
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.DescribeRatings(
    &matchmaking.DescribeRatingsRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeRatingsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeRatings(
        (new DescribeRatingsRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeRatingsRequest;
import io.gs2.matchmaking.result.DescribeRatingsResult;

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

try {
    DescribeRatingsResult result = client.describeRatings(
        new DescribeRatingsRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Rating> 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.DescribeRatingsRequest;
using Gs2.Gs2Matchmaking.Result.DescribeRatingsResult;

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.DescribeRatingsResult> asyncResult = null;
yield return client.DescribeRatings(
    new Gs2.Gs2Matchmaking.Request.DescribeRatingsRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.describeRatings(
        new Gs2Matchmaking.DescribeRatingsRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.describe_ratings(
        matchmaking.DescribeRatingsRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_ratings({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    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;

describeRatingsByUserId

Obtain list of ratings by specifying a user ID

Request

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

Result

TypeDescription
itemsList<Rating>List of Rating
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.DescribeRatingsByUserId(
    &matchmaking.DescribeRatingsByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeRatingsByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeRatingsByUserId(
        (new DescribeRatingsByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DescribeRatingsByUserIdRequest;
import io.gs2.matchmaking.result.DescribeRatingsByUserIdResult;

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

try {
    DescribeRatingsByUserIdResult result = client.describeRatingsByUserId(
        new DescribeRatingsByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Rating> 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.DescribeRatingsByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.DescribeRatingsByUserIdResult;

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.DescribeRatingsByUserIdResult> asyncResult = null;
yield return client.DescribeRatingsByUserId(
    new Gs2.Gs2Matchmaking.Request.DescribeRatingsByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

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

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

try:
    result = client.describe_ratings_by_user_id(
        matchmaking.DescribeRatingsByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_ratings_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    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;

getRating

Get Rating

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
ratingNamestring~ 128 charsRating Name

Result

TypeDescription
itemRatingRating

Implementation Example

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getRating(
        (new GetRatingRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withRatingName("rating-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetRatingRequest;
import io.gs2.matchmaking.result.GetRatingResult;

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

try {
    GetRatingResult result = client.getRating(
        new GetRatingRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withRatingName("rating-0001")
    );
    Rating 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.GetRatingRequest;
using Gs2.Gs2Matchmaking.Result.GetRatingResult;

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.GetRatingResult> asyncResult = null;
yield return client.GetRating(
    new Gs2.Gs2Matchmaking.Request.GetRatingRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithRatingName("rating-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.getRating(
        new Gs2Matchmaking.GetRatingRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withRatingName("rating-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.get_rating(
        matchmaking.GetRatingRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_rating_name('rating-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_rating({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    ratingName='rating-0001',
})

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

result = api_result.result
item = result.item;

getRatingByUserId

Obtain rating by specifying user IDs

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
ratingNamestring~ 128 charsRating Name

Result

TypeDescription
itemRatingRating

Implementation Example

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getRatingByUserId(
        (new GetRatingByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withRatingName("rating-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetRatingByUserIdRequest;
import io.gs2.matchmaking.result.GetRatingByUserIdResult;

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

try {
    GetRatingByUserIdResult result = client.getRatingByUserId(
        new GetRatingByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withRatingName("rating-0001")
    );
    Rating 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.GetRatingByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.GetRatingByUserIdResult;

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.GetRatingByUserIdResult> asyncResult = null;
yield return client.GetRatingByUserId(
    new Gs2.Gs2Matchmaking.Request.GetRatingByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithRatingName("rating-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.getRatingByUserId(
        new Gs2Matchmaking.GetRatingByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withRatingName("rating-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.get_rating_by_user_id(
        matchmaking.GetRatingByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_rating_name('rating-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_rating_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    ratingName='rating-0001',
})

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

result = api_result.result
item = result.item;

putResult

Recalculate rating values

The rating calculation process uses a calculation algorithm based on the Glicko-2 rating system. The initial rating value is 1500, and the more a player wins against a distant opponent, the greater the increase in rating value, and the greater the decrease in rating value for the losing side.

The rating calculation requires list of participating user IDs. Therefore, it is not appropriate to call this API directly from the client. It should be called from the game server, which can determine whether the game has been won or lost. If a client-driven game, such as a P2P game, is being realized, please use the voting function to determine the winner.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
ratingNamestring~ 128 charsRating Name
gameResultsList<GameResult>~ 10 itemsList of Results

Result

TypeDescription
itemsList<Rating>List of Updated Rating

Implementation Example

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.PutResult(
    &matchmaking.PutResultRequest {
        NamespaceName: pointy.String("namespace1"),
        RatingName: pointy.String("rating-0001"),
        GameResults: []matchmaking.GameResult{
            {'rank': 1, 'userId': 'user-0001'},
        {'rank': 2, 'userId': 'user-0002'},
        {'rank': 2, 'userId': 'user-0003'},
        {'rank': 3, 'userId': 'user-0004'},
        },
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\PutResultRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->putResult(
        (new PutResultRequest())
            ->withNamespaceName(self::namespace1)
            ->withRatingName("rating-0001")
            ->withGameResults([    {'rank': 1, 'userId': 'user-0001'},
            {'rank': 2, 'userId': 'user-0002'},
            {'rank': 2, 'userId': 'user-0003'},
            {'rank': 3, 'userId': 'user-0004'},
            ])
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.PutResultRequest;
import io.gs2.matchmaking.result.PutResultResult;

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

try {
    PutResultResult result = client.putResult(
        new PutResultRequest()
            .withNamespaceName("namespace1")
            .withRatingName("rating-0001")
            .withGameResults(Arrays.asList(
                {'rank': 1, 'userId': 'user-0001'},
            {'rank': 2, 'userId': 'user-0002'},
            {'rank': 2, 'userId': 'user-0003'},
            {'rank': 3, 'userId': 'user-0004'}
            ))
    );
    List<Rating> items = result.getItems();
} 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.PutResultRequest;
using Gs2.Gs2Matchmaking.Result.PutResultResult;

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.PutResultResult> asyncResult = null;
yield return client.PutResult(
    new Gs2.Gs2Matchmaking.Request.PutResultRequest()
        .WithNamespaceName("namespace1")
        .WithRatingName("rating-0001")
        .WithGameResults(new Gs2.Gs2Matchmaking.Model.GameResult[] {
            {'rank': 1, 'userId': 'user-0001'},
        {'rank': 2, 'userId': 'user-0002'},
        {'rank': 2, 'userId': 'user-0003'},
        {'rank': 3, 'userId': 'user-0004'}
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.putResult(
        new Gs2Matchmaking.PutResultRequest()
            .withNamespaceName("namespace1")
            .withRatingName("rating-0001")
            .withGameResults([
                {'rank': 1, 'userId': 'user-0001'},
            {'rank': 2, 'userId': 'user-0002'},
            {'rank': 2, 'userId': 'user-0003'},
            {'rank': 3, 'userId': 'user-0004'}
            ])
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.put_result(
        matchmaking.PutResultRequest()
            .with_namespace_name(self.hash1)
            .with_rating_name('rating-0001')
            .with_game_results([    {'rank': 1, 'userId': 'user-0001'},
            {'rank': 2, 'userId': 'user-0002'},
            {'rank': 2, 'userId': 'user-0003'},
            {'rank': 3, 'userId': 'user-0004'},
            ])
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.put_result({
    namespaceName='namespace1',
    ratingName='rating-0001',
    gameResults={
        {'rank': 1, 'userId': 'user-0001'},
    {'rank': 2, 'userId': 'user-0002'},
    {'rank': 2, 'userId': 'user-0003'},
    {'rank': 3, 'userId': 'user-0004'}
    },
})

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

result = api_result.result
items = result.items;

deleteRating

Delete Rating

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
ratingNamestring~ 128 charsRating Name

Result

TypeDescription
itemRatingDeleted Rating

Implementation Example

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteRating(
        (new DeleteRatingRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withRatingName("rating-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DeleteRatingRequest;
import io.gs2.matchmaking.result.DeleteRatingResult;

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

try {
    DeleteRatingResult result = client.deleteRating(
        new DeleteRatingRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withRatingName("rating-0001")
    );
    Rating 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.DeleteRatingRequest;
using Gs2.Gs2Matchmaking.Result.DeleteRatingResult;

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.DeleteRatingResult> asyncResult = null;
yield return client.DeleteRating(
    new Gs2.Gs2Matchmaking.Request.DeleteRatingRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithRatingName("rating-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.deleteRating(
        new Gs2Matchmaking.DeleteRatingRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withRatingName("rating-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.delete_rating(
        matchmaking.DeleteRatingRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_rating_name('rating-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.delete_rating({
    namespaceName='namespace1',
    userId='user-0001',
    ratingName='rating-0001',
})

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

result = api_result.result
item = result.item;

getBallot

Prepared ballot along with signatures

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
ratingNamestring~ 128 charsRating Name
gatheringNamestring~ 128 charsGathering Name
accessTokenstring~ 128 charsUser Id
numberOfPlayerint2 ~ 10Number of participants
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemBallotBallot
bodystringData to be signed
signaturestringSignature

Implementation Example

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetBallot(
    &matchmaking.GetBallotRequest {
        NamespaceName: pointy.String("namespace1"),
        RatingName: pointy.String("rating-0001"),
        GatheringName: pointy.String("gathering-0001"),
        AccessToken: pointy.String("$access_token_0001"),
        NumberOfPlayer: pointy.Int32(4),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetBallotRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getBallot(
        (new GetBallotRequest())
            ->withNamespaceName(self::namespace1)
            ->withRatingName("rating-0001")
            ->withGatheringName("gathering-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withNumberOfPlayer(4)
            ->withKeyId(self::$key1.keyId)
    );
    $item = $result->getItem();
    $body = $result->getBody();
    $signature = $result->getSignature();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetBallotRequest;
import io.gs2.matchmaking.result.GetBallotResult;

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

try {
    GetBallotResult result = client.getBallot(
        new GetBallotRequest()
            .withNamespaceName("namespace1")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
            .withAccessToken("$access_token_0001")
            .withNumberOfPlayer(4)
            .withKeyId("$key1.keyId")
    );
    Ballot item = result.getItem();
    String body = result.getBody();
    String signature = result.getSignature();
} 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.GetBallotRequest;
using Gs2.Gs2Matchmaking.Result.GetBallotResult;

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.GetBallotResult> asyncResult = null;
yield return client.GetBallot(
    new Gs2.Gs2Matchmaking.Request.GetBallotRequest()
        .WithNamespaceName("namespace1")
        .WithRatingName("rating-0001")
        .WithGatheringName("gathering-0001")
        .WithAccessToken("$access_token_0001")
        .WithNumberOfPlayer(4)
        .WithKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.getBallot(
        new Gs2Matchmaking.GetBallotRequest()
            .withNamespaceName("namespace1")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
            .withAccessToken("$access_token_0001")
            .withNumberOfPlayer(4)
            .withKeyId("$key1.keyId")
    );
    const item = result.getItem();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.get_ballot(
        matchmaking.GetBallotRequest()
            .with_namespace_name(self.hash1)
            .with_rating_name('rating-0001')
            .with_gathering_name('gathering-0001')
            .with_access_token(self.access_token_0001)
            .with_number_of_player(4)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_ballot({
    namespaceName='namespace1',
    ratingName='rating-0001',
    gatheringName='gathering-0001',
    accessToken='$access_token_0001',
    numberOfPlayer=4,
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;

getBallotByUserId

Create ballot with signatures, specifying user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
ratingNamestring~ 128 charsRating Name
gatheringNamestring~ 128 charsGathering Name
userIdstring~ 128 charsUser Id
numberOfPlayerint2 ~ 10Number of participants
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemBallotBallot
bodystringData to be signed
signaturestringSignature

Implementation Example

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetBallotByUserId(
    &matchmaking.GetBallotByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        RatingName: pointy.String("rating-0001"),
        GatheringName: pointy.String("gathering-0001"),
        UserId: pointy.String("user-0001"),
        NumberOfPlayer: pointy.Int32(4),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetBallotByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getBallotByUserId(
        (new GetBallotByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withRatingName("rating-0001")
            ->withGatheringName("gathering-0001")
            ->withUserId("user-0001")
            ->withNumberOfPlayer(4)
            ->withKeyId(self::$key1.keyId)
    );
    $item = $result->getItem();
    $body = $result->getBody();
    $signature = $result->getSignature();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetBallotByUserIdRequest;
import io.gs2.matchmaking.result.GetBallotByUserIdResult;

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

try {
    GetBallotByUserIdResult result = client.getBallotByUserId(
        new GetBallotByUserIdRequest()
            .withNamespaceName("namespace1")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withNumberOfPlayer(4)
            .withKeyId("$key1.keyId")
    );
    Ballot item = result.getItem();
    String body = result.getBody();
    String signature = result.getSignature();
} 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.GetBallotByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.GetBallotByUserIdResult;

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.GetBallotByUserIdResult> asyncResult = null;
yield return client.GetBallotByUserId(
    new Gs2.Gs2Matchmaking.Request.GetBallotByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithRatingName("rating-0001")
        .WithGatheringName("gathering-0001")
        .WithUserId("user-0001")
        .WithNumberOfPlayer(4)
        .WithKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.getBallotByUserId(
        new Gs2Matchmaking.GetBallotByUserIdRequest()
            .withNamespaceName("namespace1")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withNumberOfPlayer(4)
            .withKeyId("$key1.keyId")
    );
    const item = result.getItem();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.get_ballot_by_user_id(
        matchmaking.GetBallotByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_rating_name('rating-0001')
            .with_gathering_name('gathering-0001')
            .with_user_id('user-0001')
            .with_number_of_player(4)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_ballot_by_user_id({
    namespaceName='namespace1',
    ratingName='rating-0001',
    gatheringName='gathering-0001',
    userId='user-0001',
    numberOfPlayer=4,
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;

vote

Vote on the results of the matchups.

Voting must take place within 5 minutes of the first vote being cast. This means that the results will not be reflected immediately, but approximately 5 minutes after the start of voting or when all players have cast their votes. If all ballots are not collected within 5 minutes, the result will be determined by a majority vote based on the votes cast at that time. If the number of votes for each result is the same, the result will be discarded (the behavior can be changed by script).

If you want to reflect the result immediately, the representative player of the winning side can collect ballots from each player and call voteMultiple to reflect the result immediately.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
ballotBodystring~ 1024 charsData for ballot signature targets
ballotSignaturestring~ 256 charsSignature
gameResultsList<GameResult>~ 10 itemsList of Results
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemBallotBallot

Implementation Example

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.Vote(
    &matchmaking.VoteRequest {
        NamespaceName: pointy.String("namespace1"),
        BallotBody: pointy.String("$ballotBody"),
        BallotSignature: pointy.String("$ballotSignature"),
        GameResults: []matchmaking.GameResult{
            {'rank': 1, 'userId': 'user-0001'},
        {'rank': 2, 'userId': 'user-0002'},
        {'rank': 2, 'userId': 'user-0003'},
        {'rank': 3, 'userId': 'user-0004'},
        },
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\VoteRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->vote(
        (new VoteRequest())
            ->withNamespaceName(self::namespace1)
            ->withBallotBody(self::$ballotBody)
            ->withBallotSignature(self::$ballotSignature)
            ->withGameResults([    {'rank': 1, 'userId': 'user-0001'},
            {'rank': 2, 'userId': 'user-0002'},
            {'rank': 2, 'userId': 'user-0003'},
            {'rank': 3, 'userId': 'user-0004'},
            ])
            ->withKeyId(self::$key1.keyId)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.VoteRequest;
import io.gs2.matchmaking.result.VoteResult;

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

try {
    VoteResult result = client.vote(
        new VoteRequest()
            .withNamespaceName("namespace1")
            .withBallotBody("$ballotBody")
            .withBallotSignature("$ballotSignature")
            .withGameResults(Arrays.asList(
                {'rank': 1, 'userId': 'user-0001'},
            {'rank': 2, 'userId': 'user-0002'},
            {'rank': 2, 'userId': 'user-0003'},
            {'rank': 3, 'userId': 'user-0004'}
            ))
            .withKeyId("$key1.keyId")
    );
    Ballot 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.VoteRequest;
using Gs2.Gs2Matchmaking.Result.VoteResult;

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.VoteResult> asyncResult = null;
yield return client.Vote(
    new Gs2.Gs2Matchmaking.Request.VoteRequest()
        .WithNamespaceName("namespace1")
        .WithBallotBody("$ballotBody")
        .WithBallotSignature("$ballotSignature")
        .WithGameResults(new Gs2.Gs2Matchmaking.Model.GameResult[] {
            {'rank': 1, 'userId': 'user-0001'},
        {'rank': 2, 'userId': 'user-0002'},
        {'rank': 2, 'userId': 'user-0003'},
        {'rank': 3, 'userId': 'user-0004'}
        })
        .WithKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.vote(
        new Gs2Matchmaking.VoteRequest()
            .withNamespaceName("namespace1")
            .withBallotBody("$ballotBody")
            .withBallotSignature("$ballotSignature")
            .withGameResults([
                {'rank': 1, 'userId': 'user-0001'},
            {'rank': 2, 'userId': 'user-0002'},
            {'rank': 2, 'userId': 'user-0003'},
            {'rank': 3, 'userId': 'user-0004'}
            ])
            .withKeyId("$key1.keyId")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.vote(
        matchmaking.VoteRequest()
            .with_namespace_name(self.hash1)
            .with_ballot_body(self.ballot_body)
            .with_ballot_signature(self.ballot_signature)
            .with_game_results([    {'rank': 1, 'userId': 'user-0001'},
            {'rank': 2, 'userId': 'user-0002'},
            {'rank': 2, 'userId': 'user-0003'},
            {'rank': 3, 'userId': 'user-0004'},
            ])
            .with_key_id(self.key1.key_id)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.vote({
    namespaceName='namespace1',
    ballotBody='$ballotBody',
    ballotSignature='$ballotSignature',
    gameResults={
        {'rank': 1, 'userId': 'user-0001'},
    {'rank': 2, 'userId': 'user-0002'},
    {'rank': 2, 'userId': 'user-0003'},
    {'rank': 3, 'userId': 'user-0004'}
    },
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;

voteMultiple

Vote on the results of the matchups together.

The side that wins the game collects the ballots of other players and uses them to vote collectively. We say ’the winning side’ because there is an incentive for the losing side to report that they won, but not vice versa. It is possible that the losing side will not hand in their ballots, but even in that case, if there is a majority of ballots, the results can still be passed.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
signedBallotsList<SignedBallot>~ 10 itemsList of Ballot with signatures
gameResultsList<GameResult>~ 10 itemsList of Results
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemBallotBallot

Implementation Example

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.VoteMultiple(
    &matchmaking.VoteMultipleRequest {
        NamespaceName: pointy.String("namespace1"),
        SignedBallots: []matchmaking.SignedBallot{
            {'body': 'aaa', 'signature': 'bbb'},
        {'body': 'aaa', 'signature': 'bbb'},
        {'body': 'aaa', 'signature': 'bbb'},
        {'body': 'aaa', 'signature': 'bbb'},
        },
        GameResults: []matchmaking.GameResult{
            {'rank': 1, 'userId': 'user-0001'},
        {'rank': 2, 'userId': 'user-0002'},
        {'rank': 2, 'userId': 'user-0003'},
        {'rank': 3, 'userId': 'user-0004'},
        },
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\VoteMultipleRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->voteMultiple(
        (new VoteMultipleRequest())
            ->withNamespaceName(self::namespace1)
            ->withSignedBallots([    {'body': 'aaa', 'signature': 'bbb'},
            {'body': 'aaa', 'signature': 'bbb'},
            {'body': 'aaa', 'signature': 'bbb'},
            {'body': 'aaa', 'signature': 'bbb'},
            ])
            ->withGameResults([    {'rank': 1, 'userId': 'user-0001'},
            {'rank': 2, 'userId': 'user-0002'},
            {'rank': 2, 'userId': 'user-0003'},
            {'rank': 3, 'userId': 'user-0004'},
            ])
            ->withKeyId(self::$key1.keyId)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.VoteMultipleRequest;
import io.gs2.matchmaking.result.VoteMultipleResult;

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

try {
    VoteMultipleResult result = client.voteMultiple(
        new VoteMultipleRequest()
            .withNamespaceName("namespace1")
            .withSignedBallots(Arrays.asList(
                {'body': 'aaa', 'signature': 'bbb'},
            {'body': 'aaa', 'signature': 'bbb'},
            {'body': 'aaa', 'signature': 'bbb'},
            {'body': 'aaa', 'signature': 'bbb'}
            ))
            .withGameResults(Arrays.asList(
                {'rank': 1, 'userId': 'user-0001'},
            {'rank': 2, 'userId': 'user-0002'},
            {'rank': 2, 'userId': 'user-0003'},
            {'rank': 3, 'userId': 'user-0004'}
            ))
            .withKeyId("$key1.keyId")
    );
    Ballot 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.VoteMultipleRequest;
using Gs2.Gs2Matchmaking.Result.VoteMultipleResult;

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.VoteMultipleResult> asyncResult = null;
yield return client.VoteMultiple(
    new Gs2.Gs2Matchmaking.Request.VoteMultipleRequest()
        .WithNamespaceName("namespace1")
        .WithSignedBallots(new Gs2.Gs2Matchmaking.Model.SignedBallot[] {
            {'body': 'aaa', 'signature': 'bbb'},
        {'body': 'aaa', 'signature': 'bbb'},
        {'body': 'aaa', 'signature': 'bbb'},
        {'body': 'aaa', 'signature': 'bbb'}
        })
        .WithGameResults(new Gs2.Gs2Matchmaking.Model.GameResult[] {
            {'rank': 1, 'userId': 'user-0001'},
        {'rank': 2, 'userId': 'user-0002'},
        {'rank': 2, 'userId': 'user-0003'},
        {'rank': 3, 'userId': 'user-0004'}
        })
        .WithKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.voteMultiple(
        new Gs2Matchmaking.VoteMultipleRequest()
            .withNamespaceName("namespace1")
            .withSignedBallots([
                {'body': 'aaa', 'signature': 'bbb'},
            {'body': 'aaa', 'signature': 'bbb'},
            {'body': 'aaa', 'signature': 'bbb'},
            {'body': 'aaa', 'signature': 'bbb'}
            ])
            .withGameResults([
                {'rank': 1, 'userId': 'user-0001'},
            {'rank': 2, 'userId': 'user-0002'},
            {'rank': 2, 'userId': 'user-0003'},
            {'rank': 3, 'userId': 'user-0004'}
            ])
            .withKeyId("$key1.keyId")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.vote_multiple(
        matchmaking.VoteMultipleRequest()
            .with_namespace_name(self.hash1)
            .with_signed_ballots([    {'body': 'aaa', 'signature': 'bbb'},
            {'body': 'aaa', 'signature': 'bbb'},
            {'body': 'aaa', 'signature': 'bbb'},
            {'body': 'aaa', 'signature': 'bbb'},
            ])
            .with_game_results([    {'rank': 1, 'userId': 'user-0001'},
            {'rank': 2, 'userId': 'user-0002'},
            {'rank': 2, 'userId': 'user-0003'},
            {'rank': 3, 'userId': 'user-0004'},
            ])
            .with_key_id(self.key1.key_id)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.vote_multiple({
    namespaceName='namespace1',
    signedBallots={
        {'body': 'aaa', 'signature': 'bbb'},
    {'body': 'aaa', 'signature': 'bbb'},
    {'body': 'aaa', 'signature': 'bbb'},
    {'body': 'aaa', 'signature': 'bbb'}
    },
    gameResults={
        {'rank': 1, 'userId': 'user-0001'},
    {'rank': 2, 'userId': 'user-0002'},
    {'rank': 2, 'userId': 'user-0003'},
    {'rank': 3, 'userId': 'user-0004'}
    },
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;

commitVote

Forced determination of voting status

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
ratingNamestring~ 128 charsRating Model Name
gatheringNamestring~ 128 charsGathering Name

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.CommitVote(
    &matchmaking.CommitVoteRequest {
        NamespaceName: pointy.String("namespace1"),
        RatingName: pointy.String("rating-0001"),
        GatheringName: pointy.String("gathering-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CommitVoteRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->commitVote(
        (new CommitVoteRequest())
            ->withNamespaceName(self::namespace1)
            ->withRatingName("rating-0001")
            ->withGatheringName("gathering-0001")
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CommitVoteRequest;
import io.gs2.matchmaking.result.CommitVoteResult;

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

try {
    CommitVoteResult result = client.commitVote(
        new CommitVoteRequest()
            .withNamespaceName("namespace1")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
    );
} 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.CommitVoteRequest;
using Gs2.Gs2Matchmaking.Result.CommitVoteResult;

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.CommitVoteResult> asyncResult = null;
yield return client.CommitVote(
    new Gs2.Gs2Matchmaking.Request.CommitVoteRequest()
        .WithNamespaceName("namespace1")
        .WithRatingName("rating-0001")
        .WithGatheringName("gathering-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.commitVote(
        new Gs2Matchmaking.CommitVoteRequest()
            .withNamespaceName("namespace1")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.commit_vote(
        matchmaking.CommitVoteRequest()
            .with_namespace_name(self.hash1)
            .with_rating_name('rating-0001')
            .with_gathering_name('gathering-0001')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.commit_vote({
    namespaceName='namespace1',
    ratingName='rating-0001',
    gatheringName='gathering-0001',
})

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

result = api_result.result