GS2-Ranking SDK API リファレンス

モデル

Namespace

ネームスペース

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

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

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字ネームスペースGRN
namestring~ 128文字ネームスペース名
descriptionstring~ 1024文字説明文
lastCalculatedAtsList<CalculatedAt>[]~ 1000 items最終集計日時リスト
logSettingLogSettingログの出力設定
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

CategoryModel

カテゴリーモデル

カテゴリ毎に異なるランキングを作成できます。

カテゴリには登録できるスコアの最小値・最大値を設定でき、その範囲外のスコアは破棄されます。 ランキングを集計する際にスコアを小さいものを上位(昇順)にするか、大きいものを上位(降順)にするかを設定できます。

ランキングの種類として グローバルスコープ を選択できます。 グローバルは全プレイヤーが同じ結果を参照するもので、スコープはフレンド内ランキングや、ギルド内ランキングのようなゲームプレイヤー毎に結果の異なるランキングです。

グローバルランキングはカテゴリごとにランキングの集計間隔を15分~24時間で設定できます。 スコープランキングはリアルタイムで集計結果が反映されます。

ランキングデータには世代という設定があり、世代を変更することで登録されたスコアをリセットすることができます。

有効化条件必須デフォルト値の制限説明
categoryModelIdstring~ 1024文字カテゴリGRN
namestring~ 128文字カテゴリ名
metadatastring~ 1024文字メタデータ
minimumValuelong~ 9223372036854775805スコアの最小値
maximumValuelong~ 9223372036854775805スコアの最大値
sumboolfalse登録を受け付けたスコアを合算し、合計値を競う
orderDirectionenum [
“asc”,
“desc”
]
~ 128文字スコアのソート方向
scopeenum [
“global”,
“scoped”
]
~ 128文字ランキングの種類
globalRankingSettingGlobalRankingSetting{scope} == “global”グローバルランキング設定
entryPeriodEventIdstring~ 1024文字GS2-Schedule イベントGRN
accessPeriodEventIdstring~ 1024文字GS2-Schedule イベントGRN

CategoryModelMaster

カテゴリーモデル

カテゴリ毎に異なるランキングを作成できます。

カテゴリには登録できるスコアの最小値・最大値を設定でき、その範囲外のスコアは破棄されます。 ランキングを集計する際にスコアを小さいものを上位(昇順)にするか、大きいものを上位(降順)にするかを設定できます。

ランキングの種類として グローバルスコープ を選択できます。 グローバルは全プレイヤーが同じ結果を参照するもので、スコープはフレンド内ランキングや、ギルド内ランキングのようなゲームプレイヤー毎に結果の異なるランキングです。

グローバルランキングはカテゴリごとにランキングの集計間隔を15分~24時間で設定できます。 スコープランキングはリアルタイムで集計結果が反映されます。

ランキングデータには世代という設定があり、世代を変更することで登録されたスコアをリセットすることができます。

有効化条件必須デフォルト値の制限説明
categoryModelIdstring~ 1024文字カテゴリマスターGRN
namestring~ 128文字カテゴリモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 1024文字メタデータ
minimumValuelong~ 9223372036854775805スコアの最小値
maximumValuelong~ 9223372036854775805スコアの最大値
sumboolfalse登録を受け付けたスコアを合算し、合計値を競う
orderDirectionenum [
“asc”,
“desc”
]
~ 128文字スコアのソート方向
scopeenum [
“global”,
“scoped”
]
~ 128文字ランキングの種類
globalRankingSettingGlobalRankingSetting{scope} == “global”グローバルランキング設定
entryPeriodEventIdstring~ 1024文字GS2-Schedule イベントGRN
accessPeriodEventIdstring~ 1024文字GS2-Schedule イベントGRN
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

Subscribe

購読

スコープランキングでスコアの変化を購読している状況を保持するエンティティです。

有効化条件必須デフォルト値の制限説明
subscribeIdstring~ 1024文字購読GRN
categoryNamestring~ 128文字カテゴリ名
userIdstring~ 128文字ユーザーID
targetUserIdsList<string>[]~ 10000 items購読しているユーザIDリスト
subscribedUserIdsList<string>[]~ 10000 items購読されているユーザIDリスト
createdAtlong作成日時
revisionlong0~ 9223372036854775805リビジョン

Score

スコア

ゲームプレイヤー毎×カテゴリ毎の登録されたスコアを保持するエンティティです。

有効化条件必須デフォルト値の制限説明
scoreIdstring~ 1024文字スコアGRN
categoryNamestring~ 128文字カテゴリ名
userIdstring~ 128文字ユーザーID
uniqueIdstringUUID~ 36文字スコアのユニークID
scorerUserIdstring~ 128文字ユーザーID
scorelong~ 9223372036854775805スコア
metadatastring~ 512文字メタデータ
createdAtlong作成日時
revisionlong0~ 9223372036854775805リビジョン

Ranking

ランキング

ランキングには「参加者全員が同じボード上で競い合う」 グローバルランキング と、「購読したプレイヤーのスコアと競い合う」 スコープランキング があります。

有効化条件必須デフォルト値の制限説明
ranklong1 ~ 9223372036854775805順位
indexlong~ 92233720368547758051位からのインデックス
categoryNamestring~ 128文字カテゴリ名
userIdstring~ 128文字ユーザーID
scorelong~ 9223372036854775805スコア
metadatastring~ 512文字メタデータ
createdAtlong作成日時

CurrentRankingMaster

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

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

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

JSONファイルの形式についてはドキュメントを参照ください。

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

Scope

集計スコープ

グローバルランキングモードで使用可能。 通常グローバルランキングは登録されたスコア全てを対象にランキングの集計が行われます。

有効化条件必須デフォルト値の制限説明
namestring~ 128文字スコープ名
targetDayslong1 ~ 365集計対象日数

GlobalRankingSetting

グローバルランキング設定

グローバルは全プレイヤーが同じ結果を参照するものです。 ランキングの集計間隔を15分~24時間で設定できます。

ランキングデータには世代という設定があり、世代を変更することで登録されたスコアをリセットすることができます。

有効化条件必須デフォルト値の制限説明
uniqueByUserIdbooltrueユーザID毎にスコアを1つしか登録されないようにする
calculateIntervalMinutesint15 ~ 1440スコアの集計間隔(分)
calculateFixedTimingFixedTimingスコアの固定集計開始時刻
additionalScopesList<Scope>~ 10 itemsスコープリスト
ignoreUserIdsList<string>~ 10000 itemsランキングに反映しないユーザーIDリスト
generationstring~ 256文字ランキングの世代

FixedTiming

集計時刻固定設定

グローバルランキングの集計タイミングを固定するための設定です。

有効化条件必須デフォルト値の制限説明
hourint~ 23スコアの固定集計開始時刻(時)
minuteint~ 59スコアの固定集計開始時刻(分)

CalculatedAt

最終集計日時

有効化条件必須デフォルト値の制限説明
categoryNamestring~ 128文字カテゴリ名
calculatedAtlong集計日時

SubscribeUser

購読しているユーザーのユーザーID

有効化条件必須デフォルト値の制限説明
subscribeUserIdstring~ 1024文字購読対象GRN
categoryNamestring~ 128文字カテゴリ名
userIdstring~ 128文字ユーザーID
targetUserIdstring~ 128文字購読する対象のユーザーID

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文字タグ名

LogSetting

ログの書き出し設定

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

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

メソッド

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/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &ranking.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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.DescribeNamespacesRequest;
import io.gs2.ranking.result.DescribeNamespacesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2RankingRestClient client = new Gs2RankingRestClient(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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.DescribeNamespacesRequest;
using Gs2.Gs2Ranking.Result.DescribeNamespacesResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Ranking.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 Gs2Ranking from '@/gs2/ranking';

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

try {
    const result = await client.describeNamespaces(
        new Gs2Ranking.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 ranking

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

try:
    result = client.describe_namespaces(
        ranking.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('ranking')

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

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

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

createNamespace

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

Request

有効化条件必須デフォルト値の制限説明
namestring~ 128文字ネームスペース名
descriptionstring~ 1024文字説明文
logSettingLogSettingログの出力設定

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &ranking.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        LogSetting: &ranking.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log: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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\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)
            ->withLogSetting((new \Gs2\Ranking\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.CreateNamespaceRequest;
import io.gs2.ranking.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withLogSetting(new io.gs2.ranking.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log: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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.CreateNamespaceRequest;
using Gs2.Gs2Ranking.Result.CreateNamespaceResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Ranking.Request.CreateNamespaceRequest()
        .WithName("namespace1")
        .WithDescription(null)
        .WithLogSetting(new Gs2.Gs2Ranking.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log: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 Gs2Ranking from '@/gs2/ranking';

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

try {
    const result = await client.createNamespace(
        new Gs2Ranking.CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withLogSetting(new Gs2Ranking.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking

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

try:
    result = client.create_namespace(
        ranking.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_log_setting(
                ranking.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.create_namespace({
    name="namespace1",
    description=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

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/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &ranking.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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.GetNamespaceStatusRequest;
import io.gs2.ranking.result.GetNamespaceStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2RankingRestClient client = new Gs2RankingRestClient(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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Ranking.Result.GetNamespaceStatusResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Ranking.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 Gs2Ranking from '@/gs2/ranking';

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

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

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

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

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

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

result = api_result.result
status = result.status;

getNamespace

ネームスペースを取得

Request

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

Result

説明
itemNamespaceネームスペース

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &ranking.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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.GetNamespaceRequest;
import io.gs2.ranking.result.GetNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2RankingRestClient client = new Gs2RankingRestClient(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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.GetNamespaceRequest;
using Gs2.Gs2Ranking.Result.GetNamespaceResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Ranking.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 Gs2Ranking from '@/gs2/ranking';

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

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

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

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

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

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

result = api_result.result
item = result.item;

updateNamespace

ネームスペースを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
descriptionstring~ 1024文字説明文
logSettingLogSettingログの出力設定

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &ranking.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        LogSetting: &ranking.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log: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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\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")
            ->withLogSetting((new \Gs2\Ranking\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.UpdateNamespaceRequest;
import io.gs2.ranking.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withLogSetting(new io.gs2.ranking.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log: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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.UpdateNamespaceRequest;
using Gs2.Gs2Ranking.Result.UpdateNamespaceResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Ranking.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace1")
        .WithDescription("description1")
        .WithLogSetting(new Gs2.Gs2Ranking.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log: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 Gs2Ranking from '@/gs2/ranking';

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

try {
    const result = await client.updateNamespace(
        new Gs2Ranking.UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withLogSetting(new Gs2Ranking.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking

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

try:
    result = client.update_namespace(
        ranking.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_log_setting(
                ranking.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.update_namespace({
    namespaceName="namespace1",
    description="description1",
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

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/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &ranking.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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.DeleteNamespaceRequest;
import io.gs2.ranking.result.DeleteNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2RankingRestClient client = new Gs2RankingRestClient(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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.DeleteNamespaceRequest;
using Gs2.Gs2Ranking.Result.DeleteNamespaceResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Ranking.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 Gs2Ranking from '@/gs2/ranking';

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

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

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

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

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

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

result = api_result.result
item = result.item;

dumpUserDataByUserId

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

Request

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

Result

説明

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &ranking.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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.DumpUserDataByUserIdRequest;
import io.gs2.ranking.result.DumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2RankingRestClient client = new Gs2RankingRestClient(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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Ranking.Result.DumpUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Ranking.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 Gs2Ranking from '@/gs2/ranking';

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

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

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

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

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

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/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &ranking.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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.ranking.result.CheckDumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2RankingRestClient client = new Gs2RankingRestClient(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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Ranking.Result.CheckDumpUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Ranking.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 Gs2Ranking from '@/gs2/ranking';

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

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

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

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

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;

cleanUserDataByUserId

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

Request

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

Result

説明

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &ranking.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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.CleanUserDataByUserIdRequest;
import io.gs2.ranking.result.CleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2RankingRestClient client = new Gs2RankingRestClient(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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Ranking.Result.CleanUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Ranking.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 Gs2Ranking from '@/gs2/ranking';

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

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

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

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

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

checkCleanUserDataByUserId

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

Request

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

Result

説明

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &ranking.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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.ranking.result.CheckCleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2RankingRestClient client = new Gs2RankingRestClient(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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Ranking.Result.CheckCleanUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Ranking.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 Gs2Ranking from '@/gs2/ranking';

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

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

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

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

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

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/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &ranking.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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.ranking.result.PrepareImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2RankingRestClient client = new Gs2RankingRestClient(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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Ranking.Result.PrepareImportUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Ranking.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 Gs2Ranking from '@/gs2/ranking';

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

try {
    const result = await client.prepareImportUserDataByUserId(
        new Gs2Ranking.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 ranking

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

try:
    result = client.prepare_import_user_data_by_user_id(
        ranking.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('ranking')

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;

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/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &ranking.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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.ImportUserDataByUserIdRequest;
import io.gs2.ranking.result.ImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2RankingRestClient client = new Gs2RankingRestClient(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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Ranking.Result.ImportUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2Ranking.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 Gs2Ranking from '@/gs2/ranking';

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

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

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

try:
    result = client.import_user_data_by_user_id(
        ranking.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('ranking')

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

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/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &ranking.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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.CheckImportUserDataByUserIdRequest;
import io.gs2.ranking.result.CheckImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2RankingRestClient client = new Gs2RankingRestClient(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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Ranking.Result.CheckImportUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2Ranking.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 Gs2Ranking from '@/gs2/ranking';

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

try {
    const result = await client.checkImportUserDataByUserId(
        new Gs2Ranking.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 ranking

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

try:
    result = client.check_import_user_data_by_user_id(
        ranking.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('ranking')

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;

describeCategoryModels

カテゴリモデルの一覧を取得

Request

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

Result

説明
itemsList<CategoryModel>カテゴリモデルのリスト

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.DescribeCategoryModels(
    &ranking.DescribeCategoryModelsRequest {
        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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\DescribeCategoryModelsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeCategoryModels(
        (new DescribeCategoryModelsRequest())
            ->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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.DescribeCategoryModelsRequest;
import io.gs2.ranking.result.DescribeCategoryModelsResult;

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

try {
    DescribeCategoryModelsResult result = client.describeCategoryModels(
        new DescribeCategoryModelsRequest()
            .withNamespaceName("namespace1")
    );
    List<CategoryModel> 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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.DescribeCategoryModelsRequest;
using Gs2.Gs2Ranking.Result.DescribeCategoryModelsResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.DescribeCategoryModelsResult> asyncResult = null;
yield return client.DescribeCategoryModels(
    new Gs2.Gs2Ranking.Request.DescribeCategoryModelsRequest()
        .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 Gs2Ranking from '@/gs2/ranking';

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

try {
    const result = await client.describeCategoryModels(
        new Gs2Ranking.DescribeCategoryModelsRequest()
            .withNamespaceName("namespace1")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking

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

try:
    result = client.describe_category_models(
        ranking.DescribeCategoryModelsRequest()
            .with_namespace_name(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.describe_category_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;

getCategoryModel

カテゴリモデルを取得

Request

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

Result

説明
itemCategoryModelカテゴリモデル

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.GetCategoryModel(
    &ranking.GetCategoryModelRequest {
        NamespaceName: pointy.String("namespace1"),
        CategoryName: pointy.String("category-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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\GetCategoryModelRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCategoryModel(
        (new GetCategoryModelRequest())
            ->withNamespaceName(self::namespace1)
            ->withCategoryName("category-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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.GetCategoryModelRequest;
import io.gs2.ranking.result.GetCategoryModelResult;

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

try {
    GetCategoryModelResult result = client.getCategoryModel(
        new GetCategoryModelRequest()
            .withNamespaceName("namespace1")
            .withCategoryName("category-0001")
    );
    CategoryModel 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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.GetCategoryModelRequest;
using Gs2.Gs2Ranking.Result.GetCategoryModelResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetCategoryModelResult> asyncResult = null;
yield return client.GetCategoryModel(
    new Gs2.Gs2Ranking.Request.GetCategoryModelRequest()
        .WithNamespaceName("namespace1")
        .WithCategoryName("category-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 Gs2Ranking from '@/gs2/ranking';

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

try {
    const result = await client.getCategoryModel(
        new Gs2Ranking.GetCategoryModelRequest()
            .withNamespaceName("namespace1")
            .withCategoryName("category-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking

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

try:
    result = client.get_category_model(
        ranking.GetCategoryModelRequest()
            .with_namespace_name(self.hash1)
            .with_category_name('category-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.get_category_model({
    namespaceName="namespace1",
    categoryName="category-0001",
})

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

result = api_result.result
item = result.item;

describeCategoryModelMasters

カテゴリモデルマスターの一覧を取得

Request

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

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.DescribeCategoryModelMasters(
    &ranking.DescribeCategoryModelMastersRequest {
        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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\DescribeCategoryModelMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeCategoryModelMasters(
        (new DescribeCategoryModelMastersRequest())
            ->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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.DescribeCategoryModelMastersRequest;
import io.gs2.ranking.result.DescribeCategoryModelMastersResult;

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

try {
    DescribeCategoryModelMastersResult result = client.describeCategoryModelMasters(
        new DescribeCategoryModelMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<CategoryModelMaster> 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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.DescribeCategoryModelMastersRequest;
using Gs2.Gs2Ranking.Result.DescribeCategoryModelMastersResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.DescribeCategoryModelMastersResult> asyncResult = null;
yield return client.DescribeCategoryModelMasters(
    new Gs2.Gs2Ranking.Request.DescribeCategoryModelMastersRequest()
        .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 Gs2Ranking from '@/gs2/ranking';

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

try {
    const result = await client.describeCategoryModelMasters(
        new Gs2Ranking.DescribeCategoryModelMastersRequest()
            .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 ranking

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

try:
    result = client.describe_category_model_masters(
        ranking.DescribeCategoryModelMastersRequest()
            .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('ranking')

api_result = client.describe_category_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;

createCategoryModelMaster

カテゴリモデルマスターを新規作成

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
namestring~ 128文字カテゴリモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 1024文字メタデータ
minimumValuelong~ 9223372036854775805スコアの最小値
maximumValuelong~ 9223372036854775805スコアの最大値
orderDirectionenum [
“asc”,
“desc”
]
~ 128文字スコアのソート方向
scopeenum [
“global”,
“scoped”
]
~ 128文字ランキングの種類
globalRankingSettingGlobalRankingSetting{scope} == “global”グローバルランキング設定
entryPeriodEventIdstring~ 1024文字GS2-Schedule イベントGRN
accessPeriodEventIdstring~ 1024文字GS2-Schedule イベントGRN
uniqueByUserIdbool{scope} == “global”ユーザID毎にスコアを1つしか登録されないようにする
sumboolfalse登録を受け付けたスコアを合算し、合計値を競う
calculateFixedTimingHourint{scope} == “global”~ 23スコアの固定集計開始時刻(時)
calculateFixedTimingMinuteint{scope} == “global”~ 59スコアの固定集計開始時刻(分)
calculateIntervalMinutesint{scope} == “global”15 ~ 1440スコアの集計間隔(分)
additionalScopesList<Scope>{scope} == “global”~ 10 itemsスコープリスト
ignoreUserIdsList<string>~ 10000 itemsランキングに反映しないユーザーIDリスト
generationstring~ 256文字ランキングの世代

Result

説明
itemCategoryModelMaster作成したカテゴリモデルマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.CreateCategoryModelMaster(
    &ranking.CreateCategoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("category-0001"),
        Description: nil,
        Metadata: nil,
        MinimumValue: nil,
        MaximumValue: nil,
        OrderDirection: pointy.String("asc"),
        Scope: pointy.String("global"),
        GlobalRankingSetting: &ranking.GlobalRankingSetting{
            CalculateIntervalMinutes: pointy.Int32(15),
            UniqueByUserId: pointy.Bool(false),
            AdditionalScopes: []ranking.Scope{
                ranking.Scope{
                    Name: pointy.String("daily"),
                    TargetDays: pointy.Int64(1),
                },
                ranking.Scope{
                    Name: pointy.String("weekly"),
                    TargetDays: pointy.Int64(7),
                },
            },
        },
        EntryPeriodEventId: nil,
        AccessPeriodEventId: nil,
        Sum: 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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\CreateCategoryModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createCategoryModelMaster(
        (new CreateCategoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("category-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withMinimumValue(null)
            ->withMaximumValue(null)
            ->withOrderDirection("asc")
            ->withScope("global")
            ->withGlobalRankingSetting((new \Gs2\Ranking\Model\GlobalRankingSetting())
                ->withCalculateIntervalMinutes(15)
                ->withUniqueByUserId(False)
                ->withAdditionalScopes([
                    (new \Gs2\Ranking\Model\Scope())
                        ->withName("daily")
                        ->withTargetDays(1),
                    (new \Gs2\Ranking\Model\Scope())
                        ->withName("weekly")
                        ->withTargetDays(7),
                ]))
            ->withEntryPeriodEventId(null)
            ->withAccessPeriodEventId(null)
            ->withSum(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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.CreateCategoryModelMasterRequest;
import io.gs2.ranking.result.CreateCategoryModelMasterResult;

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

try {
    CreateCategoryModelMasterResult result = client.createCategoryModelMaster(
        new CreateCategoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("category-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMinimumValue(null)
            .withMaximumValue(null)
            .withOrderDirection("asc")
            .withScope("global")
            .withGlobalRankingSetting(new io.gs2.ranking.model.GlobalRankingSetting()
                .withCalculateIntervalMinutes(15)
                .withUniqueByUserId(false)
                .withAdditionalScopes(Arrays.asList(
                    new io.gs2.ranking.model.Scope()
                        .withName("daily")
                        .withTargetDays(1L),
                    new io.gs2.ranking.model.Scope()
                        .withName("weekly")
                        .withTargetDays(7L)
                )))
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
            .withSum(null)
    );
    CategoryModelMaster 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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.CreateCategoryModelMasterRequest;
using Gs2.Gs2Ranking.Result.CreateCategoryModelMasterResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.CreateCategoryModelMasterResult> asyncResult = null;
yield return client.CreateCategoryModelMaster(
    new Gs2.Gs2Ranking.Request.CreateCategoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithName("category-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithMinimumValue(null)
        .WithMaximumValue(null)
        .WithOrderDirection("asc")
        .WithScope("global")
        .WithGlobalRankingSetting(new Gs2.Gs2Ranking.Model.GlobalRankingSetting()
            .WithCalculateIntervalMinutes(15)
            .WithUniqueByUserId(false)
            .WithAdditionalScopes(new Gs2.Gs2Ranking.Model.Scope[] {
                new Gs2.Gs2Ranking.Model.Scope()
                    .WithName("daily")
                    .WithTargetDays(1L),
                new Gs2.Gs2Ranking.Model.Scope()
                    .WithName("weekly")
                    .WithTargetDays(7L),
            }))
        .WithEntryPeriodEventId(null)
        .WithAccessPeriodEventId(null)
        .WithSum(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 Gs2Ranking from '@/gs2/ranking';

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

try {
    const result = await client.createCategoryModelMaster(
        new Gs2Ranking.CreateCategoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("category-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMinimumValue(null)
            .withMaximumValue(null)
            .withOrderDirection("asc")
            .withScope("global")
            .withGlobalRankingSetting(new Gs2Ranking.model.GlobalRankingSetting()
                .withCalculateIntervalMinutes(15)
                .withUniqueByUserId(false)
                .withAdditionalScopes([
                    new Gs2Ranking.model.Scope()
                        .withName("daily")
                        .withTargetDays(1),
                    new Gs2Ranking.model.Scope()
                        .withName("weekly")
                        .withTargetDays(7),
                ]))
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
            .withSum(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking

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

try:
    result = client.create_category_model_master(
        ranking.CreateCategoryModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('category-0001')
            .with_description(None)
            .with_metadata(None)
            .with_minimum_value(None)
            .with_maximum_value(None)
            .with_order_direction('asc')
            .with_scope('global')
            .with_global_ranking_setting(
                ranking.GlobalRankingSetting()
                    .with_calculate_interval_minutes(15)
                    .with_unique_by_user_id(False)
                    .with_additional_scopes([
                        ranking.Scope()
                            .with_name('daily')
                            .with_target_days(1),
                        ranking.Scope()
                            .with_name('weekly')
                            .with_target_days(7),
                    ]))
            .with_entry_period_event_id(None)
            .with_access_period_event_id(None)
            .with_sum(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.create_category_model_master({
    namespaceName="namespace1",
    name="category-0001",
    description=nil,
    metadata=nil,
    minimumValue=nil,
    maximumValue=nil,
    orderDirection="asc",
    scope="global",
    globalRankingSetting={
        calculateIntervalMinutes=15,
        uniqueByUserId=false,
        additionalScopes={
            {
                name="daily",
                targetDays=1,
            },
            {
                name="weekly",
                targetDays=7,
            }
        },
    },
    entryPeriodEventId=nil,
    accessPeriodEventId=nil,
    sum=nil,
})

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

result = api_result.result
item = result.item;

getCategoryModelMaster

カテゴリモデルマスターを取得

Request

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

Result

説明
itemCategoryModelMasterカテゴリモデルマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.GetCategoryModelMaster(
    &ranking.GetCategoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        CategoryName: pointy.String("category-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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\GetCategoryModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCategoryModelMaster(
        (new GetCategoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withCategoryName("category-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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.GetCategoryModelMasterRequest;
import io.gs2.ranking.result.GetCategoryModelMasterResult;

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

try {
    GetCategoryModelMasterResult result = client.getCategoryModelMaster(
        new GetCategoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withCategoryName("category-0001")
    );
    CategoryModelMaster 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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.GetCategoryModelMasterRequest;
using Gs2.Gs2Ranking.Result.GetCategoryModelMasterResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetCategoryModelMasterResult> asyncResult = null;
yield return client.GetCategoryModelMaster(
    new Gs2.Gs2Ranking.Request.GetCategoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithCategoryName("category-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 Gs2Ranking from '@/gs2/ranking';

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

try {
    const result = await client.getCategoryModelMaster(
        new Gs2Ranking.GetCategoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withCategoryName("category-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking

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

try:
    result = client.get_category_model_master(
        ranking.GetCategoryModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_category_name('category-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.get_category_model_master({
    namespaceName="namespace1",
    categoryName="category-0001",
})

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

result = api_result.result
item = result.item;

updateCategoryModelMaster

カテゴリモデルマスターを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
categoryNamestring~ 128文字カテゴリモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 1024文字メタデータ
minimumValuelong~ 9223372036854775805スコアの最小値
maximumValuelong~ 9223372036854775805スコアの最大値
orderDirectionenum [
“asc”,
“desc”
]
~ 128文字スコアのソート方向
scopeenum [
“global”,
“scoped”
]
~ 128文字ランキングの種類
globalRankingSettingGlobalRankingSetting{scope} == “global”グローバルランキング設定
entryPeriodEventIdstring~ 1024文字GS2-Schedule イベントGRN
accessPeriodEventIdstring~ 1024文字GS2-Schedule イベントGRN
uniqueByUserIdbool{scope} == “global”ユーザID毎にスコアを1つしか登録されないようにする
sumboolfalse登録を受け付けたスコアを合算し、合計値を競う
calculateFixedTimingHourint{scope} == “global”~ 23スコアの固定集計開始時刻(時)
calculateFixedTimingMinuteint{scope} == “global”~ 59スコアの固定集計開始時刻(分)
calculateIntervalMinutesint{scope} == “global”15 ~ 1440スコアの集計間隔(分)
additionalScopesList<Scope>{scope} == “global”~ 10 itemsスコープリスト
ignoreUserIdsList<string>~ 10000 itemsランキングに反映しないユーザーIDリスト
generationstring~ 256文字ランキングの世代

Result

説明
itemCategoryModelMaster更新したカテゴリモデルマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.UpdateCategoryModelMaster(
    &ranking.UpdateCategoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        CategoryName: pointy.String("category-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("CATEGORY_0001"),
        MinimumValue: pointy.Int64(100),
        MaximumValue: pointy.Int64(10000),
        OrderDirection: pointy.String("desc"),
        Scope: pointy.String("global"),
        GlobalRankingSetting: &ranking.GlobalRankingSetting{
            CalculateIntervalMinutes: pointy.Int32(15),
            UniqueByUserId: pointy.Bool(true),
            AdditionalScopes: []ranking.Scope{
                ranking.Scope{
                    Name: pointy.String("weekly"),
                    TargetDays: pointy.Int64(7),
                },
                ranking.Scope{
                    Name: pointy.String("monthly"),
                    TargetDays: pointy.Int64(30),
                },
            },
        },
        EntryPeriodEventId: nil,
        AccessPeriodEventId: nil,
        Sum: 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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\UpdateCategoryModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCategoryModelMaster(
        (new UpdateCategoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withCategoryName("category-0001")
            ->withDescription("description1")
            ->withMetadata("CATEGORY_0001")
            ->withMinimumValue(100)
            ->withMaximumValue(10000)
            ->withOrderDirection("desc")
            ->withScope("global")
            ->withGlobalRankingSetting((new \Gs2\Ranking\Model\GlobalRankingSetting())
                ->withCalculateIntervalMinutes(15)
                ->withUniqueByUserId(True)
                ->withAdditionalScopes([
                    (new \Gs2\Ranking\Model\Scope())
                        ->withName("weekly")
                        ->withTargetDays(7),
                    (new \Gs2\Ranking\Model\Scope())
                        ->withName("monthly")
                        ->withTargetDays(30),
                ]))
            ->withEntryPeriodEventId(null)
            ->withAccessPeriodEventId(null)
            ->withSum(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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.UpdateCategoryModelMasterRequest;
import io.gs2.ranking.result.UpdateCategoryModelMasterResult;

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

try {
    UpdateCategoryModelMasterResult result = client.updateCategoryModelMaster(
        new UpdateCategoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withCategoryName("category-0001")
            .withDescription("description1")
            .withMetadata("CATEGORY_0001")
            .withMinimumValue(100L)
            .withMaximumValue(10000L)
            .withOrderDirection("desc")
            .withScope("global")
            .withGlobalRankingSetting(new io.gs2.ranking.model.GlobalRankingSetting()
                .withCalculateIntervalMinutes(15)
                .withUniqueByUserId(true)
                .withAdditionalScopes(Arrays.asList(
                    new io.gs2.ranking.model.Scope()
                        .withName("weekly")
                        .withTargetDays(7L),
                    new io.gs2.ranking.model.Scope()
                        .withName("monthly")
                        .withTargetDays(30L)
                )))
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
            .withSum(null)
    );
    CategoryModelMaster 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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.UpdateCategoryModelMasterRequest;
using Gs2.Gs2Ranking.Result.UpdateCategoryModelMasterResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.UpdateCategoryModelMasterResult> asyncResult = null;
yield return client.UpdateCategoryModelMaster(
    new Gs2.Gs2Ranking.Request.UpdateCategoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithCategoryName("category-0001")
        .WithDescription("description1")
        .WithMetadata("CATEGORY_0001")
        .WithMinimumValue(100L)
        .WithMaximumValue(10000L)
        .WithOrderDirection("desc")
        .WithScope("global")
        .WithGlobalRankingSetting(new Gs2.Gs2Ranking.Model.GlobalRankingSetting()
            .WithCalculateIntervalMinutes(15)
            .WithUniqueByUserId(true)
            .WithAdditionalScopes(new Gs2.Gs2Ranking.Model.Scope[] {
                new Gs2.Gs2Ranking.Model.Scope()
                    .WithName("weekly")
                    .WithTargetDays(7L),
                new Gs2.Gs2Ranking.Model.Scope()
                    .WithName("monthly")
                    .WithTargetDays(30L),
            }))
        .WithEntryPeriodEventId(null)
        .WithAccessPeriodEventId(null)
        .WithSum(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 Gs2Ranking from '@/gs2/ranking';

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

try {
    const result = await client.updateCategoryModelMaster(
        new Gs2Ranking.UpdateCategoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withCategoryName("category-0001")
            .withDescription("description1")
            .withMetadata("CATEGORY_0001")
            .withMinimumValue(100)
            .withMaximumValue(10000)
            .withOrderDirection("desc")
            .withScope("global")
            .withGlobalRankingSetting(new Gs2Ranking.model.GlobalRankingSetting()
                .withCalculateIntervalMinutes(15)
                .withUniqueByUserId(true)
                .withAdditionalScopes([
                    new Gs2Ranking.model.Scope()
                        .withName("weekly")
                        .withTargetDays(7),
                    new Gs2Ranking.model.Scope()
                        .withName("monthly")
                        .withTargetDays(30),
                ]))
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
            .withSum(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking

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

try:
    result = client.update_category_model_master(
        ranking.UpdateCategoryModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_category_name('category-0001')
            .with_description('description1')
            .with_metadata('CATEGORY_0001')
            .with_minimum_value(100)
            .with_maximum_value(10000)
            .with_order_direction('desc')
            .with_scope('global')
            .with_global_ranking_setting(
                ranking.GlobalRankingSetting()
                    .with_calculate_interval_minutes(15)
                    .with_unique_by_user_id(True)
                    .with_additional_scopes([
                        ranking.Scope()
                            .with_name('weekly')
                            .with_target_days(7),
                        ranking.Scope()
                            .with_name('monthly')
                            .with_target_days(30),
                    ]))
            .with_entry_period_event_id(None)
            .with_access_period_event_id(None)
            .with_sum(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.update_category_model_master({
    namespaceName="namespace1",
    categoryName="category-0001",
    description="description1",
    metadata="CATEGORY_0001",
    minimumValue=100,
    maximumValue=10000,
    orderDirection="desc",
    scope="global",
    globalRankingSetting={
        calculateIntervalMinutes=15,
        uniqueByUserId=true,
        additionalScopes={
            {
                name="weekly",
                targetDays=7,
            },
            {
                name="monthly",
                targetDays=30,
            }
        },
    },
    entryPeriodEventId=nil,
    accessPeriodEventId=nil,
    sum=nil,
})

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

result = api_result.result
item = result.item;

deleteCategoryModelMaster

カテゴリモデルマスターを削除

Request

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

Result

説明
itemCategoryModelMaster削除したカテゴリモデルマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.DeleteCategoryModelMaster(
    &ranking.DeleteCategoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        CategoryName: pointy.String("category-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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\DeleteCategoryModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteCategoryModelMaster(
        (new DeleteCategoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withCategoryName("category-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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.DeleteCategoryModelMasterRequest;
import io.gs2.ranking.result.DeleteCategoryModelMasterResult;

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

try {
    DeleteCategoryModelMasterResult result = client.deleteCategoryModelMaster(
        new DeleteCategoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withCategoryName("category-0001")
    );
    CategoryModelMaster 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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.DeleteCategoryModelMasterRequest;
using Gs2.Gs2Ranking.Result.DeleteCategoryModelMasterResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.DeleteCategoryModelMasterResult> asyncResult = null;
yield return client.DeleteCategoryModelMaster(
    new Gs2.Gs2Ranking.Request.DeleteCategoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithCategoryName("category-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 Gs2Ranking from '@/gs2/ranking';

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

try {
    const result = await client.deleteCategoryModelMaster(
        new Gs2Ranking.DeleteCategoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withCategoryName("category-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking

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

try:
    result = client.delete_category_model_master(
        ranking.DeleteCategoryModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_category_name('category-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.delete_category_model_master({
    namespaceName="namespace1",
    categoryName="category-0001",
})

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

result = api_result.result
item = result.item;

subscribe

対象ユーザーを購読

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
categoryNamestring~ 128文字カテゴリ名
accessTokenstring~ 128文字ユーザーID
targetUserIdstring~ 128文字購読するユーザーID

Result

説明
itemSubscribeUser購読した対象ユーザー

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.Subscribe(
    &ranking.SubscribeRequest {
        NamespaceName: pointy.String("namespace1"),
        CategoryName: pointy.String("category-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        TargetUserId: pointy.String("user-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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\SubscribeRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->subscribe(
        (new SubscribeRequest())
            ->withNamespaceName(self::namespace1)
            ->withCategoryName("category-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withTargetUserId("user-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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.SubscribeRequest;
import io.gs2.ranking.result.SubscribeResult;

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

try {
    SubscribeResult result = client.subscribe(
        new SubscribeRequest()
            .withNamespaceName("namespace1")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    SubscribeUser 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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.SubscribeRequest;
using Gs2.Gs2Ranking.Result.SubscribeResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.SubscribeResult> asyncResult = null;
yield return client.Subscribe(
    new Gs2.Gs2Ranking.Request.SubscribeRequest()
        .WithNamespaceName("namespace1")
        .WithCategoryName("category-0001")
        .WithAccessToken("accessToken-0001")
        .WithTargetUserId("user-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 Gs2Ranking from '@/gs2/ranking';

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

try {
    const result = await client.subscribe(
        new Gs2Ranking.SubscribeRequest()
            .withNamespaceName("namespace1")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking

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

try:
    result = client.subscribe(
        ranking.SubscribeRequest()
            .with_namespace_name(self.hash1)
            .with_category_name('category-0001')
            .with_access_token(self.access_token_0001)
            .with_target_user_id('user-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.subscribe({
    namespaceName="namespace1",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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

result = api_result.result
item = result.item;

subscribeByUserId

ユーザーIDを指定して対象のユーザーを購読

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
categoryNamestring~ 128文字カテゴリ名
userIdstring~ 128文字ユーザーID
targetUserIdstring~ 128文字購読するユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemSubscribeUser購読した対象ユーザー

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking"
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 := ranking.Gs2RankingRestClient{
    Session: &session,
}
result, err := client.SubscribeByUserId(
    &ranking.SubscribeByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        CategoryName: pointy.String("category-0001"),
        UserId: pointy.String("user-0001"),
        TargetUserId: pointy.String("user-0002"),
        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\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\SubscribeByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->subscribeByUserId(
        (new SubscribeByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withCategoryName("category-0001")
            ->withUserId("user-0001")
            ->withTargetUserId("user-0002")
            ->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.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.SubscribeByUserIdRequest;
import io.gs2.ranking.result.SubscribeByUserIdResult;

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

try {
    SubscribeByUserIdResult result = client.subscribeByUserId(
        new SubscribeByUserIdRequest()
            .withNamespaceName("namespace1")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    SubscribeUser 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.Gs2Ranking.Gs2RankingRestClient;
using Gs2.Gs2Ranking.Request.SubscribeByUserIdRequest;
using Gs2.Gs2Ranking.Result.SubscribeByUserIdResult;

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

AsyncResult<Gs2.Gs2Ranking.Result.SubscribeByUserIdResult> asyncResult = null;
yield return client.SubscribeByUserId(
    new Gs2.Gs2Ranking.Request.SubscribeByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithCategoryName("category-0001")
        .WithUserId("user-0001")
        .WithTargetUserId("user-0002")
        .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 Gs2Ranking from '@/gs2/ranking';

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

try {
    const result = await client.subscribeByUserId(
        new Gs2Ranking.SubscribeByUserIdRequest()
            .withNamespaceName("namespace1")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking

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

try:
    result = client.subscribe_by_user_id(
        ranking.SubscribeByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_category_name('category-0001')
            .with_user_id('user-0001')
            .with_target_user_id('user-0002')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.subscribe_by_user_id({
    namespaceName="namespace1",
    categoryName="category-0001",
    userId="user-0001",
    targetUserId="user-0002",
    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;

describeScores

スコアの一覧を取得

Request