GS2-Matchmaking SDK API リファレンス

モデル

Namespace

ネームスペース

ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。
GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。

そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字ネームスペースGRN
namestring~ 128文字ネームスペース名
descriptionstring~ 1024文字説明文
enableRatingboolfalseレーティング計算機能を使用するか
enableDisconnectDetectionenum {
    “disable”,
    “enable”
}
“disable”~ 128文字マッチメイキング中プレイヤーの切断検知
disconnectDetectionTimeoutSecondsint{enableDisconnectDetection} == “enable”15 ~ 600マッチメイキング中にプレイヤーを切断と見なすまでの待機時間(秒)
createGatheringTriggerTypeenum {
    “none”,
    “gs2_realtime”,
    “gs2_script”
}
~ 128文字ギャザリング新規作成時のアクション
createGatheringTriggerRealtimeNamespaceIdstring{createGatheringTriggerType} == “gs2_realtime”~ 1024文字ギャザリング作成時にルームを作成する GS2-Realtime のネームスペース
createGatheringTriggerScriptIdstring{createGatheringTriggerType} == “gs2_script”~ 1024文字ギャザリング作成時に実行される GS2-Script のスクリプト
completeMatchmakingTriggerTypeenum {
    “none”,
    “gs2_realtime”,
    “gs2_script”
}
~ 128文字マッチメイキング完了時のアクション
completeMatchmakingTriggerRealtimeNamespaceIdstring{completeMatchmakingTriggerType} == “gs2_realtime”~ 1024文字マッチメイキング完了時にルームを作成する GS2-Realtime のネームスペース
completeMatchmakingTriggerScriptIdstring{completeMatchmakingTriggerType} == “gs2_script”~ 1024文字マッチメイキング完了時に実行される GS2-Script のスクリプト
enableCollaborateSeasonRatingenum {
    “enable”,
    “disable”
}
“disable”~ 128文字GS2-SeasonRating との連携を有効にするか
collaborateSeasonRatingNamespaceIdstring{enableCollaborateSeasonRating} == “enable”~ 1024文字マッチメイキング完了時にセッションを作成する GS2-SeasonRating のネームスペース
collaborateSeasonRatingTtlint{enableCollaborateSeasonRating} == “enable”6060 ~ 7200GS2-SeasonRating の結果を受け付ける最大時間(秒)
changeRatingScriptScriptSettingレーティング値が変化した時に実行するスクリプト
joinNotificationNotificationSettingギャザリングに新規プレイヤーが参加したときのプッシュ通知
leaveNotificationNotificationSettingギャザリングからプレイヤーが離脱したときのプッシュ通知
completeNotificationNotificationSettingマッチメイキングが完了したときのプッシュ通知
changeRatingNotificationNotificationSettingレーティングの値が変動したときのプッシュ通知
logSettingLogSettingログの出力設定
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

enableDisconnectDetection に指定する列挙型の定義

定義説明
disable無効
enable有効

createGatheringTriggerType に指定する列挙型の定義

定義説明
noneなし
gs2_realtimeGS2-Realtime のルーム作成
gs2_scriptGS2-Script の実行

completeMatchmakingTriggerType に指定する列挙型の定義

定義説明
noneなし
gs2_realtimeGS2-Realtime のルーム作成
gs2_scriptGS2-Script の実行

enableCollaborateSeasonRating に指定する列挙型の定義

定義説明
enable有効
disable無効

Gathering

ギャザリング

マッチメイキングによって集められたゲームプレイヤーグループを表すエンティティです。
マッチメイキング用のパラメータを複数持っており、パラメータを総合的に判断してプレイヤーをグルーピングします。

有効化条件必須デフォルト値の制限説明
gatheringIdstring~ 1024文字ギャザリングGRN
namestringUUID~ 128文字ギャザリング名
attributeRangesList<AttributeRange>[]~ 5 items募集条件
capacityOfRolesList<CapacityOfRole>[]1 ~ 5 items募集枠
allowUserIdsList<string>[]~ 100 items参加を許可するユーザ
metadatastring~ 1024文字メタデータ
expiresAtlongギャザリングの有効期限 (UNIX時間 単位:ミリ秒)
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

RatingModelMaster

レーティングモデルマスター

GS2 ではレーティングアルゴリズムとして Glicko-2 を採用しています。
Glicko-2 には複数のパラメータがありますが、GS2-Matchmaking ではそれらを総合的に表す ボラティリティ という1つのパラメータに集約しています。
ボラティリティ は変化の大きさを表すパラメータで、値が大きいほどレーティングの値の変動量が大きくなります。

有効化条件必須デフォルト値の制限説明
ratingModelIdstring~ 1024文字レーティングモデルマスターGRN
namestring~ 128文字レーティングモデル名
metadatastring~ 128文字メタデータ
descriptionstring~ 1024文字説明文
initialValueint1500100 ~ 10000レート値の初期値
volatilityint1001 ~ 20000レート値の変動の大きさ
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

RatingModel

レーティングモデル

GS2 ではレーティングアルゴリズムとして Glicko-2 を採用しています。
Glicko-2 には複数のパラメータがありますが、GS2-Matchmaking ではそれらを総合的に表す ボラティリティ という1つのパラメータに集約しています。
ボラティリティ は変化の大きさを表すパラメータで、値が大きいほどレーティングの値の変動量が大きくなります。

有効化条件必須デフォルト値の制限説明
ratingModelIdstring~ 1024文字レーティングモデルGRN
namestring~ 128文字レーティングモデル名
metadatastring~ 128文字メタデータ
initialValueint1500100 ~ 10000レート値の初期値
volatilityint1001 ~ 20000レート値の変動の大きさ

CurrentModelMaster

現在有効なマスターデータ

GS2ではマスターデータの管理にJSON形式のファイルを使用します。
ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。

JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが
よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字現在有効なマスターGRN
settingsstring~ 5242880文字マスターデータ

SeasonModel

シーズンモデルマスター

有効化条件必須デフォルト値の制限説明
seasonModelIdstring~ 1024文字レーティングモデルGRN
namestring~ 128文字シーズンモデル名
metadatastring~ 128文字メタデータ
maximumParticipantsint2 ~ 1000最大参加人数
experienceModelIdstring~ 1024文字ティアーを保持する GS2-Experience の経験値モデル
challengePeriodEventIdstring~ 1024文字シーズンの期間を設定した GS2-Schedule イベントGRN

SeasonModelMaster

シーズンモデルマスター

有効化条件必須デフォルト値の制限説明
seasonModelIdstring~ 1024文字レーティングモデルマスターGRN
namestring~ 128文字シーズンモデル名
metadatastring~ 128文字メタデータ
descriptionstring~ 1024文字説明文
maximumParticipantsint2 ~ 1000最大参加人数
experienceModelIdstring~ 1024文字ティアーを保持する GS2-Experience の経験値モデル
challengePeriodEventIdstring~ 1024文字シーズンの期間を設定した GS2-Schedule イベントGRN
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

SeasonGathering

シーズンギャザリング

有効化条件必須デフォルト値の制限説明
seasonGatheringIdstring~ 1024文字シーズンギャザリングGRN
seasonNamestring~ 128文字シーズンモデル名
seasonlong~ 9223372036854775805シーズン
tierlong~ 9223372036854775805ティアー
namestringUUID~ 128文字ギャザリング名
participantsList<string>[]~ 1000 items参加者のユーザーIDリスト
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

JoinedSeasonGathering

参加中のシーズンギャザリング

有効化条件必須デフォルト値の制限説明
joinedSeasonGatheringIdstring~ 1024文字参加中のシーズンギャザリングGRN
userIdstring~ 128文字ユーザーID
seasonNamestring~ 128文字シーズンモデル名
seasonlong~ 9223372036854775805シーズン
tierlong~ 9223372036854775805ティアー
seasonGatheringNamestring~ 128文字ギャザリング名
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)

ScriptSetting

スクリプト設定

GS2 ではマイクロサービスのイベントに関連づけて、カスタムスクリプトを実行することができます。
このモデルは、スクリプトの実行をトリガーするための設定を保持します。

スクリプトの実行方式は大きく2種類あり、それは「同期実行」と「非同期実行」です。
同期実行は、スクリプトの実行が完了するまで処理がブロックされます。
かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることができます。

一方、非同期実行は、スクリプトの実行が完了するまで処理がブロックされません。
かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることはできません。
しかし、非同期実行は、スクリプトの実行が完了するまで処理がブロックされないため、APIの応答に影響を与えないため、原則非同期実行を使用することをおすすめします。

非同期実行には実行方式が2種類あり、GS2-Script と Amazon EventBridge があります。
Amazon EventBridge を使用することで、Lua 以外の言語で処理を記述することができます。

有効化条件必須デフォルト値の制限説明
triggerScriptIdstring~ 1024文字スクリプトGRN
doneTriggerTargetTypeenum {
    “none”,
    “gs2_script”,
    “aws”
}
“none”~ 128文字完了通知の通知先
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024文字スクリプトGRN
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024文字ネームスペースGRN

doneTriggerTargetType に指定する列挙型の定義

定義説明
noneなし
gs2_scriptGS2-Script
awsAmazon EventBridge

NotificationSetting

プッシュ通知に関する設定

GS2 のマイクロサービス内で何らかのイベントが発生した際に、プッシュ通知を送信するための設定です。
ここでいうプッシュ通知は GS2-Gateway の提供する WebSocket インターフェースを経由した処理であり、スマートフォンのプッシュ通知とは性質が異なります。
たとえば、マッチメイキングが完了した時やフレンドリクエストが届いた時など、ゲームクライアントの操作とは関係なく状態が変化した際に GS2-Gateway を経由してプッシュ通知をすることで、ゲームクライアントは状態の変化を検知することができます。

GS2-Gateway のプッシュ通知は通知先のデバイスがオフラインだった時に追加の処理としてモバイルプッシュ通知を送信できます。
モバイルプッシュ通知をうまく利用すれば、マッチメイキング中にゲームを終了しても、モバイルプッシュ通知を使用してプレイヤーに通知し、ゲームに戻ってくるフローを実現できる可能性があります。

有効化条件必須デフォルト値の制限説明
gatewayNamespaceIdstring“grn:gs2:{region}:{ownerId}:gateway:default”~ 1024文字プッシュ通知に使用する GS2-Gateway のネームスペース
enableTransferMobileNotificationbool?falseモバイルプッシュ通知へ転送するか
soundstring{enableTransferMobileNotification} == true~ 1024文字モバイルプッシュ通知で使用するサウンドファイル名

LogSetting

ログの書き出し設定

ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用されるログ名前空間の識別子(Namespace ID)を保持します。
ログ名前空間IDは、ログデータを集約し、保存する対象の GS2-Log の名前空間を指定します。
この設定を通じて、この名前空間以下のAPIリクエスト・レスポンスログデータが対象の GS2-Log へ出力されるようになります。
GS2-Log にはリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。

有効化条件必須デフォルト値の制限説明
loggingNamespaceIdstring~ 1024文字ネームスペースGRN

GitHubCheckoutSetting

GitHubからマスターデータをチェックアウトする設定

有効化条件必須デフォルト値の制限説明
apiKeyIdstring~ 1024文字GitHub のAPIキーGRN
repositoryNamestring~ 1024文字リポジトリ名
sourcePathstring~ 1024文字ソースコードのファイルパス
referenceTypeenum {
    “commit_hash”,
    “branch”,
    “tag”
}
~ 128文字コードの取得元
commitHashstring{referenceType} == “commit_hash”~ 1024文字コミットハッシュ
branchNamestring{referenceType} == “branch”~ 1024文字ブランチ名
tagNamestring{referenceType} == “tag”~ 1024文字タグ名

referenceType に指定する列挙型の定義

定義説明
commit_hashコミットハッシュ
branchブランチ
tagタグ

AttributeRange

募集条件

有効化条件必須デフォルト値の制限説明
namestring~ 128文字属性名
minint0~ 2147483646ギャザリング参加可能な属性値の最小値
maxint0~ 2147483646ギャザリング参加可能な属性値の最大値

CapacityOfRole

募集枠

有効化条件必須デフォルト値の制限説明
roleNamestring“default”~ 128文字ロール名
roleAliasesList<string>[]~ 9 itemsロール名の別名リスト
capacityint1 ~ 256募集人数
participantsList<Player>[]~ 1000 items参加者のプレイヤー情報リスト

Attribute

属性値

有効化条件必須デフォルト値の制限説明
namestring~ 128文字属性名
valueint0~ 2147483646属性値

Player

参加者のプレイヤー情報

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
attributesList<Attribute>[]~ 5 items属性値のリスト
roleNamestring“default”~ 128文字ロール名
denyUserIdsList<string>[]~ 100 items参加を拒否するユーザIDリスト
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)

Rating

レーティング

ゲームプレイヤー毎の現在のレーティングの値を保持するエンティティです。

有効化条件必須デフォルト値の制限説明
ratingIdstring~ 1024文字レーティングGRN
namestring~ 128文字レーティング名
userIdstring~ 128文字ユーザーID
rateValuefloat1500.0~ 65535.0
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

GameResult

対戦結果

有効化条件必須デフォルト値の制限説明
rankint~ 2147483646順位
userIdstring~ 128文字ユーザーID

Ballot

投票用紙

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
ratingNamestring~ 128文字レーティング計算に使用するレーティング名
gatheringNamestring~ 128文字投票対象のギャザリング名
numberOfPlayerint2 ~ 10参加人数

SignedBallot

署名付の投票用紙

有効化条件必須デフォルト値の制限説明
bodystring~ 1024文字投票用紙の署名対象のデータ
signaturestring~ 256文字投票用紙の署名

WrittenBallot

投票用紙

有効化条件必須デフォルト値の制限説明
ballotBallot投票用紙
gameResultsList<GameResult>~ 10 items投票内容。対戦結果のリスト

Vote

投票状況

有効化条件必須デフォルト値の制限説明
voteIdstring~ 1024文字投票状況GRN
ratingNamestring~ 128文字レーティングモデル名
gatheringNamestringUUID~ 128文字ギャザリング名
writtenBallotsList<WrittenBallot>[]~ 10 items投票用紙のリスト
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)

TimeSpan

時間間隔

有効化条件必須デフォルト値の制限説明
daysint0~ 365現在時刻からの日数
hoursint0~ 24現在時刻からの時間
minutesint0~ 60現在時刻からの分

メソッド

describeNamespaces

ネームスペースの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<Namespace>ネームスペースのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

createNamespace

ネームスペースを新規作成

Request

有効化条件必須デフォルト値の制限説明
namestring~ 128文字ネームスペース名
descriptionstring~ 1024文字説明文
enableRatingboolfalseレーティング計算機能を使用するか
enableDisconnectDetectionenum {
    “disable”,
    “enable”
}
“disable”~ 128文字マッチメイキング中プレイヤーの切断検知
disconnectDetectionTimeoutSecondsint{enableDisconnectDetection} == “enable”15 ~ 600マッチメイキング中にプレイヤーを切断と見なすまでの待機時間(秒)
createGatheringTriggerTypeenum {
    “none”,
    “gs2_realtime”,
    “gs2_script”
}
~ 128文字ギャザリング新規作成時のアクション
createGatheringTriggerRealtimeNamespaceIdstring{createGatheringTriggerType} == “gs2_realtime”~ 1024文字ギャザリング作成時にルームを作成する GS2-Realtime のネームスペース
createGatheringTriggerScriptIdstring{createGatheringTriggerType} == “gs2_script”~ 1024文字ギャザリング作成時に実行される GS2-Script のスクリプト
completeMatchmakingTriggerTypeenum {
    “none”,
    “gs2_realtime”,
    “gs2_script”
}
~ 128文字マッチメイキング完了時のアクション
completeMatchmakingTriggerRealtimeNamespaceIdstring{completeMatchmakingTriggerType} == “gs2_realtime”~ 1024文字マッチメイキング完了時にルームを作成する GS2-Realtime のネームスペース
completeMatchmakingTriggerScriptIdstring{completeMatchmakingTriggerType} == “gs2_script”~ 1024文字マッチメイキング完了時に実行される GS2-Script のスクリプト
enableCollaborateSeasonRatingenum {
    “enable”,
    “disable”
}
“disable”~ 128文字GS2-SeasonRating との連携を有効にするか
collaborateSeasonRatingNamespaceIdstring{enableCollaborateSeasonRating} == “enable”~ 1024文字マッチメイキング完了時にセッションを作成する GS2-SeasonRating のネームスペース
collaborateSeasonRatingTtlint{enableCollaborateSeasonRating} == “enable”6060 ~ 7200GS2-SeasonRating の結果を受け付ける最大時間(秒)
changeRatingScriptScriptSettingレーティング値が変化した時に実行するスクリプト
joinNotificationNotificationSettingギャザリングに新規プレイヤーが参加したときのプッシュ通知
leaveNotificationNotificationSettingギャザリングからプレイヤーが離脱したときのプッシュ通知
completeNotificationNotificationSettingマッチメイキングが完了したときのプッシュ通知
changeRatingNotificationNotificationSettingレーティングの値が変動したときのプッシュ通知
logSettingLogSettingログの出力設定

enableDisconnectDetection に指定する列挙型の定義

定義説明
disable無効
enable有効

createGatheringTriggerType に指定する列挙型の定義

定義説明
noneなし
gs2_realtimeGS2-Realtime のルーム作成
gs2_scriptGS2-Script の実行

completeMatchmakingTriggerType に指定する列挙型の定義

定義説明
noneなし
gs2_realtimeGS2-Realtime のルーム作成
gs2_scriptGS2-Script の実行

enableCollaborateSeasonRating に指定する列挙型の定義

定義説明
enable有効
disable無効

Result

説明
itemNamespace作成したネームスペース

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

getNamespaceStatus

ネームスペースの状態を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名

Result

説明
statusstring

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    GetNamespaceStatusResult result = client.getNamespaceStatus(
        new GetNamespaceStatusRequest()
            .withNamespaceName("namespace1")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Matchmaking.Result.GetNamespaceStatusResult;

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

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
status = result.status;

getNamespace

ネームスペースを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名

Result

説明
itemNamespaceネームスペース

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    GetNamespaceResult result = client.getNamespace(
        new GetNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.GetNamespaceRequest;
using Gs2.Gs2Matchmaking.Result.GetNamespaceResult;

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

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

updateNamespace

ネームスペースを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
descriptionstring~ 1024文字説明文
enableRatingboolfalseレーティング計算機能を使用するか
enableDisconnectDetectionenum {
    “disable”,
    “enable”
}
“disable”~ 128文字マッチメイキング中プレイヤーの切断検知
disconnectDetectionTimeoutSecondsint{enableDisconnectDetection} == “enable”15 ~ 600マッチメイキング中にプレイヤーを切断と見なすまでの待機時間(秒)
createGatheringTriggerTypeenum {
    “none”,
    “gs2_realtime”,
    “gs2_script”
}
~ 128文字ギャザリング新規作成時のアクション
createGatheringTriggerRealtimeNamespaceIdstring{createGatheringTriggerType} == “gs2_realtime”~ 1024文字ギャザリング作成時にルームを作成する GS2-Realtime のネームスペース
createGatheringTriggerScriptIdstring{createGatheringTriggerType} == “gs2_script”~ 1024文字ギャザリング作成時に実行される GS2-Script のスクリプト
completeMatchmakingTriggerTypeenum {
    “none”,
    “gs2_realtime”,
    “gs2_script”
}
~ 128文字マッチメイキング完了時のアクション
completeMatchmakingTriggerRealtimeNamespaceIdstring{completeMatchmakingTriggerType} == “gs2_realtime”~ 1024文字マッチメイキング完了時にルームを作成する GS2-Realtime のネームスペース
completeMatchmakingTriggerScriptIdstring{completeMatchmakingTriggerType} == “gs2_script”~ 1024文字マッチメイキング完了時に実行される GS2-Script のスクリプト
enableCollaborateSeasonRatingenum {
    “enable”,
    “disable”
}
“disable”~ 128文字GS2-SeasonRating との連携を有効にするか
collaborateSeasonRatingNamespaceIdstring{enableCollaborateSeasonRating} == “enable”~ 1024文字マッチメイキング完了時にセッションを作成する GS2-SeasonRating のネームスペース
collaborateSeasonRatingTtlint{enableCollaborateSeasonRating} == “enable”6060 ~ 7200GS2-SeasonRating の結果を受け付ける最大時間(秒)
changeRatingScriptScriptSettingレーティング値が変化した時に実行するスクリプト
joinNotificationNotificationSettingギャザリングに新規プレイヤーが参加したときのプッシュ通知
leaveNotificationNotificationSettingギャザリングからプレイヤーが離脱したときのプッシュ通知
completeNotificationNotificationSettingマッチメイキングが完了したときのプッシュ通知
changeRatingNotificationNotificationSettingレーティングの値が変動したときのプッシュ通知
logSettingLogSettingログの出力設定

enableDisconnectDetection に指定する列挙型の定義

定義説明
disable無効
enable有効

createGatheringTriggerType に指定する列挙型の定義

定義説明
noneなし
gs2_realtimeGS2-Realtime のルーム作成
gs2_scriptGS2-Script の実行

completeMatchmakingTriggerType に指定する列挙型の定義

定義説明
noneなし
gs2_realtimeGS2-Realtime のルーム作成
gs2_scriptGS2-Script の実行

enableCollaborateSeasonRating に指定する列挙型の定義

定義説明
enable有効
disable無効

Result

説明
itemNamespace更新したネームスペース

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

deleteNamespace

ネームスペースを削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名

Result

説明
itemNamespace削除したネームスペース

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DeleteNamespaceResult result = client.deleteNamespace(
        new DeleteNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.DeleteNamespaceRequest;
using Gs2.Gs2Matchmaking.Result.DeleteNamespaceResult;

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

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

dumpUserDataByUserId

指定したユーザーIDに紐づくデータのダンプを取得

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result

checkDumpUserDataByUserId

指定したユーザーIDに紐づくデータのダンプが完了しているか確認

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
urlstring出力データのURL

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
url = result.url;

cleanUserDataByUserId

指定したユーザーIDに紐づくデータのダンプを取得

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result

checkCleanUserDataByUserId

指定したユーザーIDに紐づくデータのダンプが完了しているか確認

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result

prepareImportUserDataByUserId

指定したユーザーIDに紐づくデータのインポートを開始

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
uploadTokenstringアップロード後に結果を反映する際に使用するトークン
uploadUrlstringユーザーデータアップロード処理の実行に使用するURL

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

importUserDataByUserId

指定したユーザーIDに紐づくデータのインポートを開始

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
uploadTokenstring~ 1024文字アップロード準備で受け取ったトークン
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result

checkImportUserDataByUserId

指定したユーザーIDに紐づくデータのインポートが完了しているか確認

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
uploadTokenstring~ 1024文字アップロード準備で受け取ったトークン
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
urlstring出力ログのURL

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
url = result.url;

describeGatherings

ギャザリングの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<Gathering>ギャザリングのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

api_result = client.describe_gatherings({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

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

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

api_result_handler = client.describe_gatherings_async({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

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

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

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

createGathering

ギャザリングを作成して募集を開始

募集条件 には、作成したギャザリングに参加を許可する各属性値の範囲を指定します。

たとえば、同一ゲームモードを希望するプレイヤーを募集したい場合は、ゲームモードに対応した属性値が完全一致する参加条件プレイヤーとマッチメイキングするように
属性名:ゲームモード 属性最小値: ゲームモードを表す数値 属性最大値: ゲームモードを表す数値
とすることで、同一ゲームモードを希望するプレイヤー同士をマッチメイキングできます。

他にレーティングをベースにしたマッチメイキングを実施したい場合は、
ルーム作成者のレーティング値を中心とした属性値の範囲を指定することで、レーティング値の近いプレイヤー同士をマッチメイキングできます。
この 募集条件 はあとで更新することができますので、徐々に条件を緩和していくことができます。

ロール とは 盾役1人・回復役1人・攻撃役2人 などの役割ごとに募集人数を設定したい場合に使用します。
ロールにはエイリアスを指定できます。
たとえば、盾役は パラディン と ナイト の2種類の ジョブ に更に分類できるとします。
この場合、ロール名 に 盾役 エイリアス に パラディン ナイト として募集を出すようにゲームを実装します。
そして、プレイヤーは自分自身の ジョブ を自身のプレイヤー情報のロールに指定します。

こうすることで、募集条件が 盾役 になっているギャザリングには パラディンナイト も参加できます。
一方で、ギャザリングを作成するときに、 パラディン だけ募集したくて、 ナイト を募集したくない場合は、
募集するロール名に パラディン を直接指定したり、エイリアスに ナイト を含めないようにすることで実現できます。

参加者募集人数 はプレイヤーの募集人数を指定します。ロール名を指定することで、ロール名ごとの募集人数を設定できます。

参加者参加者のプレイヤー情報リスト には事前にプレイヤー間でパーティを構築している場合や、参加者が離脱したあとの追加募集で使用します。

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字ユーザーID
playerPlayer自身のプレイヤー情報
attributeRangesList<AttributeRange>[]~ 5 items募集条件
capacityOfRolesList<CapacityOfRole>[]1 ~ 5 items募集枠
allowUserIdsList<string>[]~ 100 items参加を許可するユーザ
expiresAtlongギャザリングの有効期限 (UNIX時間 単位:ミリ秒)
expiresAtTimeSpanTimeSpan有効期限までの時間

Result

説明
itemGathering作成したギャザリング

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

createGatheringByUserId

ユーザーIDを指定してギャザリングを作成して募集を開始

募集条件 には、作成したギャザリングに参加を許可する各属性値の範囲を指定します。

たとえば、同一ゲームモードを希望するプレイヤーを募集したい場合は、ゲームモードに対応した属性値が完全一致する参加条件プレイヤーとマッチメイキングするように
属性名:ゲームモード 属性最小値: ゲームモードを表す数値 属性最大値: ゲームモードを表す数値
とすることで、同一ゲームモードを希望するプレイヤー同士をマッチメイキングできます。

他にレーティングをベースにしたマッチメイキングを実施したい場合は、
ルーム作成者のレーティング値を中心とした属性値の範囲を指定することで、レーティング値の近いプレイヤー同士をマッチメイキングできます。
この 募集条件 はあとで更新することができますので、徐々に条件を緩和していくことができます。

ロール とは 盾役1人・回復役1人・攻撃役2人 などの役割ごとに募集人数を設定したい場合に使用します。
ロールにはエイリアスを指定できます。
たとえば、盾役は パラディン と ナイト の2種類の ジョブ に更に分類できるとします。
この場合、ロール名 に 盾役 エイリアス に パラディン ナイト として募集を出すようにゲームを実装します。
そして、プレイヤーは自分自身の ジョブ を自身のプレイヤー情報のロールに指定します。

こうすることで、募集条件が 盾役 になっているギャザリングには パラディンナイト も参加できます。
一方で、ギャザリングを作成するときに、 パラディン だけ募集したくて、 ナイト を募集したくない場合は、
募集するロール名に パラディン を直接指定したり、エイリアスに ナイト を含めないようにすることで実現できます。

参加者募集人数 はプレイヤーの募集人数を指定します。ロール名を指定することで、ロール名ごとの募集人数を設定できます。

参加者参加者のプレイヤー情報リスト には事前にプレイヤー間でパーティを構築している場合や、参加者が離脱したあとの追加募集で使用します。

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
playerPlayer自身のプレイヤー情報
attributeRangesList<AttributeRange>[]~ 5 items募集条件
capacityOfRolesList<CapacityOfRole>[]1 ~ 5 items募集枠
allowUserIdsList<string>[]~ 100 items参加を許可するユーザ
expiresAtlongギャザリングの有効期限 (UNIX時間 単位:ミリ秒)
expiresAtTimeSpanTimeSpan有効期限までの時間
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemGathering作成したギャザリング

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

updateGathering

ギャザリングを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
gatheringNamestringUUID~ 128文字ギャザリング名
accessTokenstring~ 128文字ユーザーID
attributeRangesList<AttributeRange>[]~ 5 items募集条件

Result

説明
itemGathering更新したギャザリング

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

try:
    result = client.update_gathering(
        matchmaking.UpdateGatheringRequest()
            .with_namespace_name(self.hash1)
            .with_gathering_name(self.gathering1.name)
            .with_access_token(self.access_token_0001)
            .with_attribute_ranges([
                matchmaking.AttributeRange()
                    .with_name('stage')
                    .with_min(1)
                    .with_max(1),
                matchmaking.AttributeRange()
                    .with_name('level')
                    .with_min(0)
                    .with_max(50),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

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

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

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

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

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

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

result = api_result.result
item = result.item;

updateGatheringByUserId

ユーザーIDを指定してギャザリングを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
gatheringNamestringUUID~ 128文字ギャザリング名
userIdstring~ 128文字ユーザーID
attributeRangesList<AttributeRange>[]~ 5 items募集条件
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemGathering更新したギャザリング

実装例

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{
            matchmaking.AttributeRange{
                Name: pointy.String("stage"),
                Min: pointy.Int32(1),
                Max: pointy.Int32(2),
            },
            matchmaking.AttributeRange{
                Name: pointy.String("level"),
                Min: pointy.Int32(3),
                Max: pointy.Int32(5),
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateGatheringByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    UpdateGatheringByUserIdResult result = client.updateGatheringByUserId(
        new UpdateGatheringByUserIdRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withAttributeRanges(Arrays.asList(
                new AttributeRange()
                    .withName("stage")
                    .withMin(1)
                    .withMax(2),
                new AttributeRange()
                    .withName("level")
                    .withMin(3)
                    .withMax(5)
            ))
            .withTimeOffsetToken(null)
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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[] {
            new Gs2.Gs2Matchmaking.Model.AttributeRange()
                .WithName("stage")
                .WithMin(1)
                .WithMax(2),
            new Gs2.Gs2Matchmaking.Model.AttributeRange()
                .WithName("level")
                .WithMin(3)
                .WithMax(5),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

doMatchmakingByPlayer

Player が参加できるギャザリングを探して参加する

一定時間 検索を行い、対象が見つからなかったときには マッチメイキングの状態を保持するトークン を返す。
次回 マッチメイキングの状態を保持するトークン をつけて再度リクエストを出すことで、前回の続きから検索処理を再開できる。
すべてのギャザリングを検索したが、参加できるギャザリングが存在しなかった場合はギャザリングもトークンもどちらも null が応答される。

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
playerPlayerプレイヤー情報
matchmakingContextTokenstring~ 5120文字検索の再開に使用する マッチメイキングの状態を保持するトークン

Result

説明
itemGathering参加したギャザリング
matchmakingContextTokenstringマッチメイキングの状態を保持するトークン

実装例

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DoMatchmakingByPlayerResult result = client.doMatchmakingByPlayer(
        new DoMatchmakingByPlayerRequest()
            .withNamespaceName("namespace1")
            .withPlayer(new Player()
                .withUserId("user-0001")
                .withAttributes(Arrays.asList(
                    new io.gs2.matchmaking.model.Attribute()
                        .withName("attr1")
                        .withValue(1)
                    new io.gs2.matchmaking.model.Attribute()
                        .withName("attr2")
                        .withValue(1),
                ))
            .withMatchmakingContextToken(null)
    );
    Gathering item = result.getItem();
    String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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(new Gs2.Gs2Matchmaking.Model.Player()
            .WithUserId("user-0001")
            .WithAttributes(new Gs2.Gs2Matchmaking.Model.Attribute[] {
                    .WithName("attr1")
                    .WithValue(1)
                    .WithName("attr2")
                    .WithValue(1)
            }))
        .WithMatchmakingContextToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var matchmakingContextToken = result.MatchmakingContextToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

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

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

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

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

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

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

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

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

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

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

doMatchmaking

自分が参加できるギャザリングを探して参加する

一定時間 検索を行い、対象が見つからなかったときには マッチメイキングの状態を保持するトークン を返す。
次回 マッチメイキングの状態を保持するトークン をつけて再度リクエストを出すことで、前回の続きから検索処理を再開できる。
すべてのギャザリングを検索したが、参加できるギャザリングが存在しなかった場合はギャザリングもトークンもどちらも null が応答される。

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字ユーザーID
playerPlayer自身のプレイヤー情報
matchmakingContextTokenstring~ 5120文字検索の再開に使用する マッチメイキングの状態を保持するトークン

Result

説明
itemGathering参加したギャザリング
matchmakingContextTokenstringマッチメイキングの状態を保持するトークン

実装例

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DoMatchmakingResult result = client.doMatchmaking(
        new DoMatchmakingRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withPlayer(new Player()
                .withUserId("user-0001")
                .withAttributes(Arrays.asList(
                    new io.gs2.matchmaking.model.Attribute()
                        .withName("attr1")
                        .withValue(1)
                    new io.gs2.matchmaking.model.Attribute()
                        .withName("attr2")
                        .withValue(1),
                ))
            .withMatchmakingContextToken(null)
    );
    Gathering item = result.getItem();
    String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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("accessToken-0001")
        .WithPlayer(new Gs2.Gs2Matchmaking.Model.Player()
            .WithUserId("user-0001")
            .WithAttributes(new Gs2.Gs2Matchmaking.Model.Attribute[] {
                    .WithName("attr1")
                    .WithValue(1)
                    .WithName("attr2")
                    .WithValue(1)
            }))
        .WithMatchmakingContextToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var matchmakingContextToken = result.MatchmakingContextToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

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

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

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

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

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

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

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

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

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

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

doMatchmakingByUserId

自分が参加できるギャザリングを探して参加する

一定時間 検索を行い、対象が見つからなかったときには マッチメイキングの状態を保持するトークン を返す。
次回 マッチメイキングの状態を保持するトークン をつけて再度リクエストを出すことで、前回の続きから検索処理を再開できる。
すべてのギャザリングを検索したが、参加できるギャザリングが存在しなかった場合はギャザリングもトークンもどちらも null が応答される。

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
playerPlayer自身のプレイヤー情報
matchmakingContextTokenstring~ 5120文字検索の再開に使用する マッチメイキングの状態を保持するトークン
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemGathering参加したギャザリング
matchmakingContextTokenstringマッチメイキングの状態を保持するトークン

実装例

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,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
matchmakingContextToken := result.MatchmakingContextToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DoMatchmakingByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DoMatchmakingByUserIdResult result = client.doMatchmakingByUserId(
        new DoMatchmakingByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withPlayer(null)
            .withMatchmakingContextToken(null)
            .withTimeOffsetToken(null)
    );
    Gathering item = result.getItem();
    String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var matchmakingContextToken = result.MatchmakingContextToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

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

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

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

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

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

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

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

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

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

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

ping

マッチメイキング待機中であることを通知

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
gatheringNamestringUUID~ 128文字ギャザリング名
accessTokenstring~ 128文字ユーザーID

Result

説明
itemGathering更新したギャザリング

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->ping(
        (new PingRequest())
            ->withNamespaceName(self::namespace1)
            ->withGatheringName("gathering-0001")
            ->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.PingRequest;
import io.gs2.matchmaking.result.PingResult;

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

try {
    PingResult result = client.ping(
        new PingRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("gathering-0001")
            .withAccessToken("accessToken-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.PingRequest;
using Gs2.Gs2Matchmaking.Result.PingResult;

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

pingByUserId

ユーザーIDを指定してマッチメイキング待機中であることを通知

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
gatheringNamestringUUID~ 128文字ギャザリング名
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemGathering更新したギャザリング

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    PingByUserIdResult result = client.pingByUserId(
        new PingByUserIdRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.PingByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.PingByUserIdResult;

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

getGathering

ギャザリングを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
gatheringNamestringUUID~ 128文字ギャザリング名

Result

説明
itemGatheringギャザリング

実装例

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("gathering-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetGatheringRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    GetGatheringResult result = client.getGathering(
        new GetGatheringRequest()
            .withNamespaceName("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.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("gathering-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.getGathering(
        new Gs2Matchmaking.GetGatheringRequest()
            .withNamespaceName("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.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="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;
client = gs2('matchmaking')

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

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

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

result = api_result.result
item = result.item;

cancelMatchmaking

マッチメイキングをキャンセルする

ギャザリングから離脱する前にマッチメイキングが完了した場合は、NotFoundException(404エラー) が発生し失敗します

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
gatheringNamestringUUID~ 128文字ギャザリング名
accessTokenstring~ 128文字ユーザーID

Result

説明
itemGatheringキャンセルしたギャザリング

実装例

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("gathering-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CancelMatchmakingRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->cancelMatchmaking(
        (new CancelMatchmakingRequest())
            ->withNamespaceName(self::namespace1)
            ->withGatheringName(self::gathering-0001)
            ->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("gathering-0001")
            .withAccessToken("accessToken-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("gathering-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

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

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

try:
    result = client.cancel_matchmaking(
        matchmaking.CancelMatchmakingRequest()
            .with_namespace_name(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="gathering-0001",
    accessToken="accessToken-0001",
})

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

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

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

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

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

result = api_result.result
item = result.item;

cancelMatchmakingByUserId

ユーザIDを指定してマッチメイキングをキャンセルする

ギャザリングから離脱する前にマッチメイキングが完了した場合は、NotFoundException(404エラー) が発生し失敗します

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
gatheringNamestringUUID~ 128文字ギャザリング名
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemGatheringキャンセルしたギャザリング

実装例

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"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CancelMatchmakingByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    CancelMatchmakingByUserIdResult result = client.cancelMatchmakingByUserId(
        new CancelMatchmakingByUserIdRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.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")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

earlyComplete

マッチメイキングを早期終了する

マッチメイキングが規定人数に達していない状態で、マッチメイキングを早期終了します。
早期終了が可能なのは、ギャザリングを作成したプレイヤーのみです。

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
gatheringNamestringUUID~ 128文字ギャザリング名
accessTokenstring~ 128文字ユーザーID

Result

説明
itemGatheringキャンセルしたギャザリング

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->earlyComplete(
        (new EarlyCompleteRequest())
            ->withNamespaceName(self::namespace1)
            ->withGatheringName("gathering-0001")
            ->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.EarlyCompleteRequest;
import io.gs2.matchmaking.result.EarlyCompleteResult;

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

try {
    EarlyCompleteResult result = client.earlyComplete(
        new EarlyCompleteRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("gathering-0001")
            .withAccessToken("accessToken-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.EarlyCompleteRequest;
using Gs2.Gs2Matchmaking.Result.EarlyCompleteResult;

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

earlyCompleteByUserId

ユーザIDを指定してマッチメイキングを早期終了する

マッチメイキングが規定人数に達していない状態で、マッチメイキングを早期終了します。
早期終了が可能なのは、ギャザリングを作成したプレイヤーのみです。

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
gatheringNamestringUUID~ 128文字ギャザリング名
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemGatheringキャンセルしたギャザリング

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    EarlyCompleteByUserIdResult result = client.earlyCompleteByUserId(
        new EarlyCompleteByUserIdRequest()
            .withNamespaceName("namespace1")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Gathering item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.EarlyCompleteByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.EarlyCompleteByUserIdResult;

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

deleteGathering

ギャザリングを削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
gatheringNamestringUUID~ 128文字ギャザリング名

Result

説明
itemGathering削除したギャザリング

実装例

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;
client = gs2('matchmaking')

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

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

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

result = api_result.result
item = result.item;

describeRatingModelMasters

レーティングモデルマスターの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<RatingModelMaster>レーティングモデルマスターのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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;
client = gs2('matchmaking')

api_result_handler = client.describe_rating_model_masters_async({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

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

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

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

createRatingModelMaster

レーティングモデルマスターを新規作成

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
namestring~ 128文字レーティングモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
initialValueint1500100 ~ 10000レート値の初期値
volatilityint1001 ~ 20000レート値の変動の大きさ

Result

説明
itemRatingModelMaster作成したレーティングモデルマスター

実装例

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;
client = gs2('matchmaking')

api_result_handler = client.create_rating_model_master_async({
    namespaceName="namespace1",
    name="mode1",
    description=nil,
    metadata=nil,
    initialValue=nil,
    volatility=nil,
})

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

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

result = api_result.result
item = result.item;

getRatingModelMaster

レーティングモデルマスターを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
ratingNamestring~ 128文字レーティングモデル名

Result

説明
itemRatingModelMasterレーティングモデルマスター

実装例

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;
client = gs2('matchmaking')

api_result_handler = client.get_rating_model_master_async({
    namespaceName="namespace1",
    ratingName="mode1",
})

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

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

result = api_result.result
item = result.item;

updateRatingModelMaster

レーティングモデルマスターを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
ratingNamestring~ 128文字レーティングモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
initialValueint1500100 ~ 10000レート値の初期値
volatilityint1001 ~ 20000レート値の変動の大きさ

Result

説明
itemRatingModelMaster更新したレーティングモデルマスター

実装例

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;
client = gs2('matchmaking')

api_result_handler = client.update_rating_model_master_async({
    namespaceName="namespace1",
    ratingName="mode1",
    description="description1",
    metadata=nil,
    initialValue=nil,
    volatility=50,
})

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

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

result = api_result.result
item = result.item;

deleteRatingModelMaster

レーティングモデルマスターを削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
ratingNamestring~ 128文字レーティングモデル名

Result

説明
itemRatingModelMaster削除したレーティングモデルマスター

実装例

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;
client = gs2('matchmaking')

api_result_handler = client.delete_rating_model_master_async({
    namespaceName="namespace1",
    ratingName="mode1",
})

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

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

result = api_result.result
item = result.item;

describeRatingModels

レーティングモデルの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名

Result

説明
itemsList<RatingModel>レーティングモデルのリスト

実装例

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;
client = gs2('matchmaking')

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

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

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

result = api_result.result
items = result.items;

getRatingModel

レーティングモデルを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
ratingNamestring~ 128文字レーティングモデル名

Result

説明
itemRatingModelレーティングモデル

実装例

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;
client = gs2('matchmaking')

api_result_handler = client.get_rating_model_async({
    namespaceName="namespace1",
    ratingName="mode1",
})

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

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

result = api_result.result
item = result.item;

exportMaster

現在有効なレーティングマスターのマスターデータをエクスポート

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名

Result

説明
itemCurrentModelMaster現在有効なレーティングマスター

実装例

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")
    );
    CurrentModelMaster 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;
client = gs2('matchmaking')

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

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

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

result = api_result.result
item = result.item;

getCurrentModelMaster

現在有効なレーティングマスターを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名

Result

説明
itemCurrentModelMaster現在有効なレーティングマスター

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCurrentModelMaster(
        (new GetCurrentModelMasterRequest())
            ->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.GetCurrentModelMasterRequest;
import io.gs2.matchmaking.result.GetCurrentModelMasterResult;

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

try {
    GetCurrentModelMasterResult result = client.getCurrentModelMaster(
        new GetCurrentModelMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentModelMaster 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.GetCurrentModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.GetCurrentModelMasterResult;

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.GetCurrentModelMasterResult> asyncResult = null;
yield return client.GetCurrentModelMaster(
    new Gs2.Gs2Matchmaking.Request.GetCurrentModelMasterRequest()
        .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.getCurrentModelMaster(
        new Gs2Matchmaking.GetCurrentModelMasterRequest()
            .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_model_master(
        matchmaking.GetCurrentModelMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_current_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;
client = gs2('matchmaking')

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

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

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

result = api_result.result
item = result.item;

updateCurrentModelMaster

現在有効なレーティングマスターを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
settingsstring~ 5242880文字マスターデータ

Result

説明
itemCurrentModelMaster更新した現在有効なレーティングマスター

実装例

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentModelMaster(
    &matchmaking.UpdateCurrentModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Settings: pointy.String("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150}], \"seasonModel\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateCurrentModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentModelMaster(
        (new UpdateCurrentModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSettings("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150}], \"seasonModel\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateCurrentModelMasterRequest;
import io.gs2.matchmaking.result.UpdateCurrentModelMasterResult;

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

try {
    UpdateCurrentModelMasterResult result = client.updateCurrentModelMaster(
        new UpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150}], \"seasonModel\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}")
    );
    CurrentModelMaster 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.UpdateCurrentModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.UpdateCurrentModelMasterResult;

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.UpdateCurrentModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentModelMaster(
    new Gs2.Gs2Matchmaking.Request.UpdateCurrentModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSettings("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150}], \"seasonModel\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.updateCurrentModelMaster(
        new Gs2Matchmaking.UpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150}], \"seasonModel\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.update_current_model_master(
        matchmaking.UpdateCurrentModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_settings('{"version": "2020-06-24", "ratingModels": [{"name": "rating-0001", "metadata": "RATING_0001", "volatility": 100}, {"name": "rating-0002", "metadata": "RATING_0002", "volatility": 150}], "seasonModel": [{"name": "season-0001", "maximumParticipants": 50, "challengePeriodEventId": "grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"}, {"name": "season-0002", "maximumParticipants": 100, "challengePeriodEventId": "grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002"}]}')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.update_current_model_master({
    namespaceName="namespace1",
    settings="{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150}], \"seasonModel\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}",
})

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

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

api_result_handler = client.update_current_model_master_async({
    namespaceName="namespace1",
    settings="{\"version\": \"2020-06-24\", \"ratingModels\": [{\"name\": \"rating-0001\", \"metadata\": \"RATING_0001\", \"volatility\": 100}, {\"name\": \"rating-0002\", \"metadata\": \"RATING_0002\", \"volatility\": 150}], \"seasonModel\": [{\"name\": \"season-0001\", \"maximumParticipants\": 50, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}, {\"name\": \"season-0002\", \"maximumParticipants\": 100, \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002\"}]}",
})

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

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

result = api_result.result
item = result.item;

updateCurrentModelMasterFromGitHub

現在有効なレーティングマスターを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
checkoutSettingGitHubCheckoutSettingGitHubからマスターデータをチェックアウトしてくる設定

Result

説明
itemCurrentModelMaster更新した現在有効なレーティングマスター

実装例

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentModelMasterFromGitHub(
    &matchmaking.UpdateCurrentModelMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace1"),
        CheckoutSetting: &matchmaking.GitHubCheckoutSetting{
            ApiKeyId: pointy.String("$gitHubApiKey1.apiKeyId"),
            RepositoryName: pointy.String("gs2io/master-data"),
            SourcePath: pointy.String("path/to/file.json"),
            ReferenceType: pointy.String("branch"),
            BranchName: pointy.String("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\UpdateCurrentModelMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentModelMasterFromGitHub(
        (new UpdateCurrentModelMasterFromGitHubRequest())
            ->withNamespaceName(self::namespace1)
            ->withCheckoutSetting((new GitHubCheckoutSetting())
                ->withApiKeyId(self::$gitHubApiKey1.apiKeyId)
                ->withRepositoryName("gs2io/master-data")
                ->withSourcePath("path/to/file.json")
                ->withReferenceType("branch")
                ->withBranchName("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.UpdateCurrentModelMasterFromGitHubRequest;
import io.gs2.matchmaking.result.UpdateCurrentModelMasterFromGitHubResult;

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

try {
    UpdateCurrentModelMasterFromGitHubResult result = client.updateCurrentModelMasterFromGitHub(
        new UpdateCurrentModelMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("$gitHubApiKey1.apiKeyId")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentModelMaster 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.UpdateCurrentModelMasterFromGitHubRequest;
using Gs2.Gs2Matchmaking.Result.UpdateCurrentModelMasterFromGitHubResult;

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.UpdateCurrentModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentModelMasterFromGitHub(
    new Gs2.Gs2Matchmaking.Request.UpdateCurrentModelMasterFromGitHubRequest()
        .WithNamespaceName("namespace1")
        .WithCheckoutSetting(new Gs2.Gs2Matchmaking.Model.GitHubCheckoutSetting()
            .WithApiKeyId("$gitHubApiKey1.apiKeyId")
            .WithRepositoryName("gs2io/master-data")
            .WithSourcePath("path/to/file.json")
            .WithReferenceType("branch")
            .WithBranchName("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.updateCurrentModelMasterFromGitHub(
        new Gs2Matchmaking.UpdateCurrentModelMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting(new Gs2Matchmaking.model.GitHubCheckoutSetting()
                .withApiKeyId("$gitHubApiKey1.apiKeyId")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("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_model_master_from_git_hub(
        matchmaking.UpdateCurrentModelMasterFromGitHubRequest()
            .with_namespace_name(self.hash1)
            .with_checkout_setting(matchmaking.GitHubCheckoutSetting()
                .with_api_key_id(self.git_hub_api_key1.api_key_id)
                .with_repository_name('gs2io/master-data')
                .with_source_path('path/to/file.json')
                .with_reference_type('branch')
                .with_branch_name('develop')
            )
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.update_current_model_master_from_git_hub({
    namespaceName="namespace1",
    checkoutSetting={
        api_key_id="$gitHubApiKey1.apiKeyId",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

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

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

api_result_handler = client.update_current_model_master_from_git_hub_async({
    namespaceName="namespace1",
    checkoutSetting={
        api_key_id="$gitHubApiKey1.apiKeyId",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

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

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

result = api_result.result
item = result.item;

describeSeasonModels

シーズンモデルの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名

Result

説明
itemsList<SeasonModel>シーズンモデルのリスト

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeSeasonModels(
        (new DescribeSeasonModelsRequest())
            ->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.DescribeSeasonModelsRequest;
import io.gs2.matchmaking.result.DescribeSeasonModelsResult;

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

try {
    DescribeSeasonModelsResult result = client.describeSeasonModels(
        new DescribeSeasonModelsRequest()
            .withNamespaceName("namespace1")
    );
    List<SeasonModel> 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.DescribeSeasonModelsRequest;
using Gs2.Gs2Matchmaking.Result.DescribeSeasonModelsResult;

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.DescribeSeasonModelsResult> asyncResult = null;
yield return client.DescribeSeasonModels(
    new Gs2.Gs2Matchmaking.Request.DescribeSeasonModelsRequest()
        .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.describeSeasonModels(
        new Gs2Matchmaking.DescribeSeasonModelsRequest()
            .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_season_models(
        matchmaking.DescribeSeasonModelsRequest()
            .with_namespace_name(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_season_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;
client = gs2('matchmaking')

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

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

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

result = api_result.result
items = result.items;

getSeasonModel

シーズンモデルを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
seasonNamestring~ 128文字シーズンモデル名

Result

説明
itemSeasonModelシーズンモデル

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    GetSeasonModelResult result = client.getSeasonModel(
        new GetSeasonModelRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
    );
    SeasonModel 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.GetSeasonModelRequest;
using Gs2.Gs2Matchmaking.Result.GetSeasonModelResult;

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

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

try {
    const result = await client.getSeasonModel(
        new Gs2Matchmaking.GetSeasonModelRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.get_season_model(
        matchmaking.GetSeasonModelRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('season-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_season_model({
    namespaceName="namespace1",
    seasonName="season-0001",
})

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

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

api_result_handler = client.get_season_model_async({
    namespaceName="namespace1",
    seasonName="season-0001",
})

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

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

result = api_result.result
item = result.item;

describeSeasonModelMasters

シーズンモデルマスターの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<SeasonModelMaster>シーズンモデルマスターのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeSeasonModelMasters(
        (new DescribeSeasonModelMastersRequest())
            ->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.DescribeSeasonModelMastersRequest;
import io.gs2.matchmaking.result.DescribeSeasonModelMastersResult;

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

try {
    DescribeSeasonModelMastersResult result = client.describeSeasonModelMasters(
        new DescribeSeasonModelMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SeasonModelMaster> 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.DescribeSeasonModelMastersRequest;
using Gs2.Gs2Matchmaking.Result.DescribeSeasonModelMastersResult;

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.DescribeSeasonModelMastersResult> asyncResult = null;
yield return client.DescribeSeasonModelMasters(
    new Gs2.Gs2Matchmaking.Request.DescribeSeasonModelMastersRequest()
        .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.describeSeasonModelMasters(
        new Gs2Matchmaking.DescribeSeasonModelMastersRequest()
            .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_season_model_masters(
        matchmaking.DescribeSeasonModelMastersRequest()
            .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_season_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;
client = gs2('matchmaking')

api_result_handler = client.describe_season_model_masters_async({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

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

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

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

createSeasonModelMaster

シーズンモデルマスターを新規作成

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
namestring~ 128文字シーズンモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
maximumParticipantsint2 ~ 1000最大参加人数
experienceModelIdstring~ 1024文字ティアーを保持する GS2-Experience の経験値モデル
challengePeriodEventIdstring~ 1024文字シーズンの期間を設定した GS2-Schedule イベントGRN

Result

説明
itemSeasonModelMaster作成したシーズンモデルマスター

実装例

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.CreateSeasonModelMaster(
    &matchmaking.CreateSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("season-0001"),
        Description: nil,
        Metadata: nil,
        MaximumParticipants: pointy.Int32(50),
        ExperienceModelId: nil,
        ChallengePeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\CreateSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createSeasonModelMaster(
        (new CreateSeasonModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("season-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withMaximumParticipants(50)
            ->withExperienceModelId(null)
            ->withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.CreateSeasonModelMasterRequest;
import io.gs2.matchmaking.result.CreateSeasonModelMasterResult;

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

try {
    CreateSeasonModelMasterResult result = client.createSeasonModelMaster(
        new CreateSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("season-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMaximumParticipants(50)
            .withExperienceModelId(null)
            .withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001")
    );
    SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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.CreateSeasonModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.CreateSeasonModelMasterResult;

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.CreateSeasonModelMasterResult> asyncResult = null;
yield return client.CreateSeasonModelMaster(
    new Gs2.Gs2Matchmaking.Request.CreateSeasonModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithName("season-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithMaximumParticipants(50)
        .WithExperienceModelId(null)
        .WithChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.createSeasonModelMaster(
        new Gs2Matchmaking.CreateSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("season-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMaximumParticipants(50)
            .withExperienceModelId(null)
            .withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.create_season_model_master(
        matchmaking.CreateSeasonModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('season-0001')
            .with_description(None)
            .with_metadata(None)
            .with_maximum_participants(50)
            .with_experience_model_id(None)
            .with_challenge_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.create_season_model_master({
    namespaceName="namespace1",
    name="season-0001",
    description=nil,
    metadata=nil,
    maximumParticipants=50,
    experienceModelId=nil,
    challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001",
})

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

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

api_result_handler = client.create_season_model_master_async({
    namespaceName="namespace1",
    name="season-0001",
    description=nil,
    metadata=nil,
    maximumParticipants=50,
    experienceModelId=nil,
    challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001",
})

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

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

result = api_result.result
item = result.item;

getSeasonModelMaster

シーズンモデルマスターを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
seasonNamestring~ 128文字シーズンモデル名

Result

説明
itemSeasonModelMasterシーズンモデルマスター

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    GetSeasonModelMasterResult result = client.getSeasonModelMaster(
        new GetSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
    );
    SeasonModelMaster 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.GetSeasonModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.GetSeasonModelMasterResult;

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

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

try {
    const result = await client.getSeasonModelMaster(
        new Gs2Matchmaking.GetSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.get_season_model_master(
        matchmaking.GetSeasonModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('season-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_season_model_master({
    namespaceName="namespace1",
    seasonName="season-0001",
})

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

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

api_result_handler = client.get_season_model_master_async({
    namespaceName="namespace1",
    seasonName="season-0001",
})

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

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

result = api_result.result
item = result.item;

updateSeasonModelMaster

シーズンモデルマスターを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
seasonNamestring~ 128文字シーズンモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
maximumParticipantsint2 ~ 1000最大参加人数
experienceModelIdstring~ 1024文字ティアーを保持する GS2-Experience の経験値モデル
challengePeriodEventIdstring~ 1024文字シーズンの期間を設定した GS2-Schedule イベントGRN

Result

説明
itemSeasonModelMaster更新したシーズンモデルマスター

実装例

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.UpdateSeasonModelMaster(
    &matchmaking.UpdateSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SeasonName: pointy.String("season-0001"),
        Description: pointy.String("description1"),
        Metadata: nil,
        MaximumParticipants: pointy.Int32(100),
        ExperienceModelId: nil,
        ChallengePeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\UpdateSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateSeasonModelMaster(
        (new UpdateSeasonModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSeasonName("season-0001")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withMaximumParticipants(100)
            ->withExperienceModelId(null)
            ->withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.UpdateSeasonModelMasterRequest;
import io.gs2.matchmaking.result.UpdateSeasonModelMasterResult;

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

try {
    UpdateSeasonModelMasterResult result = client.updateSeasonModelMaster(
        new UpdateSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withMaximumParticipants(100)
            .withExperienceModelId(null)
            .withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002")
    );
    SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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.UpdateSeasonModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.UpdateSeasonModelMasterResult;

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.UpdateSeasonModelMasterResult> asyncResult = null;
yield return client.UpdateSeasonModelMaster(
    new Gs2.Gs2Matchmaking.Request.UpdateSeasonModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSeasonName("season-0001")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithMaximumParticipants(100)
        .WithExperienceModelId(null)
        .WithChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.updateSeasonModelMaster(
        new Gs2Matchmaking.UpdateSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withMaximumParticipants(100)
            .withExperienceModelId(null)
            .withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.update_season_model_master(
        matchmaking.UpdateSeasonModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('season-0001')
            .with_description('description1')
            .with_metadata(None)
            .with_maximum_participants(100)
            .with_experience_model_id(None)
            .with_challenge_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.update_season_model_master({
    namespaceName="namespace1",
    seasonName="season-0001",
    description="description1",
    metadata=nil,
    maximumParticipants=100,
    experienceModelId=nil,
    challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002",
})

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

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

api_result_handler = client.update_season_model_master_async({
    namespaceName="namespace1",
    seasonName="season-0001",
    description="description1",
    metadata=nil,
    maximumParticipants=100,
    experienceModelId=nil,
    challengePeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002",
})

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

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

result = api_result.result
item = result.item;

deleteSeasonModelMaster

シーズンモデルマスターを削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
seasonNamestring~ 128文字シーズンモデル名

Result

説明
itemSeasonModelMaster削除したシーズンモデルマスター

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DeleteSeasonModelMasterResult result = client.deleteSeasonModelMaster(
        new DeleteSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
    );
    SeasonModelMaster 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.DeleteSeasonModelMasterRequest;
using Gs2.Gs2Matchmaking.Result.DeleteSeasonModelMasterResult;

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

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

try {
    const result = await client.deleteSeasonModelMaster(
        new Gs2Matchmaking.DeleteSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.delete_season_model_master(
        matchmaking.DeleteSeasonModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('season-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.delete_season_model_master({
    namespaceName="namespace1",
    seasonName="season-0001",
})

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

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

api_result_handler = client.delete_season_model_master_async({
    namespaceName="namespace1",
    seasonName="season-0001",
})

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

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

result = api_result.result
item = result.item;

describeSeasonGatherings

シーズンギャザリングの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
seasonNamestring~ 128文字シーズンモデル名
seasonlong~ 9223372036854775805シーズン
tierlong~ 9223372036854775805ティアー
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<SeasonGathering>シーズンギャザリングのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeSeasonGatheringsResult result = client.describeSeasonGatherings(
        new DescribeSeasonGatheringsRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withSeason(0L)
            .withTier(0L)
            .withPageToken(null)
            .withLimit(null)
    );
    List<SeasonGathering> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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.DescribeSeasonGatheringsRequest;
using Gs2.Gs2Matchmaking.Result.DescribeSeasonGatheringsResult;

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

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

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

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

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

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

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

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

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

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

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

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

describeMatchmakingSeasonGatherings

マッチメイキング中のシーズンギャザリングの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
seasonNamestring~ 128文字シーズンモデル名
seasonlong~ 9223372036854775805シーズン
tierlong~ 9223372036854775805ティアー
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<SeasonGathering>シーズンギャザリングのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeMatchmakingSeasonGatheringsResult result = client.describeMatchmakingSeasonGatherings(
        new DescribeMatchmakingSeasonGatheringsRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withSeason(0L)
            .withTier(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<SeasonGathering> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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.DescribeMatchmakingSeasonGatheringsRequest;
using Gs2.Gs2Matchmaking.Result.DescribeMatchmakingSeasonGatheringsResult;

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

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

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

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

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

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

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

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

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

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

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

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

doSeasonMatchmaking

自分が参加できるシーズンギャザリングを探して参加する

一定時間 検索を行い、対象が見つからなかったときには マッチメイキングの状態を保持するトークン を返す。
次回 マッチメイキングの状態を保持するトークン をつけて再度リクエストを出すことで、前回の続きから検索処理を再開できる。
すべてのシーズンギャザリングを検索したが、参加できるシーズンギャザリングが存在しなかった場合はシーズンギャザリングもトークンもどちらも null が応答される。

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
seasonNamestring~ 128文字シーズンモデル名
accessTokenstring~ 128文字ユーザーID
matchmakingContextTokenstring~ 5120文字検索の再開に使用する マッチメイキングの状態を保持するトークン

Result

説明
itemSeasonGathering参加したシーズンギャザリング
matchmakingContextTokenstringマッチメイキングの状態を保持するトークン

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DoSeasonMatchmakingResult result = client.doSeasonMatchmaking(
        new DoSeasonMatchmakingRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withAccessToken("accessToken-0001")
            .withMatchmakingContextToken(null)
    );
    SeasonGathering item = result.getItem();
    String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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.DoSeasonMatchmakingRequest;
using Gs2.Gs2Matchmaking.Result.DoSeasonMatchmakingResult;

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

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

try {
    const result = await client.doSeasonMatchmaking(
        new Gs2Matchmaking.DoSeasonMatchmakingRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withAccessToken("accessToken-0001")
            .withMatchmakingContextToken(null)
    );
    const item = result.getItem();
    const matchmakingContextToken = result.getMatchmakingContextToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.do_season_matchmaking(
        matchmaking.DoSeasonMatchmakingRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('season-0001')
            .with_access_token(self.access_token_0001)
            .with_matchmaking_context_token(None)
    )
    item = result.item
    matchmaking_context_token = result.matchmaking_context_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.do_season_matchmaking({
    namespaceName="namespace1",
    seasonName="season-0001",
    accessToken="accessToken-0001",
    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;
client = gs2('matchmaking')

api_result_handler = client.do_season_matchmaking_async({
    namespaceName="namespace1",
    seasonName="season-0001",
    accessToken="accessToken-0001",
    matchmakingContextToken=nil,
})

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

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

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

doSeasonMatchmakingByUserId

自分が参加できるシーズンギャザリングを探して参加する

一定時間 検索を行い、対象が見つからなかったときには マッチメイキングの状態を保持するトークン を返す。
次回 マッチメイキングの状態を保持するトークン をつけて再度リクエストを出すことで、前回の続きから検索処理を再開できる。
すべてのシーズンギャザリングを検索したが、参加できるシーズンギャザリングが存在しなかった場合はシーズンギャザリングもトークンもどちらも null が応答される。

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
seasonNamestring~ 128文字シーズンモデル名
userIdstring~ 128文字ユーザーID
matchmakingContextTokenstring~ 5120文字検索の再開に使用する マッチメイキングの状態を保持するトークン
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemSeasonGathering参加したシーズンギャザリング
matchmakingContextTokenstringマッチメイキングの状態を保持するトークン

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DoSeasonMatchmakingByUserIdResult result = client.doSeasonMatchmakingByUserId(
        new DoSeasonMatchmakingByUserIdRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withUserId("user-0001")
            .withMatchmakingContextToken(null)
            .withTimeOffsetToken(null)
    );
    SeasonGathering item = result.getItem();
    String matchmakingContextToken = result.getMatchmakingContextToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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.DoSeasonMatchmakingByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.DoSeasonMatchmakingByUserIdResult;

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

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

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

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

try:
    result = client.do_season_matchmaking_by_user_id(
        matchmaking.DoSeasonMatchmakingByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('season-0001')
            .with_user_id('user-0001')
            .with_matchmaking_context_token(None)
            .with_time_offset_token(None)
    )
    item = result.item
    matchmaking_context_token = result.matchmaking_context_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.do_season_matchmaking_by_user_id({
    namespaceName="namespace1",
    seasonName="season-0001",
    userId="user-0001",
    matchmakingContextToken=nil,
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.do_season_matchmaking_by_user_id_async({
    namespaceName="namespace1",
    seasonName="season-0001",
    userId="user-0001",
    matchmakingContextToken=nil,
    timeOffsetToken=nil,
})

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

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

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

getSeasonGathering

シーズンギャザリングを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
seasonNamestring~ 128文字シーズンモデル名
seasonlong~ 9223372036854775805シーズン
tierlong~ 9223372036854775805ティアー
seasonGatheringNamestringUUID~ 128文字ギャザリング名

Result

説明
itemSeasonGatheringシーズンギャザリング

実装例

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetSeasonGathering(
    &matchmaking.GetSeasonGatheringRequest {
        NamespaceName: pointy.String("namespace1"),
        SeasonName: pointy.String("season-0001"),
        Season: pointy.Int64(0),
        Tier: pointy.Int64(0),
        SeasonGatheringName: pointy.String("gathering-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetSeasonGatheringRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSeasonGathering(
        (new GetSeasonGatheringRequest())
            ->withNamespaceName(self::namespace1)
            ->withSeasonName("season-0001")
            ->withSeason(0)
            ->withTier(0)
            ->withSeasonGatheringName("gathering-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetSeasonGatheringRequest;
import io.gs2.matchmaking.result.GetSeasonGatheringResult;

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

try {
    GetSeasonGatheringResult result = client.getSeasonGathering(
        new GetSeasonGatheringRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withSeason(0L)
            .withTier(0L)
            .withSeasonGatheringName("gathering-0001")
    );
    SeasonGathering 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.GetSeasonGatheringRequest;
using Gs2.Gs2Matchmaking.Result.GetSeasonGatheringResult;

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.GetSeasonGatheringResult> asyncResult = null;
yield return client.GetSeasonGathering(
    new Gs2.Gs2Matchmaking.Request.GetSeasonGatheringRequest()
        .WithNamespaceName("namespace1")
        .WithSeasonName("season-0001")
        .WithSeason(0L)
        .WithTier(0L)
        .WithSeasonGatheringName("gathering-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.getSeasonGathering(
        new Gs2Matchmaking.GetSeasonGatheringRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withSeason(0)
            .withTier(0)
            .withSeasonGatheringName("gathering-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.get_season_gathering(
        matchmaking.GetSeasonGatheringRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('season-0001')
            .with_season(0)
            .with_tier(0)
            .with_season_gathering_name('gathering-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_season_gathering({
    namespaceName="namespace1",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName="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;
client = gs2('matchmaking')

api_result_handler = client.get_season_gathering_async({
    namespaceName="namespace1",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName="gathering-0001",
})

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

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

result = api_result.result
item = result.item;

verifyIncludeParticipant

永続ギャザリングにユーザーIDが含まれているかを検証

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
seasonNamestring~ 128文字シーズンモデル名
seasonlong~ 9223372036854775805シーズン
tierlong~ 9223372036854775805ティアー
seasonGatheringNamestringUUID~ 128文字ギャザリング名
accessTokenstring~ 128文字ユーザーID
verifyTypeenum {
    “include”,
    “notInclude”
}
~ 128文字検証の種類

verifyType に指定する列挙型の定義

定義説明
includeシーズンギャザリングに指定したユーザーが含まれていること
notIncludeシーズンギャザリングに指定したユーザーが含まれないこと

Result

説明

実装例

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.VerifyIncludeParticipant(
    &matchmaking.VerifyIncludeParticipantRequest {
        NamespaceName: pointy.String("namespace1"),
        SeasonName: pointy.String("season-0001"),
        Season: pointy.Int64(0),
        Tier: pointy.Int64(0),
        SeasonGatheringName: nil,
        AccessToken: pointy.String("accessToken-0001"),
        VerifyType: pointy.String("include"),
    }
)
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\VerifyIncludeParticipantRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyIncludeParticipant(
        (new VerifyIncludeParticipantRequest())
            ->withNamespaceName(self::namespace1)
            ->withSeasonName("season-0001")
            ->withSeason(0)
            ->withTier(0)
            ->withSeasonGatheringName(null)
            ->withAccessToken(self::$accessToken0001)
            ->withVerifyType("include")
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.VerifyIncludeParticipantRequest;
import io.gs2.matchmaking.result.VerifyIncludeParticipantResult;

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

try {
    VerifyIncludeParticipantResult result = client.verifyIncludeParticipant(
        new VerifyIncludeParticipantRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withSeason(0L)
            .withTier(0L)
            .withSeasonGatheringName(null)
            .withAccessToken("accessToken-0001")
            .withVerifyType("include")
    );
} 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.VerifyIncludeParticipantRequest;
using Gs2.Gs2Matchmaking.Result.VerifyIncludeParticipantResult;

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.VerifyIncludeParticipantResult> asyncResult = null;
yield return client.VerifyIncludeParticipant(
    new Gs2.Gs2Matchmaking.Request.VerifyIncludeParticipantRequest()
        .WithNamespaceName("namespace1")
        .WithSeasonName("season-0001")
        .WithSeason(0L)
        .WithTier(0L)
        .WithSeasonGatheringName(null)
        .WithAccessToken("accessToken-0001")
        .WithVerifyType("include"),
    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.verifyIncludeParticipant(
        new Gs2Matchmaking.VerifyIncludeParticipantRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withSeason(0)
            .withTier(0)
            .withSeasonGatheringName(null)
            .withAccessToken("accessToken-0001")
            .withVerifyType("include")
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.verify_include_participant(
        matchmaking.VerifyIncludeParticipantRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('season-0001')
            .with_season(0)
            .with_tier(0)
            .with_season_gathering_name(None)
            .with_access_token(self.access_token_0001)
            .with_verify_type('include')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.verify_include_participant({
    namespaceName="namespace1",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName=nil,
    accessToken="accessToken-0001",
    verifyType="include",
})

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

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

api_result_handler = client.verify_include_participant_async({
    namespaceName="namespace1",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName=nil,
    accessToken="accessToken-0001",
    verifyType="include",
})

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

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

result = api_result.result

verifyIncludeParticipantByUserId

ユーザーIDを指定して永続ギャザリングにユーザーIDが含まれているかを検証

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
seasonNamestring~ 128文字シーズンモデル名
seasonlong~ 9223372036854775805シーズン
tierlong~ 9223372036854775805ティアー
seasonGatheringNamestringUUID~ 128文字ギャザリング名
userIdstring~ 128文字ユーザーID
verifyTypeenum {
    “include”,
    “notInclude”
}
~ 128文字検証の種類
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

verifyType に指定する列挙型の定義

定義説明
includeシーズンギャザリングに指定したユーザーが含まれていること
notIncludeシーズンギャザリングに指定したユーザーが含まれないこと

Result

説明

実装例

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.VerifyIncludeParticipantByUserId(
    &matchmaking.VerifyIncludeParticipantByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        SeasonName: pointy.String("season-0001"),
        Season: pointy.Int64(0),
        Tier: pointy.Int64(0),
        SeasonGatheringName: nil,
        UserId: pointy.String("user-0001"),
        VerifyType: pointy.String("include"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\VerifyIncludeParticipantByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyIncludeParticipantByUserId(
        (new VerifyIncludeParticipantByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withSeasonName("season-0001")
            ->withSeason(0)
            ->withTier(0)
            ->withSeasonGatheringName(null)
            ->withUserId("user-0001")
            ->withVerifyType("include")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.VerifyIncludeParticipantByUserIdRequest;
import io.gs2.matchmaking.result.VerifyIncludeParticipantByUserIdResult;

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

try {
    VerifyIncludeParticipantByUserIdResult result = client.verifyIncludeParticipantByUserId(
        new VerifyIncludeParticipantByUserIdRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withSeason(0L)
            .withTier(0L)
            .withSeasonGatheringName(null)
            .withUserId("user-0001")
            .withVerifyType("include")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Matchmaking.Gs2MatchmakingRestClient;
using Gs2.Gs2Matchmaking.Request.VerifyIncludeParticipantByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.VerifyIncludeParticipantByUserIdResult;

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.VerifyIncludeParticipantByUserIdResult> asyncResult = null;
yield return client.VerifyIncludeParticipantByUserId(
    new Gs2.Gs2Matchmaking.Request.VerifyIncludeParticipantByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithSeasonName("season-0001")
        .WithSeason(0L)
        .WithTier(0L)
        .WithSeasonGatheringName(null)
        .WithUserId("user-0001")
        .WithVerifyType("include")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.verifyIncludeParticipantByUserId(
        new Gs2Matchmaking.VerifyIncludeParticipantByUserIdRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withSeason(0)
            .withTier(0)
            .withSeasonGatheringName(null)
            .withUserId("user-0001")
            .withVerifyType("include")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.verify_include_participant_by_user_id(
        matchmaking.VerifyIncludeParticipantByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('season-0001')
            .with_season(0)
            .with_tier(0)
            .with_season_gathering_name(None)
            .with_user_id('user-0001')
            .with_verify_type('include')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.verify_include_participant_by_user_id({
    namespaceName="namespace1",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName=nil,
    userId="user-0001",
    verifyType="include",
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.verify_include_participant_by_user_id_async({
    namespaceName="namespace1",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName=nil,
    userId="user-0001",
    verifyType="include",
    timeOffsetToken=nil,
})

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

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

result = api_result.result

deleteSeasonGathering

シーズンギャザリングを削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
seasonNamestring~ 128文字シーズンモデル名
seasonlong~ 9223372036854775805シーズン
tierlong~ 9223372036854775805ティアー
seasonGatheringNamestringUUID~ 128文字ギャザリング名

Result

説明
itemSeasonGathering削除したシーズンギャザリング

実装例

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.DeleteSeasonGathering(
    &matchmaking.DeleteSeasonGatheringRequest {
        NamespaceName: pointy.String("namespace1"),
        SeasonName: pointy.String("season-0001"),
        Season: pointy.Int64(0),
        Tier: pointy.Int64(0),
        SeasonGatheringName: pointy.String("gathering-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DeleteSeasonGatheringRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteSeasonGathering(
        (new DeleteSeasonGatheringRequest())
            ->withNamespaceName(self::namespace1)
            ->withSeasonName("season-0001")
            ->withSeason(0)
            ->withTier(0)
            ->withSeasonGatheringName("gathering-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DeleteSeasonGatheringRequest;
import io.gs2.matchmaking.result.DeleteSeasonGatheringResult;

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

try {
    DeleteSeasonGatheringResult result = client.deleteSeasonGathering(
        new DeleteSeasonGatheringRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withSeason(0L)
            .withTier(0L)
            .withSeasonGatheringName("gathering-0001")
    );
    SeasonGathering 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.DeleteSeasonGatheringRequest;
using Gs2.Gs2Matchmaking.Result.DeleteSeasonGatheringResult;

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.DeleteSeasonGatheringResult> asyncResult = null;
yield return client.DeleteSeasonGathering(
    new Gs2.Gs2Matchmaking.Request.DeleteSeasonGatheringRequest()
        .WithNamespaceName("namespace1")
        .WithSeasonName("season-0001")
        .WithSeason(0L)
        .WithTier(0L)
        .WithSeasonGatheringName("gathering-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.deleteSeasonGathering(
        new Gs2Matchmaking.DeleteSeasonGatheringRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("season-0001")
            .withSeason(0)
            .withTier(0)
            .withSeasonGatheringName("gathering-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.delete_season_gathering(
        matchmaking.DeleteSeasonGatheringRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('season-0001')
            .with_season(0)
            .with_tier(0)
            .with_season_gathering_name('gathering-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.delete_season_gathering({
    namespaceName="namespace1",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName="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;
client = gs2('matchmaking')

api_result_handler = client.delete_season_gathering_async({
    namespaceName="namespace1",
    seasonName="season-0001",
    season=0,
    tier=0,
    seasonGatheringName="gathering-0001",
})

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

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

result = api_result.result
item = result.item;

verifyIncludeParticipantByStampTask

検証アクションとして永続ギャザリングにユーザーIDが含まれているかの検証を実行

Request

有効化条件必須デフォルト値の制限説明
stampTaskstring~ 5242880文字検証アクション
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
newContextStackstring検証アクションの実行結果を記録したコンテキスト

実装例

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.VerifyIncludeParticipantByStampTask(
    &matchmaking.VerifyIncludeParticipantByStampTaskRequest {
        StampTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
newContextStack := result.NewContextStack
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\VerifyIncludeParticipantByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyIncludeParticipantByStampTask(
        (new VerifyIncludeParticipantByStampTaskRequest())
            ->withStampTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $newContextStack = $result->getNewContextStack();
} 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.VerifyIncludeParticipantByStampTaskRequest;
import io.gs2.matchmaking.result.VerifyIncludeParticipantByStampTaskResult;

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

try {
    VerifyIncludeParticipantByStampTaskResult result = client.verifyIncludeParticipantByStampTask(
        new VerifyIncludeParticipantByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    String newContextStack = result.getNewContextStack();
} 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.VerifyIncludeParticipantByStampTaskRequest;
using Gs2.Gs2Matchmaking.Result.VerifyIncludeParticipantByStampTaskResult;

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.VerifyIncludeParticipantByStampTaskResult> asyncResult = null;
yield return client.VerifyIncludeParticipantByStampTask(
    new Gs2.Gs2Matchmaking.Request.VerifyIncludeParticipantByStampTaskRequest()
        .WithStampTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.verifyIncludeParticipantByStampTask(
        new Gs2Matchmaking.VerifyIncludeParticipantByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    const newContextStack = result.getNewContextStack();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.verify_include_participant_by_stamp_task(
        matchmaking.VerifyIncludeParticipantByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.verify_include_participant_by_stamp_task({
    stampTask="stampTask",
    keyId="key-0001",
})

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

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

api_result_handler = client.verify_include_participant_by_stamp_task_async({
    stampTask="stampTask",
    keyId="key-0001",
})

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

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

result = api_result.result
newContextStack = result.newContextStack;

describeJoinedSeasonGatherings

シーズンギャザリングの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字ユーザーID
seasonNamestring~ 128文字シーズンモデル名
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<JoinedSeasonGathering>シーズンギャザリングのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeJoinedSeasonGatheringsResult result = client.describeJoinedSeasonGatherings(
        new DescribeJoinedSeasonGatheringsRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withSeasonName("season-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<JoinedSeasonGathering> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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.DescribeJoinedSeasonGatheringsRequest;
using Gs2.Gs2Matchmaking.Result.DescribeJoinedSeasonGatheringsResult;

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

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

try {
    const result = await client.describeJoinedSeasonGatherings(
        new Gs2Matchmaking.DescribeJoinedSeasonGatheringsRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withSeasonName("season-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.describe_joined_season_gatherings(
        matchmaking.DescribeJoinedSeasonGatheringsRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_season_name('season-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_joined_season_gatherings({
    namespaceName="namespace1",
    accessToken="accessToken-0001",
    seasonName="season-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;
client = gs2('matchmaking')

api_result_handler = client.describe_joined_season_gatherings_async({
    namespaceName="namespace1",
    accessToken="accessToken-0001",
    seasonName="season-0001",
    pageToken=nil,
    limit=nil,
})

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

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

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

describeJoinedSeasonGatheringsByUserId

ユーザーIDを指定してシーズンギャザリングの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
seasonNamestring~ 128文字シーズンモデル名
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemsList<JoinedSeasonGathering>シーズンギャザリングのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeJoinedSeasonGatheringsByUserIdResult result = client.describeJoinedSeasonGatheringsByUserId(
        new DescribeJoinedSeasonGatheringsByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId(null)
            .withSeasonName("season-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<JoinedSeasonGathering> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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.DescribeJoinedSeasonGatheringsByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.DescribeJoinedSeasonGatheringsByUserIdResult;

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

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

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

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

try:
    result = client.describe_joined_season_gatherings_by_user_id(
        matchmaking.DescribeJoinedSeasonGatheringsByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(None)
            .with_season_name('season-0001')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_joined_season_gatherings_by_user_id({
    namespaceName="namespace1",
    userId=nil,
    seasonName="season-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.describe_joined_season_gatherings_by_user_id_async({
    namespaceName="namespace1",
    userId=nil,
    seasonName="season-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

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

getJoinedSeasonGathering

シーズンギャザリングを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字ユーザーID
seasonNamestring~ 128文字シーズンモデル名
seasonlong~ 9223372036854775805シーズン

Result

説明
itemJoinedSeasonGatheringシーズンギャザリング

実装例

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

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

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

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getJoinedSeasonGathering(
        (new GetJoinedSeasonGatheringRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withSeasonName("season-0001")
            ->withSeason(0)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetJoinedSeasonGatheringRequest;
import io.gs2.matchmaking.result.GetJoinedSeasonGatheringResult;

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

try {
    GetJoinedSeasonGatheringResult result = client.getJoinedSeasonGathering(
        new GetJoinedSeasonGatheringRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withSeasonName("season-0001")
            .withSeason(0L)
    );
    JoinedSeasonGathering 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.GetJoinedSeasonGatheringRequest;
using Gs2.Gs2Matchmaking.Result.GetJoinedSeasonGatheringResult;

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.GetJoinedSeasonGatheringResult> asyncResult = null;
yield return client.GetJoinedSeasonGathering(
    new Gs2.Gs2Matchmaking.Request.GetJoinedSeasonGatheringRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("accessToken-0001")
        .WithSeasonName("season-0001")
        .WithSeason(0L),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.getJoinedSeasonGathering(
        new Gs2Matchmaking.GetJoinedSeasonGatheringRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withSeasonName("season-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.get_joined_season_gathering(
        matchmaking.GetJoinedSeasonGatheringRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_season_name('season-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_joined_season_gathering({
    namespaceName="namespace1",
    accessToken="accessToken-0001",
    seasonName="season-0001",
    season=0,
})

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

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

api_result_handler = client.get_joined_season_gathering_async({
    namespaceName="namespace1",
    accessToken="accessToken-0001",
    seasonName="season-0001",
    season=0,
})

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

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

result = api_result.result
item = result.item;

getJoinedSeasonGatheringByUserId

ユーザーIDを指定してシーズンギャザリングを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
seasonNamestring~ 128文字シーズンモデル名
seasonlong~ 9223372036854775805シーズン
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemJoinedSeasonGatheringシーズンギャザリング

実装例

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

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

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

client := matchmaking.Gs2MatchmakingRestClient{
    Session: &session,
}
result, err := client.GetJoinedSeasonGatheringByUserId(
    &matchmaking.GetJoinedSeasonGatheringByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: nil,
        SeasonName: pointy.String("season-0001"),
        Season: pointy.Int64(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetJoinedSeasonGatheringByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getJoinedSeasonGatheringByUserId(
        (new GetJoinedSeasonGatheringByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId(null)
            ->withSeasonName("season-0001")
            ->withSeason(0)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetJoinedSeasonGatheringByUserIdRequest;
import io.gs2.matchmaking.result.GetJoinedSeasonGatheringByUserIdResult;

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

try {
    GetJoinedSeasonGatheringByUserIdResult result = client.getJoinedSeasonGatheringByUserId(
        new GetJoinedSeasonGatheringByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId(null)
            .withSeasonName("season-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    JoinedSeasonGathering 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.GetJoinedSeasonGatheringByUserIdRequest;
using Gs2.Gs2Matchmaking.Result.GetJoinedSeasonGatheringByUserIdResult;

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.GetJoinedSeasonGatheringByUserIdResult> asyncResult = null;
yield return client.GetJoinedSeasonGatheringByUserId(
    new Gs2.Gs2Matchmaking.Request.GetJoinedSeasonGatheringByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId(null)
        .WithSeasonName("season-0001")
        .WithSeason(0L)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

try {
    const result = await client.getJoinedSeasonGatheringByUserId(
        new Gs2Matchmaking.GetJoinedSeasonGatheringByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId(null)
            .withSeasonName("season-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

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

try:
    result = client.get_joined_season_gathering_by_user_id(
        matchmaking.GetJoinedSeasonGatheringByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(None)
            .with_season_name('season-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_joined_season_gathering_by_user_id({
    namespaceName="namespace1",
    userId=nil,
    seasonName="season-0001",
    season=0,
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.get_joined_season_gathering_by_user_id_async({
    namespaceName="namespace1",
    userId=nil,
    seasonName="season-0001",
    season=0,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

describeRatings

レーティングの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字ユーザーID
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<Rating>レーティングのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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("accessToken-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeRatingsRequest;

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

$session->open();

$client = new 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("accessToken-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("accessToken-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

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

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

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

try:
    result = client.describe_ratings(
        matchmaking.DescribeRatingsRequest()
            .with_namespace_name(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="accessToken-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;
client = gs2('matchmaking')

api_result_handler = client.describe_ratings_async({
    namespaceName="namespace1",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

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

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

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

describeRatingsByUserId

ユーザIDを指定してレーティングの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemsList<Rating>レーティングのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DescribeRatingsByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DescribeRatingsByUserIdResult result = client.describeRatingsByUserId(
        new DescribeRatingsByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Rating> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.describeRatingsByUserId(
        new Gs2Matchmaking.DescribeRatingsByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.describe_ratings_by_user_id(
        matchmaking.DescribeRatingsByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.describe_ratings_by_user_id({
    namespaceName="namespace1",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('matchmaking')

api_result_handler = client.describe_ratings_by_user_id_async({
    namespaceName="namespace1",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

getRating

レーティングを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字ユーザーID
ratingNamestring~ 128文字レーティング名

Result

説明
itemRatingレーティング

実装例

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("accessToken-0001"),
        RatingName: pointy.String("rating-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetRatingRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new 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("accessToken-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("accessToken-0001")
        .WithRatingName("rating-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getRating(
        new Gs2Matchmaking.GetRatingRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withRatingName("rating-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_rating(
        matchmaking.GetRatingRequest()
            .with_namespace_name(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="accessToken-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;
client = gs2('matchmaking')

api_result_handler = client.get_rating_async({
    namespaceName="namespace1",
    accessToken="accessToken-0001",
    ratingName="rating-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getRatingByUserId

ユーザーIDを指定してレーティングを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
ratingNamestring~ 128文字レーティング名
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemRatingレーティング

実装例

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"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetRatingByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getRatingByUserId(
        (new GetRatingByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withRatingName("rating-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetRatingByUserIdRequest;
import io.gs2.matchmaking.result.GetRatingByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetRatingByUserIdResult result = client.getRatingByUserId(
        new GetRatingByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withRatingName("rating-0001")
            .withTimeOffsetToken(null)
    );
    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")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getRatingByUserId(
        new Gs2Matchmaking.GetRatingByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withRatingName("rating-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_rating_by_user_id(
        matchmaking.GetRatingByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_rating_name('rating-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_rating_by_user_id({
    namespaceName="namespace1",
    userId="user-0001",
    ratingName="rating-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.get_rating_by_user_id_async({
    namespaceName="namespace1",
    userId="user-0001",
    ratingName="rating-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

putResult

レーティング値の再計算を実行

レーティングの計算処理には Glicko-2 rating system をベースとした計算アルゴリズムを採用しています。
レーティング値の初期値は1500で、レーティングの値が離れた相手に勝利するほど上昇幅は大きく、同じく負けた側は減少幅は大きくなります。

レーティングの計算には参加したユーザIDのリストが必要となります。
そのため、クライアントから直接このAPIを呼び出すのは適切ではありません。ゲームの勝敗を判断できるゲームサーバから呼び出すようにしてください。
P2P 対戦など、クライアント主導で対戦を実現している場合は、投票機能を利用して勝敗を決定するようにしてください。

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
ratingNamestring~ 128文字レーティング名
gameResultsList<GameResult>~ 10 items対戦結果

Result

説明
itemsList<Rating>更新後のレーティングの一覧

実装例

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{
            matchmaking.GameResult{
                Rank: pointy.Int32(1),
                UserId: pointy.String("user-0001"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0002"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0003"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(3),
                UserId: pointy.String("user-0004"),
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\PutResultRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->putResult(
        (new PutResultRequest())
            ->withNamespaceName(self::namespace1)
            ->withRatingName("rating-0001")
            ->withGameResults([
                (new GameResult())
                    ->withRank(1)
                    ->withUserId("user-0001"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0002"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0003"),
                (new GameResult())
                    ->withRank(3)
                    ->withUserId("user-0004"),
            ])
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.PutResultRequest;
import io.gs2.matchmaking.result.PutResultResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    PutResultResult result = client.putResult(
        new PutResultRequest()
            .withNamespaceName("namespace1")
            .withRatingName("rating-0001")
            .withGameResults(Arrays.asList(
                new GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new GameResult()
                    .withRank(3)
                    .withUserId("user-0004")
            ))
    );
    List<Rating> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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[] {
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(1)
                .WithUserId("user-0001"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0002"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0003"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(3)
                .WithUserId("user-0004"),
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.putResult(
        new Gs2Matchmaking.PutResultRequest()
            .withNamespaceName("namespace1")
            .withRatingName("rating-0001")
            .withGameResults([
                new Gs2Matchmaking.model.GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(3)
                    .withUserId("user-0004"),
            ])
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.put_result(
        matchmaking.PutResultRequest()
            .with_namespace_name(self.hash1)
            .with_rating_name('rating-0001')
            .with_game_results([
                matchmaking.GameResult()
                    .with_rank(1)
                    .with_user_id('user-0001'),
                matchmaking.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0002'),
                matchmaking.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0003'),
                matchmaking.GameResult()
                    .with_rank(3)
                    .with_user_id('user-0004'),
            ])
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.put_result({
    namespaceName="namespace1",
    ratingName="rating-0001",
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
client = gs2('matchmaking')

api_result_handler = client.put_result_async({
    namespaceName="namespace1",
    ratingName="rating-0001",
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;

deleteRating

レーティングを削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
ratingNamestring~ 128文字レーティング名
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemRating削除されたレーティング

実装例

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"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\DeleteRatingRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteRating(
        (new DeleteRatingRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withRatingName("rating-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.DeleteRatingRequest;
import io.gs2.matchmaking.result.DeleteRatingResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    DeleteRatingResult result = client.deleteRating(
        new DeleteRatingRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withRatingName("rating-0001")
            .withTimeOffsetToken(null)
    );
    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")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.deleteRating(
        new Gs2Matchmaking.DeleteRatingRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withRatingName("rating-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.delete_rating(
        matchmaking.DeleteRatingRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_rating_name('rating-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.delete_rating({
    namespaceName="namespace1",
    userId="user-0001",
    ratingName="rating-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.delete_rating_async({
    namespaceName="namespace1",
    userId="user-0001",
    ratingName="rating-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getBallot

署名と共に投票用紙を作成

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
ratingNamestring~ 128文字レーティングモデル名
gatheringNamestringUUID~ 128文字ギャザリング名
accessTokenstring~ 128文字ユーザーID
numberOfPlayerint2 ~ 10参加人数
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024文字暗号鍵GRN

Result

説明
itemBallot投票用紙
bodystring署名対象のデータ
signaturestring署名データ

実装例

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("accessToken-0001"),
        NumberOfPlayer: pointy.Int32(4),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetBallotRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getBallot(
        (new GetBallotRequest())
            ->withNamespaceName(self::namespace1)
            ->withRatingName("rating-0001")
            ->withGatheringName("gathering-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withNumberOfPlayer(4)
            ->withKeyId(self::key-0001)
    );
    $item = $result->getItem();
    $body = $result->getBody();
    $signature = $result->getSignature();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetBallotRequest;
import io.gs2.matchmaking.result.GetBallotResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetBallotResult result = client.getBallot(
        new GetBallotRequest()
            .withNamespaceName("namespace1")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
            .withAccessToken("accessToken-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
    );
    Ballot item = result.getItem();
    String body = result.getBody();
    String signature = result.getSignature();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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("accessToken-0001")
        .WithNumberOfPlayer(4)
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getBallot(
        new Gs2Matchmaking.GetBallotRequest()
            .withNamespaceName("namespace1")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
            .withAccessToken("accessToken-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
    );
    const item = result.getItem();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_ballot(
        matchmaking.GetBallotRequest()
            .with_namespace_name(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="accessToken-0001",
    numberOfPlayer=4,
    keyId="key-0001",
})

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;
client = gs2('matchmaking')

api_result_handler = client.get_ballot_async({
    namespaceName="namespace1",
    ratingName="rating-0001",
    gatheringName="gathering-0001",
    accessToken="accessToken-0001",
    numberOfPlayer=4,
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;

getBallotByUserId

ユーザーIDを指定して署名と共に投票用紙を作成

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
ratingNamestring~ 128文字レーティングモデル名
gatheringNamestringUUID~ 128文字ギャザリング名
userIdstring~ 128文字ユーザーID
numberOfPlayerint2 ~ 10参加人数
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024文字暗号鍵GRN
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemBallot投票用紙
bodystring署名対象のデータ
signaturestring署名データ

実装例

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("key-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\GetBallotByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getBallotByUserId(
        (new GetBallotByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withRatingName("rating-0001")
            ->withGatheringName("gathering-0001")
            ->withUserId("user-0001")
            ->withNumberOfPlayer(4)
            ->withKeyId(self::key-0001)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $body = $result->getBody();
    $signature = $result->getSignature();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.GetBallotByUserIdRequest;
import io.gs2.matchmaking.result.GetBallotByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    GetBallotByUserIdResult result = client.getBallotByUserId(
        new GetBallotByUserIdRequest()
            .withNamespaceName("namespace1")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
            .withTimeOffsetToken(null)
    );
    Ballot item = result.getItem();
    String body = result.getBody();
    String signature = result.getSignature();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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("key-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.getBallotByUserId(
        new Gs2Matchmaking.GetBallotByUserIdRequest()
            .withNamespaceName("namespace1")
            .withRatingName("rating-0001")
            .withGatheringName("gathering-0001")
            .withUserId("user-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.get_ballot_by_user_id(
        matchmaking.GetBallotByUserIdRequest()
            .with_namespace_name(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)
            .with_time_offset_token(None)
    )
    item = result.item
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)
client = gs2('matchmaking')

api_result = client.get_ballot_by_user_id({
    namespaceName="namespace1",
    ratingName="rating-0001",
    gatheringName="gathering-0001",
    userId="user-0001",
    numberOfPlayer=4,
    keyId="key-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;
client = gs2('matchmaking')

api_result_handler = client.get_ballot_by_user_id_async({
    namespaceName="namespace1",
    ratingName="rating-0001",
    gatheringName="gathering-0001",
    userId="user-0001",
    numberOfPlayer=4,
    keyId="key-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;

vote

対戦結果を投票します。

投票は最初の投票が行われてから5分以内に行う必要があります。
つまり、結果は即座に反映されず、投票開始からおよそ5分後または全てのプレイヤーが投票を行った際に結果が反映されます。
5分以内に全ての投票用紙を回収できなかった場合はその時点の投票内容で多数決をとって結果を決定します。
各結果の投票数が同一だった場合は結果は捨てられます(スクリプトで挙動を変更可)。

結果を即座に反映したい場合は、勝利した側の代表プレイヤーが投票用紙を各プレイヤーから集めて voteMultiple を呼び出すことで結果を即座に反映できます。

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
ballotBodystring~ 1024文字投票用紙の署名対象のデータ
ballotSignaturestring~ 256文字投票用紙の署名
gameResultsList<GameResult>~ 10 items投票内容。対戦を行ったプレイヤーグループ1に所属するユーザIDのリスト
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024文字暗号鍵GRN

Result

説明
itemBallot投票用紙

実装例

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{
            matchmaking.GameResult{
                Rank: pointy.Int32(1),
                UserId: pointy.String("user-0001"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0002"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0003"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(3),
                UserId: pointy.String("user-0004"),
            },
        },
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\VoteRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->vote(
        (new VoteRequest())
            ->withNamespaceName(self::namespace1)
            ->withBallotBody(self::ballotBody)
            ->withBallotSignature(self::ballotSignature)
            ->withGameResults([
                (new GameResult())
                    ->withRank(1)
                    ->withUserId("user-0001"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0002"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0003"),
                (new GameResult())
                    ->withRank(3)
                    ->withUserId("user-0004"),
            ])
            ->withKeyId(self::key-0001)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.VoteRequest;
import io.gs2.matchmaking.result.VoteResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    VoteResult result = client.vote(
        new VoteRequest()
            .withNamespaceName("namespace1")
            .withBallotBody("ballotBody")
            .withBallotSignature("ballotSignature")
            .withGameResults(Arrays.asList(
                new GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new GameResult()
                    .withRank(3)
                    .withUserId("user-0004")
            ))
            .withKeyId("key-0001")
    );
    Ballot item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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[] {
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(1)
                .WithUserId("user-0001"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0002"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0003"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(3)
                .WithUserId("user-0004"),
        })
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.vote(
        new Gs2Matchmaking.VoteRequest()
            .withNamespaceName("namespace1")
            .withBallotBody("ballotBody")
            .withBallotSignature("ballotSignature")
            .withGameResults([
                new Gs2Matchmaking.model.GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(3)
                    .withUserId("user-0004"),
            ])
            .withKeyId("key-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.vote(
        matchmaking.VoteRequest()
            .with_namespace_name(self.hash1)
            .with_ballot_body(self.ballot_body)
            .with_ballot_signature(self.ballot_signature)
            .with_game_results([
                matchmaking.GameResult()
                    .with_rank(1)
                    .with_user_id('user-0001'),
                matchmaking.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0002'),
                matchmaking.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0003'),
                matchmaking.GameResult()
                    .with_rank(3)
                    .with_user_id('user-0004'),
            ])
            .with_key_id(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,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.vote_async({
    namespaceName="namespace1",
    ballotBody="ballotBody",
    ballotSignature="ballotSignature",
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

voteMultiple

対戦結果をまとめて投票します。

ゲームに勝利した側が他プレイヤーの投票用紙を集めてまとめて投票するのに使用します。
『勝利した側』としているのは、敗北した側が自分たちが勝ったことにして報告することにインセンティブはありますが、その逆はないためです。
負けた側が投票用紙を渡してこない可能性がありますが、その場合も過半数の投票用紙があれば結果を通すことができます。

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
signedBallotsList<SignedBallot>~ 10 items署名付の投票用紙リスト
gameResultsList<GameResult>~ 10 items投票内容。対戦を行ったプレイヤーグループ1に所属するユーザIDのリスト
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024文字暗号鍵GRN

Result

説明
itemBallot投票用紙

実装例

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{
            matchmaking.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
            matchmaking.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
            matchmaking.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
            matchmaking.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
        },
        GameResults: []matchmaking.GameResult{
            matchmaking.GameResult{
                Rank: pointy.Int32(1),
                UserId: pointy.String("user-0001"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0002"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0003"),
            },
            matchmaking.GameResult{
                Rank: pointy.Int32(3),
                UserId: pointy.String("user-0004"),
            },
        },
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Matchmaking\Gs2MatchmakingRestClient;
use Gs2\Matchmaking\Request\VoteMultipleRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->voteMultiple(
        (new VoteMultipleRequest())
            ->withNamespaceName(self::namespace1)
            ->withSignedBallots([
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
            ])
            ->withGameResults([
                (new GameResult())
                    ->withRank(1)
                    ->withUserId("user-0001"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0002"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0003"),
                (new GameResult())
                    ->withRank(3)
                    ->withUserId("user-0004"),
            ])
            ->withKeyId(self::key-0001)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.matchmaking.rest.Gs2MatchmakingRestClient;
import io.gs2.matchmaking.request.VoteMultipleRequest;
import io.gs2.matchmaking.result.VoteMultipleResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MatchmakingRestClient client = new Gs2MatchmakingRestClient(session);

try {
    VoteMultipleResult result = client.voteMultiple(
        new VoteMultipleRequest()
            .withNamespaceName("namespace1")
            .withSignedBallots(Arrays.asList(
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb")
            ))
            .withGameResults(Arrays.asList(
                new GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new GameResult()
                    .withRank(3)
                    .withUserId("user-0004")
            ))
            .withKeyId("key-0001")
    );
    Ballot item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.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[] {
            new Gs2.Gs2Matchmaking.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
            new Gs2.Gs2Matchmaking.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
            new Gs2.Gs2Matchmaking.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
            new Gs2.Gs2Matchmaking.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
        })
        .WithGameResults(new Gs2.Gs2Matchmaking.Model.GameResult[] {
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(1)
                .WithUserId("user-0001"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0002"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0003"),
            new Gs2.Gs2Matchmaking.Model.GameResult()
                .WithRank(3)
                .WithUserId("user-0004"),
        })
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Matchmaking from '@/gs2/matchmaking';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Matchmaking.Gs2MatchmakingRestClient(session);

try {
    const result = await client.voteMultiple(
        new Gs2Matchmaking.VoteMultipleRequest()
            .withNamespaceName("namespace1")
            .withSignedBallots([
                new Gs2Matchmaking.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new Gs2Matchmaking.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new Gs2Matchmaking.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new Gs2Matchmaking.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
            ])
            .withGameResults([
                new Gs2Matchmaking.model.GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new Gs2Matchmaking.model.GameResult()
                    .withRank(3)
                    .withUserId("user-0004"),
            ])
            .withKeyId("key-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import matchmaking

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = matchmaking.Gs2MatchmakingRestClient(session)

try:
    result = client.vote_multiple(
        matchmaking.VoteMultipleRequest()
            .with_namespace_name(self.hash1)
            .with_signed_ballots([
                matchmaking.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
                matchmaking.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
                matchmaking.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
                matchmaking.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
            ])
            .with_game_results([
                matchmaking.GameResult()
                    .with_rank(1)
                    .with_user_id('user-0001'),
                matchmaking.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0002'),
                matchmaking.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0003'),
                matchmaking.GameResult()
                    .with_rank(3)
                    .with_user_id('user-0004'),
            ])
            .with_key_id(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,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('matchmaking')

api_result_handler = client.vote_multiple_async({
    namespaceName="namespace1",
    signedBallots={
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        }
    },
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

commitVote

投票状況を強制確定

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
ratingNamestring~ 128文字レーティングモデル名
gatheringNamestringUUID~ 128文字ギャザリング名

Result

説明

実装例

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
client = gs2('matchmaking')

api_result_handler = client.commit_vote_async({
    namespaceName="namespace1",
    ratingName="rating-0001",
    gatheringName="gathering-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result