API Reference of GS2-Ranking SDK

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

Model

Namespace

Namespace

A namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Each GS2 service is managed on a per namespace basis. Even when using the same service, if the namespace differs, the data is treated as a completely independent data space.

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

TypeConditionRequiredDefaultValue LimitsDescription
namespaceIdstring
✓*
~ 1024 charsNamespace GRN
* Automatically configured on the server
namestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction settings
lastCalculatedAtsList<CalculatedAt>[]0 ~ 1000 itemsList of Last calculate date and times
logSettingLogSettingLog output settings
createdAtlong
✓*
NowDatetime of creation
Unix time, milliseconds
* Automatically configured on the server
updatedAtlong
✓*
NowDatetime of last update
Unix time, milliseconds
* Automatically configured on the server
revisionlong00 ~ 9223372036854775805Revision

TransactionSetting

Transaction settings

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

TypeConditionRequiredDefaultValue LimitsDescription
enableAutoRunbool
falseWhether to automatically execute issued transactions on the server side
enableAtomicCommitbool{enableAutoRun} == true
✓*
falseWhether to commit the execution of transactions atomically
* Required if enableAutoRun is true
transactionUseDistributorbool{enableAtomicCommit} == true
✓*
falseWhether to execute transactions asynchronously
* Required if enableAtomicCommit is true
commitScriptResultInUseDistributorbool{transactionUseDistributor} == true
✓*
falseWhether to execute the commit processing of the script result asynchronously
* Required if transactionUseDistributor is true
acquireActionUseJobQueuebool{enableAtomicCommit} == true
✓*
falseWhether to use GS2-JobQueue to execute the acquire action
* Required if enableAtomicCommit is true
distributorNamespaceIdstring
“grn:gs2:{region}:{ownerId}:distributor:default”~ 1024 charsGS2-Distributor namespace GRN used for transaction execution
queueNamespaceIdstring
“grn:gs2:{region}:{ownerId}:queue:default”~ 1024 charsNamespace GRN in GS2-JobQueue used to run the transaction

LogSetting

Log Export Settings

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

TypeConditionRequiredDefaultValue LimitsDescription
loggingNamespaceIdstring
~ 1024 charsGS2-Log namespace GRN to output logs
Must be specified in GRN format starting with “grn:gs2:”.

GitHubCheckoutSetting

Setup to check out master data from GitHub

TypeConditionRequiredDefaultValue LimitsDescription
apiKeyIdstring
~ 1024 charsGitHub API key GRN
repositoryNamestring
~ 1024 charsRepository Name
sourcePathstring
~ 1024 charsMaster data (JSON) file path
referenceTypeString Enum
enum {
  “commit_hash”,
  “branch”,
  “tag”
}
Source of code
Enumerator String DefinitionDescription
“commit_hash”Commit hash
“branch”Branch
“tag”Tag
commitHashstring{referenceType} == “commit_hash”
✓*
~ 1024 charsCommit hash
* Required if referenceType is “commit_hash”
branchNamestring{referenceType} == “branch”
✓*
~ 1024 charsBranch Name
* Required if referenceType is “branch”
tagNamestring{referenceType} == “tag”
✓*
~ 1024 charsTag Name
* Required if referenceType is “tag”

Subscribe

Subscription

This entity holds the status of subscribing to score changes in the Scope Ranking.

TypeConditionRequiredDefaultValue LimitsDescription
subscribeIdstring
✓*
~ 1024 charsSubscription GRN
* Automatically configured on the server
categoryNamestring
~ 128 charsCategory Name
userIdstring
~ 128 charsUser ID
targetUserIdsList<string>[]0 ~ 10000 itemsList of subscribed user IDs
subscribedUserIdsList<string>[]0 ~ 10000 itemsList of subscribed user IDs
createdAtlong
✓*
NowDatetime of creation
Unix time, milliseconds
* Automatically configured on the server
revisionlong00 ~ 9223372036854775805Revision

Score

Score

This entity holds the registered scores for each game player x category.

TypeConditionRequiredDefaultValue LimitsDescription
scoreIdstring
✓*
~ 1024 charsScore GRN
* Automatically configured on the server
categoryNamestring
~ 128 charsCategory Name
userIdstring
~ 128 charsUser ID
uniqueIdstring
UUID~ 36 charsScore Unique ID
scorerUserIdstring
~ 128 charsUser ID
scorelong
0 ~ 9223372036854775805Score
metadatastring~ 512 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
createdAtlong
✓*
NowDatetime of creation
Unix time, milliseconds
* Automatically configured on the server
revisionlong00 ~ 9223372036854775805Revision

Ranking

Ranking

There are two types of ranking: global ranking, in which all participants compete on the same board, and scope ranking, in which players compete against the scores of subscribed players.

TypeConditionRequiredDefaultValue LimitsDescription
ranklong
1 ~ 9223372036854775805Rank
indexlong
0 ~ 9223372036854775805Index from 1st place
categoryNamestring
~ 128 charsCategory Model name
userIdstring
~ 128 charsUser ID
scorelong
0 ~ 9223372036854775805Score
metadatastring~ 512 charsMetadata
createdAtlong
Datetime of creation
Unix time, milliseconds
* Automatically configured on the server

SubscribeUser

User ID of the subscribing user

TypeConditionRequiredDefaultValue LimitsDescription
subscribeUserIdstring
✓*
~ 1024 charsSubscription Target GRN
* Automatically configured on the server
categoryNamestring
~ 128 charsCategory Name
userIdstring
~ 128 charsUser ID
targetUserIdstring
~ 128 charsUser ID of the target to subscribe to

CategoryModel

Category Model

Different rankings can be created for different categories.

Categories can have a minimum and maximum score that can be registered, and scores outside of that range are discarded. When calculating rankings, it is possible to set whether the scores are to be ranked in ascending or descending order, with the smallest scores being ranked higher (ascending order) or the largest scores being ranked lower (descending order).

You can select global or scope as the type of ranking. Global is a ranking where all players see the same results, and Scope is a ranking where each game player has a different result, such as a ranking among friends or a ranking in a guild.

For global ranking, you can set the ranking interval from 15 minutes to 24 hours for each category. Scope rankings reflect the calculate results in real time.

The ranking data has a setting called “generation,” and the registered scores can be reset by changing the generation.

TypeConditionRequiredDefaultValue LimitsDescription
categoryModelIdstring
✓*
~ 1024 charsCategory Model GRN
* Automatically configured on the server
namestring
~ 128 charsCategory Model Name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 1024 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
minimumValuelong0 ~ 9223372036854775805Minimum Score
maximumValuelong0 ~ 9223372036854775805Maximum Score
sumbool
falseAdd up the scores received and compete for the total value
orderDirectionString Enum
enum {
  “asc”,
  “desc”
}
Sort direction of scores
Enumerator String DefinitionDescription
“asc”ascending-order
“desc”descending-order
scopeString Enum
enum {
  “global”,
  “scoped”
}
Type of Ranking
Enumerator String DefinitionDescription
“global”Global
“scoped”Scoped
globalRankingSettingGlobalRankingSetting{scope} == “global”
✓*
Global Ranking Setting
* Required if scope is “global”
entryPeriodEventIdstring~ 1024 charsPeriod during which scores can be registered GS2-Schedule Event GRN
accessPeriodEventIdstring~ 1024 charsPeriod during which ranking data can be accessed GS2-Schedule Event GRN

Scope

Aggregation Scope

Available in Global Ranking mode. Normally, the global ranking is calculated for all registered scores.

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsScope Name
targetDayslong
1 ~ 365Number of days to aggregate

GlobalRankingSetting

Global Ranking Setting

Global is a ranking where all players see the same results. The ranking interval can be set from 15 minutes to 24 hours.

The ranking data has a setting called “generation,” and the registered scores can be reset by changing the generation.

TypeConditionRequiredDefaultValue LimitsDescription
uniqueByUserIdbool
trueOnly one score is registered per user ID
calculateIntervalMinutesint
15 ~ 1440Interval between score totals (minutes)
calculateFixedTimingFixedTimingFixed time to start tallying scores
additionalScopesList<Scope>0 ~ 10 itemsList of Scope
ignoreUserIdsList<string>0 ~ 10000 itemsList of User IDs that are not reflected in the ranking
generationstring~ 256 charsRanking Generation

FixedTiming

Fixed Timing

Specifies the fixed timing at which ranking calculations start.

TypeConditionRequiredDefaultValue LimitsDescription
hourint0 ~ 23Fixed time to start tallying scores (hour)
minuteint0 ~ 59Fixed time to start tallying scores (minutes)

CalculatedAt

Last count date and time

TypeConditionRequiredDefaultValue LimitsDescription
categoryNamestring
~ 128 charsCategory Model name
calculatedAtlong
Date and time of calculating
Unix time, milliseconds
* Automatically configured on the server

CurrentRankingMaster

Currently Active Master Data

Currently active master data describing the ranking model definitions within the namespace. GS2 uses JSON format files for managing master data. By uploading these files, the master data settings are updated on the server.

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

TypeConditionRequiredDefaultValue LimitsDescription
namespaceIdstring
✓*
~ 1024 charsNamespace GRN
* Automatically configured on the server
settingsstring
~ 5242880 bytes (5MB)Master Data

CategoryModelMaster

Category Model Master

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

Different rankings can be created for different categories.

Categories can have a minimum and maximum score that can be registered, and scores outside of that range are discarded. When calculating rankings, it is possible to set whether the scores are to be ranked in ascending or descending order, with the smallest scores being ranked higher (ascending order) or the largest scores being ranked lower (descending order).

You can select global or scoped as the type of ranking. Global is a ranking where all players see the same results, and Scope is a ranking where each game player has a different result, such as a ranking among friends or a ranking in a guild.

For global ranking, you can set the ranking interval from 15 minutes to 24 hours for each category. Scope rankings reflect the calculate results in real time.

The ranking data has a setting called “generation,” and the registered scores can be reset by changing the generation.

TypeConditionRequiredDefaultValue LimitsDescription
categoryModelIdstring
✓*
~ 1024 charsCategory Master GRN
* Automatically configured on the server
namestring
~ 128 charsCategory Model Name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
metadatastring~ 1024 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
minimumValuelong0 ~ 9223372036854775805Minimum Score
maximumValuelong0 ~ 9223372036854775805Maximum Score
sumbool
falseAdd up the scores received and compete for the total value
orderDirectionString Enum
enum {
  “asc”,
  “desc”
}
Sort direction of scores
Enumerator String DefinitionDescription
“asc”ascending-order
“desc”descending-order
scopeString Enum
enum {
  “global”,
  “scoped”
}
Type of Ranking
Enumerator String DefinitionDescription
“global”Global
“scoped”Scoped
globalRankingSettingGlobalRankingSetting{scope} == “global”
✓*
Global Ranking Setting
* Required if scope is “global”
entryPeriodEventIdstring~ 1024 charsPeriod during which scores can be registered GS2-Schedule Event GRN
accessPeriodEventIdstring~ 1024 charsPeriod during which ranking data can be accessed GS2-Schedule Event GRN
createdAtlong
✓*
NowDatetime of creation
Unix time, milliseconds
* Automatically configured on the server
updatedAtlong
✓*
NowDatetime of last update
Unix time, milliseconds
* Automatically configured on the server
revisionlong00 ~ 9223372036854775805Revision

Methods

describeNamespaces

Get list of namespaces

Get a list of all namespaces in the project. You can use the optional page token to start acquiring data from a specific location in the list. You can also limit the number of namespaces to be acquired.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namePrefixstring~ 64 charsFilter by namespace name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint
301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<Namespace>List of Namespace
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 {
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2RankingRestClient(
    $session
);

try {
    $result = $client->describeNamespaces(
        (new DescribeNamespacesRequest())
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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()
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<Namespace> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Ranking.Request.DescribeNamespacesRequest()
        .WithNamePrefix(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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()
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

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

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

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

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

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

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

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

createNamespace

Create new namespace

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

Request

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction settings
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceThe created Namespace

Implementation Example

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("namespace-0001"),
        Description: nil,
        TransactionSetting: nil,
        LogSetting: &ranking.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2RankingRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withLogSetting((new \Gs2\Ranking\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withLogSetting(new io.gs2.ranking.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Ranking.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithLogSetting(new Gs2.Gs2Ranking.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withLogSetting(new Gs2Ranking.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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('namespace-0001')
            .with_description(None)
            .with_transaction_setting(None)
            .with_log_setting(
                ranking.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

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

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

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

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

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

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

result = api_result.result
item = result.item;

getNamespaceStatus

Get namespace status

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

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
statusstring

Implementation Example

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("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2RankingRestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName("namespace-0001")
    );
    $status = $result->getStatus();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Ranking.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
    );
    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('namespace-0001')
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

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

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

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

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

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

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

result = api_result.result
status = result.status;

getNamespace

Get namespace

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

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemNamespaceNamespace

Implementation Example

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

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Ranking.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-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_namespace(
        ranking.GetNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

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

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

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

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

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

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

result = api_result.result
item = result.item;

updateNamespace

Update namespace

Update the settings of the specified namespace. You can change the description of the namespace and specific settings.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction settings
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceThe updated namespace

Implementation Example

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("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        LogSetting: &ranking.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2RankingRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withLogSetting((new \Gs2\Ranking\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withLogSetting(new io.gs2.ranking.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Ranking.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithLogSetting(new Gs2.Gs2Ranking.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withLogSetting(new Gs2Ranking.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(None)
            .with_log_setting(
                ranking.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

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

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

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

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

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

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

result = api_result.result
item = result.item;

deleteNamespace

Delete namespace

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

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemNamespaceThe deleted Namespace

Implementation Example

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

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Ranking.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-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_namespace(
        ranking.DeleteNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

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

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

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

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

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

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

result = api_result.result
item = result.item;

getServiceVersion

Get version of microservice

Request

TypeConditionRequiredDefaultValue LimitsDescription

Result

TypeDescription
itemstringVersion

Implementation Example

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.GetServiceVersion(
    &ranking.GetServiceVersionRequest {
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\GetServiceVersionRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

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

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

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

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

AsyncResult<Gs2.Gs2Ranking.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
    new Gs2.Gs2Ranking.Request.GetServiceVersionRequest(),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.getServiceVersion(
        new Gs2Ranking.GetServiceVersionRequest()
    );
    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_service_version(
        ranking.GetServiceVersionRequest()
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.get_service_version({
})

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

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

api_result_handler = client.get_service_version_async({
})

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

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

result = api_result.result
item = result.item;

dumpUserDataByUserId

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

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 Gs2RankingRestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new 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['errorMessage'])
end

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

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

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

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

result = api_result.result

checkDumpUserDataByUserId

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

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL of output data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 Gs2RankingRestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new 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['errorMessage'])
end

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

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

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

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

result = api_result.result
url = result.url;

cleanUserDataByUserId

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

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 Gs2RankingRestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new 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['errorMessage'])
end

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

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

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

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

result = api_result.result

checkCleanUserDataByUserId

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

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 Gs2RankingRestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new 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['errorMessage'])
end

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

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

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

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

result = api_result.result

prepareImportUserDataByUserId

Start importing data associated with the specified user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
uploadTokenstringToken used to reflect results after upload
uploadUrlstringURL used to upload user data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 Gs2RankingRestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new 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['errorMessage'])
end

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

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

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

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

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

importUserDataByUserId

Start importing data associated with the specified user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
uploadTokenstring
~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 Gs2RankingRestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new 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['errorMessage'])
end

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

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

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

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

result = api_result.result

checkImportUserDataByUserId

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

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
uploadTokenstring
~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL of log data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 Gs2RankingRestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new 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['errorMessage'])
end

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

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

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

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

result = api_result.result
url = result.url;

subscribe

Subscribe to target users

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Name
accessTokenstring
~ 128 charsAccess token
targetUserIdstring
~ 128 charsTarget User ID

Result

TypeDescription
itemSubscribeUserSubscribed target users

Implementation Example

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("namespace-0001"),
        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 Gs2RankingRestClient(
    $session
);

try {
    $result = $client->subscribe(
        (new SubscribeRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withAccessToken("accessToken-0001")
            ->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("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    SubscribeUser item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.SubscribeResult> asyncResult = null;
yield return client.Subscribe(
    new Gs2.Gs2Ranking.Request.SubscribeRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .with_category_name('category-0001')
            .with_access_token('accessToken-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="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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

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

api_result_handler = client.subscribe_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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

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

result = api_result.result
item = result.item;

subscribeByUserId

Subscribe to the target user by user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Name
userIdstring
~ 128 charsUser ID
targetUserIdstring
~ 128 charsTarget User ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemSubscribeUserSubscribed target users

Implementation Example

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("namespace-0001"),
        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 Gs2RankingRestClient(
    $session
);

try {
    $result = $client->subscribeByUserId(
        (new SubscribeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    SubscribeUser item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.SubscribeByUserIdResult> asyncResult = null;
yield return client.SubscribeByUserId(
    new Gs2.Gs2Ranking.Request.SubscribeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    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['errorMessage'])
end

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

api_result_handler = client.subscribe_by_user_id_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    targetUserId="user-0002",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

describeScores

Get list of scores

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model name
accessTokenstring
~ 128 charsAccess token
scorerUserIdstring
~ 128 charsUser ID
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint
301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<Score>List of Scores
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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.DescribeScores(
    &ranking.DescribeScoresRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CategoryName: pointy.String("category-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ScorerUserId: pointy.String("user-0002"),
        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\DescribeScoresRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->describeScores(
        (new DescribeScoresRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withAccessToken("accessToken-0001")
            ->withScorerUserId("user-0002")
            ->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.DescribeScoresRequest;
import io.gs2.ranking.result.DescribeScoresResult;

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

try {
    DescribeScoresResult result = client.describeScores(
        new DescribeScoresRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withScorerUserId("user-0002")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Score> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.DescribeScoresResult> asyncResult = null;
yield return client.DescribeScores(
    new Gs2.Gs2Ranking.Request.DescribeScoresRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategoryName("category-0001")
        .WithAccessToken("accessToken-0001")
        .WithScorerUserId("user-0002")
        .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.describeScores(
        new Gs2Ranking.DescribeScoresRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withScorerUserId("user-0002")
            .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_scores(
        ranking.DescribeScoresRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_access_token('accessToken-0001')
            .with_scorer_user_id('user-0002')
            .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_scores({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    scorerUserId="user-0002",
    pageToken=nil,
    limit=nil,
})

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

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

api_result_handler = client.describe_scores_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    scorerUserId="user-0002",
    pageToken=nil,
    limit=nil,
})

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

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

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

describeScoresByUserId

Get list of scores by specifying a user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model name
userIdstring
~ 128 charsUser ID
scorerUserIdstring
~ 128 charsUser ID
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint
301 ~ 1000Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<Score>List of Scores
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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.DescribeScoresByUserId(
    &ranking.DescribeScoresByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CategoryName: pointy.String("category-0001"),
        UserId: pointy.String("user-0001"),
        ScorerUserId: pointy.String("user-0002"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\DescribeScoresByUserIdRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->describeScoresByUserId(
        (new DescribeScoresByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withUserId("user-0001")
            ->withScorerUserId("user-0002")
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.DescribeScoresByUserIdRequest;
import io.gs2.ranking.result.DescribeScoresByUserIdResult;

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

try {
    DescribeScoresByUserIdResult result = client.describeScoresByUserId(
        new DescribeScoresByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withScorerUserId("user-0002")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Score> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.DescribeScoresByUserIdResult> asyncResult = null;
yield return client.DescribeScoresByUserId(
    new Gs2.Gs2Ranking.Request.DescribeScoresByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategoryName("category-0001")
        .WithUserId("user-0001")
        .WithScorerUserId("user-0002")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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.describeScoresByUserId(
        new Gs2Ranking.DescribeScoresByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withScorerUserId("user-0002")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_scores_by_user_id(
        ranking.DescribeScoresByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_user_id('user-0001')
            .with_scorer_user_id('user-0002')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.describe_scores_by_user_id({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    scorerUserId="user-0002",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.describe_scores_by_user_id_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    scorerUserId="user-0002",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

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

getScore

Get Score

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Name
accessTokenstring
~ 128 charsAccess token
scorerUserIdstring
~ 128 charsUser ID
uniqueIdstring
“0”~ 36 charsScore Unique ID

Result

TypeDescription
itemScoreScore

Implementation Example

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.GetScore(
    &ranking.GetScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CategoryName: pointy.String("category-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ScorerUserId: pointy.String("user-0002"),
        UniqueId: pointy.String("unique-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\GetScoreRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->getScore(
        (new GetScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withAccessToken("accessToken-0001")
            ->withScorerUserId("user-0002")
            ->withUniqueId("unique-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.GetScoreRequest;
import io.gs2.ranking.result.GetScoreResult;

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

try {
    GetScoreResult result = client.getScore(
        new GetScoreRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withScorerUserId("user-0002")
            .withUniqueId("unique-0001")
    );
    Score item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetScoreResult> asyncResult = null;
yield return client.GetScore(
    new Gs2.Gs2Ranking.Request.GetScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategoryName("category-0001")
        .WithAccessToken("accessToken-0001")
        .WithScorerUserId("user-0002")
        .WithUniqueId("unique-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.getScore(
        new Gs2Ranking.GetScoreRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withScorerUserId("user-0002")
            .withUniqueId("unique-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_score(
        ranking.GetScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_access_token('accessToken-0001')
            .with_scorer_user_id('user-0002')
            .with_unique_id('unique-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.get_score({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    scorerUserId="user-0002",
    uniqueId="unique-0001",
})

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

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

api_result_handler = client.get_score_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    scorerUserId="user-0002",
    uniqueId="unique-0001",
})

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

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

result = api_result.result
item = result.item;

getScoreByUserId

Get score by specifying user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Name
userIdstring
~ 128 charsUser ID
scorerUserIdstring
~ 128 charsUser ID
uniqueIdstring
“0”~ 36 charsScore Unique ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemScoreScore

Implementation Example

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.GetScoreByUserId(
    &ranking.GetScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CategoryName: pointy.String("category-0001"),
        UserId: pointy.String("user-0001"),
        ScorerUserId: pointy.String("user-0002"),
        UniqueId: pointy.String("unique-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\GetScoreByUserIdRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->getScoreByUserId(
        (new GetScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withUserId("user-0001")
            ->withScorerUserId("user-0002")
            ->withUniqueId("unique-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.GetScoreByUserIdRequest;
import io.gs2.ranking.result.GetScoreByUserIdResult;

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

try {
    GetScoreByUserIdResult result = client.getScoreByUserId(
        new GetScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withScorerUserId("user-0002")
            .withUniqueId("unique-0001")
            .withTimeOffsetToken(null)
    );
    Score item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetScoreByUserIdResult> asyncResult = null;
yield return client.GetScoreByUserId(
    new Gs2.Gs2Ranking.Request.GetScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategoryName("category-0001")
        .WithUserId("user-0001")
        .WithScorerUserId("user-0002")
        .WithUniqueId("unique-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.getScoreByUserId(
        new Gs2Ranking.GetScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withScorerUserId("user-0002")
            .withUniqueId("unique-0001")
            .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.get_score_by_user_id(
        ranking.GetScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_user_id('user-0001')
            .with_scorer_user_id('user-0002')
            .with_unique_id('unique-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.get_score_by_user_id({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    scorerUserId="user-0002",
    uniqueId="unique-0001",
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.get_score_by_user_id_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    scorerUserId="user-0002",
    uniqueId="unique-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

describeRankings

Get Ranking

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model Name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring~ 128 charsAccess token
additionalScopeNamestring~ 128 charsScope Name
startIndexlong0 ~ 9223372036854775805Index to start retrieving rankings
pageTokenstring~ 4096 charsToken specifying the position from which to start acquiring data
limitint
301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<Ranking>List of Ranking Scores
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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.DescribeRankings(
    &ranking.DescribeRankingsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CategoryName: pointy.String("category-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        AdditionalScopeName: nil,
        StartIndex: pointy.Int64(0),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\DescribeRankingsRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->describeRankings(
        (new DescribeRankingsRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withAccessToken("accessToken-0001")
            ->withAdditionalScopeName(null)
            ->withStartIndex(0)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.DescribeRankingsRequest;
import io.gs2.ranking.result.DescribeRankingsResult;

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

try {
    DescribeRankingsResult result = client.describeRankings(
        new DescribeRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withAdditionalScopeName(null)
            .withStartIndex(0L)
            .withPageToken(null)
            .withLimit(null)
    );
    List<Ranking> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.DescribeRankingsResult> asyncResult = null;
yield return client.DescribeRankings(
    new Gs2.Gs2Ranking.Request.DescribeRankingsRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategoryName("category-0001")
        .WithAccessToken("accessToken-0001")
        .WithAdditionalScopeName(null)
        .WithStartIndex(0L)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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.describeRankings(
        new Gs2Ranking.DescribeRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withAdditionalScopeName(null)
            .withStartIndex(0)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_rankings(
        ranking.DescribeRankingsRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_access_token('accessToken-0001')
            .with_additional_scope_name(None)
            .with_start_index(0)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.describe_rankings({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    additionalScopeName=nil,
    startIndex=0,
    pageToken=nil,
    limit=nil,
})

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

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

api_result_handler = client.describe_rankings_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    additionalScopeName=nil,
    startIndex=0,
    pageToken=nil,
    limit=nil,
})

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

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

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

describeRankingssByUserId

Get ranking by user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model Name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring~ 128 charsUser ID
additionalScopeNamestring~ 128 charsScope Name
startIndexlong0 ~ 9223372036854775805Index to start retrieving rankings
pageTokenstring~ 4096 charsToken specifying the position from which to start acquiring data
limitint
301 ~ 1000Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<Ranking>List of Ranking Scores
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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.DescribeRankingssByUserId(
    &ranking.DescribeRankingssByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CategoryName: pointy.String("category-0001"),
        UserId: pointy.String("user-0001"),
        AdditionalScopeName: nil,
        StartIndex: pointy.Int64(0),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\DescribeRankingssByUserIdRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->describeRankingssByUserId(
        (new DescribeRankingssByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withUserId("user-0001")
            ->withAdditionalScopeName(null)
            ->withStartIndex(0)
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.DescribeRankingssByUserIdRequest;
import io.gs2.ranking.result.DescribeRankingssByUserIdResult;

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

try {
    DescribeRankingssByUserIdResult result = client.describeRankingssByUserId(
        new DescribeRankingssByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withAdditionalScopeName(null)
            .withStartIndex(0L)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Ranking> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.DescribeRankingssByUserIdResult> asyncResult = null;
yield return client.DescribeRankingssByUserId(
    new Gs2.Gs2Ranking.Request.DescribeRankingssByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategoryName("category-0001")
        .WithUserId("user-0001")
        .WithAdditionalScopeName(null)
        .WithStartIndex(0L)
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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.describeRankingssByUserId(
        new Gs2Ranking.DescribeRankingssByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withAdditionalScopeName(null)
            .withStartIndex(0)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_rankingss_by_user_id(
        ranking.DescribeRankingssByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_user_id('user-0001')
            .with_additional_scope_name(None)
            .with_start_index(0)
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.describe_rankingss_by_user_id({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    additionalScopeName=nil,
    startIndex=0,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.describe_rankingss_by_user_id_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    additionalScopeName=nil,
    startIndex=0,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

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

describeNearRankings

Get ranking near the specified score

This API is only available for global ranking

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model Name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
additionalScopeNamestring~ 128 charsScope Name
scorelong
0 ~ 9223372036854775805Score

Result

TypeDescription
itemsList<Ranking>List of Ranking Scores

Implementation Example

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.DescribeNearRankings(
    &ranking.DescribeNearRankingsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CategoryName: pointy.String("category-0001"),
        AdditionalScopeName: nil,
        Score: pointy.Int64(1000),
    }
)
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\DescribeNearRankingsRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->describeNearRankings(
        (new DescribeNearRankingsRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withAdditionalScopeName(null)
            ->withScore(1000)
    );
    $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.DescribeNearRankingsRequest;
import io.gs2.ranking.result.DescribeNearRankingsResult;

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

try {
    DescribeNearRankingsResult result = client.describeNearRankings(
        new DescribeNearRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAdditionalScopeName(null)
            .withScore(1000L)
    );
    List<Ranking> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.DescribeNearRankingsResult> asyncResult = null;
yield return client.DescribeNearRankings(
    new Gs2.Gs2Ranking.Request.DescribeNearRankingsRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategoryName("category-0001")
        .WithAdditionalScopeName(null)
        .WithScore(1000L),
    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.describeNearRankings(
        new Gs2Ranking.DescribeNearRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAdditionalScopeName(null)
            .withScore(1000)
    );
    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_near_rankings(
        ranking.DescribeNearRankingsRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_additional_scope_name(None)
            .with_score(1000)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.describe_near_rankings({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    additionalScopeName=nil,
    score=1000,
})

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

result = api_result.result
items = result.items;
client = gs2('ranking')

api_result_handler = client.describe_near_rankings_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    additionalScopeName=nil,
    score=1000,
})

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

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

result = api_result.result
items = result.items;

getRanking

Get Ranking

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model Name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
scorerUserIdstring
~ 128 charsUser ID of the user who earned the score
uniqueIdstring
“0”~ 36 charsScore Unique ID
additionalScopeNamestring~ 128 charsScope Name

Result

TypeDescription
itemRankingRanking

Implementation Example

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.GetRanking(
    &ranking.GetRankingRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CategoryName: pointy.String("category-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ScorerUserId: pointy.String("user-0001"),
        UniqueId: pointy.String("unique-id"),
        AdditionalScopeName: 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\GetRankingRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->getRanking(
        (new GetRankingRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withAccessToken("accessToken-0001")
            ->withScorerUserId("user-0001")
            ->withUniqueId("unique-id")
            ->withAdditionalScopeName(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.GetRankingRequest;
import io.gs2.ranking.result.GetRankingResult;

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

try {
    GetRankingResult result = client.getRanking(
        new GetRankingRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withScorerUserId("user-0001")
            .withUniqueId("unique-id")
            .withAdditionalScopeName(null)
    );
    Ranking item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetRankingResult> asyncResult = null;
yield return client.GetRanking(
    new Gs2.Gs2Ranking.Request.GetRankingRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategoryName("category-0001")
        .WithAccessToken("accessToken-0001")
        .WithScorerUserId("user-0001")
        .WithUniqueId("unique-id")
        .WithAdditionalScopeName(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.getRanking(
        new Gs2Ranking.GetRankingRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withScorerUserId("user-0001")
            .withUniqueId("unique-id")
            .withAdditionalScopeName(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.get_ranking(
        ranking.GetRankingRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_access_token('accessToken-0001')
            .with_scorer_user_id('user-0001')
            .with_unique_id('unique-id')
            .with_additional_scope_name(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.get_ranking({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    scorerUserId="user-0001",
    uniqueId="unique-id",
    additionalScopeName=nil,
})

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

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

api_result_handler = client.get_ranking_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    scorerUserId="user-0001",
    uniqueId="unique-id",
    additionalScopeName=nil,
})

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

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

result = api_result.result
item = result.item;

getRankingByUserId

Get ranking by user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model Name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID from which the ranking is obtained (used to determine the duration of the GS2-Schedule).
scorerUserIdstring
~ 128 charsUser ID of the user who earned the score
uniqueIdstring
“0”~ 36 charsScore Unique ID
additionalScopeNamestring~ 128 charsScope Name
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemRankingRanking

Implementation Example

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.GetRankingByUserId(
    &ranking.GetRankingByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CategoryName: pointy.String("category-0001"),
        UserId: pointy.String("user-0001"),
        ScorerUserId: pointy.String("user-0001"),
        UniqueId: pointy.String("unique-id"),
        AdditionalScopeName: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\GetRankingByUserIdRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->getRankingByUserId(
        (new GetRankingByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withUserId("user-0001")
            ->withScorerUserId("user-0001")
            ->withUniqueId("unique-id")
            ->withAdditionalScopeName(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.GetRankingByUserIdRequest;
import io.gs2.ranking.result.GetRankingByUserIdResult;

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

try {
    GetRankingByUserIdResult result = client.getRankingByUserId(
        new GetRankingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withScorerUserId("user-0001")
            .withUniqueId("unique-id")
            .withAdditionalScopeName(null)
            .withTimeOffsetToken(null)
    );
    Ranking item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetRankingByUserIdResult> asyncResult = null;
yield return client.GetRankingByUserId(
    new Gs2.Gs2Ranking.Request.GetRankingByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategoryName("category-0001")
        .WithUserId("user-0001")
        .WithScorerUserId("user-0001")
        .WithUniqueId("unique-id")
        .WithAdditionalScopeName(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.getRankingByUserId(
        new Gs2Ranking.GetRankingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withScorerUserId("user-0001")
            .withUniqueId("unique-id")
            .withAdditionalScopeName(null)
            .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.get_ranking_by_user_id(
        ranking.GetRankingByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_user_id('user-0001')
            .with_scorer_user_id('user-0001')
            .with_unique_id('unique-id')
            .with_additional_scope_name(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.get_ranking_by_user_id({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    scorerUserId="user-0001",
    uniqueId="unique-id",
    additionalScopeName=nil,
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.get_ranking_by_user_id_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    scorerUserId="user-0001",
    uniqueId="unique-id",
    additionalScopeName=nil,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

putScore

Register score

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model Name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
scorelong
0 ~ 9223372036854775805Score
metadatastring~ 512 charsMetadata

Result

TypeDescription
itemScoreRegistered Scores

Implementation Example

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.PutScore(
    &ranking.PutScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CategoryName: pointy.String("category-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Score: pointy.Int64(1000),
        Metadata: 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\PutScoreRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->putScore(
        (new PutScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withAccessToken("accessToken-0001")
            ->withScore(1000)
            ->withMetadata(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.PutScoreRequest;
import io.gs2.ranking.result.PutScoreResult;

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

try {
    PutScoreResult result = client.putScore(
        new PutScoreRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withScore(1000L)
            .withMetadata(null)
    );
    Score item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.PutScoreResult> asyncResult = null;
yield return client.PutScore(
    new Gs2.Gs2Ranking.Request.PutScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategoryName("category-0001")
        .WithAccessToken("accessToken-0001")
        .WithScore(1000L)
        .WithMetadata(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.putScore(
        new Gs2Ranking.PutScoreRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withScore(1000)
            .withMetadata(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.put_score(
        ranking.PutScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_access_token('accessToken-0001')
            .with_score(1000)
            .with_metadata(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.put_score({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    score=1000,
    metadata=nil,
})

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

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

api_result_handler = client.put_score_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    score=1000,
    metadata=nil,
})

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

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

result = api_result.result
item = result.item;

putScoreByUserId

Register scores by specifying user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model Name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
scorelong
0 ~ 9223372036854775805Score
metadatastring~ 512 charsMetadata
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemScoreRegistered Scores

Implementation Example

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.PutScoreByUserId(
    &ranking.PutScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CategoryName: pointy.String("category-0001"),
        UserId: pointy.String("user-0001"),
        Score: pointy.Int64(1000),
        Metadata: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\PutScoreByUserIdRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->putScoreByUserId(
        (new PutScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withUserId("user-0001")
            ->withScore(1000)
            ->withMetadata(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.PutScoreByUserIdRequest;
import io.gs2.ranking.result.PutScoreByUserIdResult;

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

try {
    PutScoreByUserIdResult result = client.putScoreByUserId(
        new PutScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withScore(1000L)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    Score item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.PutScoreByUserIdResult> asyncResult = null;
yield return client.PutScoreByUserId(
    new Gs2.Gs2Ranking.Request.PutScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategoryName("category-0001")
        .WithUserId("user-0001")
        .WithScore(1000L)
        .WithMetadata(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.putScoreByUserId(
        new Gs2Ranking.PutScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withScore(1000)
            .withMetadata(null)
            .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.put_score_by_user_id(
        ranking.PutScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_user_id('user-0001')
            .with_score(1000)
            .with_metadata(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.put_score_by_user_id({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    score=1000,
    metadata=nil,
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.put_score_by_user_id_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    score=1000,
    metadata=nil,
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

calcRanking

Forced execution of the ranking calculation process

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model name
additionalScopeNamestring~ 128 charsAdditional scope

Result

TypeDescription
processingboolthe aggregation process ongoing with asynchronous processing

Implementation Example

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.CalcRanking(
    &ranking.CalcRankingRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CategoryName: pointy.String("category-0001"),
        AdditionalScopeName: nil,
    }
)
if err != nil {
    panic("error occurred")
}
processing := result.Processing
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\CalcRankingRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->calcRanking(
        (new CalcRankingRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withAdditionalScopeName(null)
    );
    $processing = $result->getProcessing();
} 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.CalcRankingRequest;
import io.gs2.ranking.result.CalcRankingResult;

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

try {
    CalcRankingResult result = client.calcRanking(
        new CalcRankingRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAdditionalScopeName(null)
    );
    boolean processing = result.getProcessing();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.CalcRankingResult> asyncResult = null;
yield return client.CalcRanking(
    new Gs2.Gs2Ranking.Request.CalcRankingRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategoryName("category-0001")
        .WithAdditionalScopeName(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var processing = result.Processing;
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.calcRanking(
        new Gs2Ranking.CalcRankingRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAdditionalScopeName(null)
    );
    const processing = result.getProcessing();
} 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.calc_ranking(
        ranking.CalcRankingRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_additional_scope_name(None)
    )
    processing = result.processing
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.calc_ranking({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    additionalScopeName=nil,
})

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

result = api_result.result
processing = result.processing;
client = gs2('ranking')

api_result_handler = client.calc_ranking_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    additionalScopeName=nil,
})

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

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

result = api_result.result
processing = result.processing;

getSubscribe

Get Subscription

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Name
accessTokenstring
~ 128 charsAccess token
targetUserIdstring
~ 128 charsUser ID

Result

TypeDescription
itemSubscribeUserSubscription

Implementation Example

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.GetSubscribe(
    &ranking.GetSubscribeRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\GetSubscribeRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->getSubscribe(
        (new GetSubscribeRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withAccessToken("accessToken-0001")
            ->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.GetSubscribeRequest;
import io.gs2.ranking.result.GetSubscribeResult;

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

try {
    GetSubscribeResult result = client.getSubscribe(
        new GetSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    SubscribeUser item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetSubscribeResult> asyncResult = null;
yield return client.GetSubscribe(
    new Gs2.Gs2Ranking.Request.GetSubscribeRequest()
        .WithNamespaceName("namespace-0001")
        .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.getSubscribe(
        new Gs2Ranking.GetSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .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.get_subscribe(
        ranking.GetSubscribeRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_access_token('accessToken-0001')
            .with_target_user_id('user-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

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

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

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

api_result_handler = client.get_subscribe_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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

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

result = api_result.result
item = result.item;

getSubscribeByUserId

Get subscription by specifying user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Name
userIdstring
~ 128 charsUser ID
targetUserIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemSubscribeUserSubscription

Implementation Example

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.GetSubscribeByUserId(
    &ranking.GetSubscribeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\GetSubscribeByUserIdRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->getSubscribeByUserId(
        (new GetSubscribeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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.GetSubscribeByUserIdRequest;
import io.gs2.ranking.result.GetSubscribeByUserIdResult;

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

try {
    GetSubscribeByUserIdResult result = client.getSubscribeByUserId(
        new GetSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    SubscribeUser item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetSubscribeByUserIdResult> asyncResult = null;
yield return client.GetSubscribeByUserId(
    new Gs2.Gs2Ranking.Request.GetSubscribeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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.getSubscribeByUserId(
        new Gs2Ranking.GetSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .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.get_subscribe_by_user_id(
        ranking.GetSubscribeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .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.get_subscribe_by_user_id({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

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

api_result_handler = client.get_subscribe_by_user_id_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    targetUserId="user-0002",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

unsubscribe

Unsubscribe

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Name
accessTokenstring
~ 128 charsAccess token
targetUserIdstring
~ 128 charsTarget User ID

Result

TypeDescription
itemSubscribeUserUnsubscribed Subscription

Implementation Example

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.Unsubscribe(
    &ranking.UnsubscribeRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\UnsubscribeRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->unsubscribe(
        (new UnsubscribeRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withAccessToken("accessToken-0001")
            ->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.UnsubscribeRequest;
import io.gs2.ranking.result.UnsubscribeResult;

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

try {
    UnsubscribeResult result = client.unsubscribe(
        new UnsubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    SubscribeUser item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.UnsubscribeResult> asyncResult = null;
yield return client.Unsubscribe(
    new Gs2.Gs2Ranking.Request.UnsubscribeRequest()
        .WithNamespaceName("namespace-0001")
        .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.unsubscribe(
        new Gs2Ranking.UnsubscribeRequest()
            .withNamespaceName("namespace-0001")
            .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.unsubscribe(
        ranking.UnsubscribeRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_access_token('accessToken-0001')
            .with_target_user_id('user-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

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

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

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

api_result_handler = client.unsubscribe_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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

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

result = api_result.result
item = result.item;

unsubscribeByUserId

Unsubscribe with user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Name
userIdstring
~ 128 charsUser ID
targetUserIdstring
~ 128 charsTarget User ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemSubscribeUserUnsubscribed Subscription

Implementation Example

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.UnsubscribeByUserId(
    &ranking.UnsubscribeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\UnsubscribeByUserIdRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->unsubscribeByUserId(
        (new UnsubscribeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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.UnsubscribeByUserIdRequest;
import io.gs2.ranking.result.UnsubscribeByUserIdResult;

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

try {
    UnsubscribeByUserIdResult result = client.unsubscribeByUserId(
        new UnsubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    SubscribeUser item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.UnsubscribeByUserIdResult> asyncResult = null;
yield return client.UnsubscribeByUserId(
    new Gs2.Gs2Ranking.Request.UnsubscribeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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.unsubscribeByUserId(
        new Gs2Ranking.UnsubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .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.unsubscribe_by_user_id(
        ranking.UnsubscribeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .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.unsubscribe_by_user_id({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

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

api_result_handler = client.unsubscribe_by_user_id_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    targetUserId="user-0002",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

describeSubscribesByCategoryName

Obtaining a list of user IDs of subscribed users

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model name
accessTokenstring
~ 128 charsAccess token

Result

TypeDescription
itemsList<SubscribeUser>List of user IDs of subscribing users

Implementation Example

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.DescribeSubscribesByCategoryName(
    &ranking.DescribeSubscribesByCategoryNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CategoryName: pointy.String("category-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\DescribeSubscribesByCategoryNameRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->describeSubscribesByCategoryName(
        (new DescribeSubscribesByCategoryNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withAccessToken("accessToken-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.DescribeSubscribesByCategoryNameRequest;
import io.gs2.ranking.result.DescribeSubscribesByCategoryNameResult;

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

try {
    DescribeSubscribesByCategoryNameResult result = client.describeSubscribesByCategoryName(
        new DescribeSubscribesByCategoryNameRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
    );
    List<SubscribeUser> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.DescribeSubscribesByCategoryNameResult> asyncResult = null;
yield return client.DescribeSubscribesByCategoryName(
    new Gs2.Gs2Ranking.Request.DescribeSubscribesByCategoryNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategoryName("category-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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.describeSubscribesByCategoryName(
        new Gs2Ranking.DescribeSubscribesByCategoryNameRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withAccessToken("accessToken-0001")
    );
    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_subscribes_by_category_name(
        ranking.DescribeSubscribesByCategoryNameRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_access_token('accessToken-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.describe_subscribes_by_category_name({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
})

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

result = api_result.result
items = result.items;
client = gs2('ranking')

api_result_handler = client.describe_subscribes_by_category_name_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    accessToken="accessToken-0001",
})

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

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

result = api_result.result
items = result.items;

describeSubscribesByCategoryNameAndUserId

Obtaining a list of users to which the user is subscribed by specifying the user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model name
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<SubscribeUser>List of user IDs of subscribing users

Implementation Example

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.DescribeSubscribesByCategoryNameAndUserId(
    &ranking.DescribeSubscribesByCategoryNameAndUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CategoryName: pointy.String("category-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
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\DescribeSubscribesByCategoryNameAndUserIdRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->describeSubscribesByCategoryNameAndUserId(
        (new DescribeSubscribesByCategoryNameAndUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategoryName("category-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $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.DescribeSubscribesByCategoryNameAndUserIdRequest;
import io.gs2.ranking.result.DescribeSubscribesByCategoryNameAndUserIdResult;

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

try {
    DescribeSubscribesByCategoryNameAndUserIdResult result = client.describeSubscribesByCategoryNameAndUserId(
        new DescribeSubscribesByCategoryNameAndUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    List<SubscribeUser> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.DescribeSubscribesByCategoryNameAndUserIdResult> asyncResult = null;
yield return client.DescribeSubscribesByCategoryNameAndUserId(
    new Gs2.Gs2Ranking.Request.DescribeSubscribesByCategoryNameAndUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategoryName("category-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    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.describeSubscribesByCategoryNameAndUserId(
        new Gs2Ranking.DescribeSubscribesByCategoryNameAndUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withCategoryName("category-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    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_subscribes_by_category_name_and_user_id(
        ranking.DescribeSubscribesByCategoryNameAndUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_category_name('category-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.describe_subscribes_by_category_name_and_user_id({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
items = result.items;
client = gs2('ranking')

api_result_handler = client.describe_subscribes_by_category_name_and_user_id_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
items = result.items;

describeCategoryModels

Get list of category models

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemsList<CategoryModel>List of Category Models

Implementation Example

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("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2RankingRestClient(
    $session
);

try {
    $result = $client->describeCategoryModels(
        (new DescribeCategoryModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
    );
    List<CategoryModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.DescribeCategoryModelsResult> asyncResult = null;
yield return client.DescribeCategoryModels(
    new Gs2.Gs2Ranking.Request.DescribeCategoryModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
    );
    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('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

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

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

result = api_result.result
items = result.items;
client = gs2('ranking')

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

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

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

result = api_result.result
items = result.items;

getCategoryModel

Get category model

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model Name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCategoryModelCategory Model

Implementation Example

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("namespace-0001"),
        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 Gs2RankingRestClient(
    $session
);

try {
    $result = $client->getCategoryModel(
        (new GetCategoryModelRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withCategoryName("category-0001")
    );
    CategoryModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetCategoryModelResult> asyncResult = null;
yield return client.GetCategoryModel(
    new Gs2.Gs2Ranking.Request.GetCategoryModelRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    categoryName="category-0001",
})

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

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

api_result_handler = client.get_category_model_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
})

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

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

result = api_result.result
item = result.item;

exportMaster

Export Model Master in a master data format that can be activated

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCurrentRankingMastermaster data that can be activated

Implementation Example

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.ExportMaster(
    &ranking.ExportMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\ExportMasterRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->exportMaster(
        (new ExportMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.ExportMasterRequest;
import io.gs2.ranking.result.ExportMasterResult;

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

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentRankingMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Ranking.Request.ExportMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.exportMaster(
        new Gs2Ranking.ExportMasterRequest()
            .withNamespaceName("namespace-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.export_master(
        ranking.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

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

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

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

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

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

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

result = api_result.result
item = result.item;

getCurrentRankingMaster

Get Currently Active Ranking Model Master Data

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCurrentRankingMasterCurrently Active Ranking Model Master Data

Implementation Example

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.GetCurrentRankingMaster(
    &ranking.GetCurrentRankingMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\GetCurrentRankingMasterRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->getCurrentRankingMaster(
        (new GetCurrentRankingMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.GetCurrentRankingMasterRequest;
import io.gs2.ranking.result.GetCurrentRankingMasterResult;

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

try {
    GetCurrentRankingMasterResult result = client.getCurrentRankingMaster(
        new GetCurrentRankingMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentRankingMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetCurrentRankingMasterResult> asyncResult = null;
yield return client.GetCurrentRankingMaster(
    new Gs2.Gs2Ranking.Request.GetCurrentRankingMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.getCurrentRankingMaster(
        new Gs2Ranking.GetCurrentRankingMasterRequest()
            .withNamespaceName("namespace-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_current_ranking_master(
        ranking.GetCurrentRankingMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

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

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

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

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

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

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

result = api_result.result
item = result.item;

preUpdateCurrentRankingMaster

Update Currently Active Ranking Model Master Data (3-phase version)

When uploading master data larger than 1MB, the update is performed in 3 phases.

  1. Execute this API to obtain a token and URL for uploading.
  2. Upload the master data to the obtained URL.
  3. Execute UpdateCurrentModelMaster by passing the token obtained from the the upload to reflect the master data.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
uploadTokenstringToken used to reflect results after upload
uploadUrlstringURL used to upload

Implementation Example

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.PreUpdateCurrentRankingMaster(
    &ranking.PreUpdateCurrentRankingMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\PreUpdateCurrentRankingMasterRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentRankingMaster(
        (new PreUpdateCurrentRankingMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.PreUpdateCurrentRankingMasterRequest;
import io.gs2.ranking.result.PreUpdateCurrentRankingMasterResult;

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

try {
    PreUpdateCurrentRankingMasterResult result = client.preUpdateCurrentRankingMaster(
        new PreUpdateCurrentRankingMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.PreUpdateCurrentRankingMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentRankingMaster(
    new Gs2.Gs2Ranking.Request.PreUpdateCurrentRankingMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as 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.preUpdateCurrentRankingMaster(
        new Gs2Ranking.PreUpdateCurrentRankingMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    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.pre_update_current_ranking_master(
        ranking.PreUpdateCurrentRankingMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

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

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

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

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

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

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

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

updateCurrentRankingMaster

Update Currently Active Ranking Model Master Data

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
modeString Enum
enum {
  “direct”,
  “preUpload”
}
“direct”Update mode
Enumerator String DefinitionDescription
“direct”Directly update master data
“preUpload”Upload master data and then update
settingsstring{mode} == “direct”
✓*
~ 5242880 charsMaster Data
* Required if mode is “direct”
uploadTokenstring{mode} == “preUpload”
✓*
~ 1024 charsToken obtained by pre-upload
Used to apply the uploaded master data.

* Required if mode is “preUpload”

Result

TypeDescription
itemCurrentRankingMasterUpdated Currently Active Ranking Model Master Data

Implementation Example

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.UpdateCurrentRankingMaster(
    &ranking.UpdateCurrentRankingMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\n  \"version\": \"2019-09-17\",\n  \"categoryModels\": [\n    {\n      \"name\": \"category-0001\",\n      \"orderDirection\": \"asc\",\n      \"scope\": \"global\",\n      \"uniqueByUserId\": false,\n      \"sum\": false,\n      \"calculateFixedTimingHour\": -1,\n      \"calculateFixedTimingMinute\": 0,\n      \"calculateIntervalMinutes\": 15,\n      \"additionalScopes\": [\n        {\n          \"name\": \"daily\",\n          \"targetDays\": 1\n        },\n        {\n          \"name\": \"weekly\",\n          \"targetDays\": 7\n        }\n      ],\n      \"ignoreUserIds\": []\n    },\n    {\n      \"name\": \"category-0002\",\n      \"metadata\": \"CATEGORY_0002\",\n      \"minimumValue\": 1000,\n      \"maximumValue\": 100000,\n      \"orderDirection\": \"asc\",\n      \"scope\": \"scoped\",\n      \"uniqueByUserId\": true,\n      \"sum\": false,\n      \"calculateFixedTimingHour\": -1,\n      \"calculateFixedTimingMinute\": 0,\n      \"calculateIntervalMinutes\": 60,\n      \"additionalScopes\": [],\n      \"ignoreUserIds\": []\n    }\n  ]\n}"),
        UploadToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\UpdateCurrentRankingMasterRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->updateCurrentRankingMaster(
        (new UpdateCurrentRankingMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\n  \"version\": \"2019-09-17\",\n  \"categoryModels\": [\n    {\n      \"name\": \"category-0001\",\n      \"orderDirection\": \"asc\",\n      \"scope\": \"global\",\n      \"uniqueByUserId\": false,\n      \"sum\": false,\n      \"calculateFixedTimingHour\": -1,\n      \"calculateFixedTimingMinute\": 0,\n      \"calculateIntervalMinutes\": 15,\n      \"additionalScopes\": [\n        {\n          \"name\": \"daily\",\n          \"targetDays\": 1\n        },\n        {\n          \"name\": \"weekly\",\n          \"targetDays\": 7\n        }\n      ],\n      \"ignoreUserIds\": []\n    },\n    {\n      \"name\": \"category-0002\",\n      \"metadata\": \"CATEGORY_0002\",\n      \"minimumValue\": 1000,\n      \"maximumValue\": 100000,\n      \"orderDirection\": \"asc\",\n      \"scope\": \"scoped\",\n      \"uniqueByUserId\": true,\n      \"sum\": false,\n      \"calculateFixedTimingHour\": -1,\n      \"calculateFixedTimingMinute\": 0,\n      \"calculateIntervalMinutes\": 60,\n      \"additionalScopes\": [],\n      \"ignoreUserIds\": []\n    }\n  ]\n}")
            ->withUploadToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.UpdateCurrentRankingMasterRequest;
import io.gs2.ranking.result.UpdateCurrentRankingMasterResult;

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

try {
    UpdateCurrentRankingMasterResult result = client.updateCurrentRankingMaster(
        new UpdateCurrentRankingMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2019-09-17\",\n  \"categoryModels\": [\n    {\n      \"name\": \"category-0001\",\n      \"orderDirection\": \"asc\",\n      \"scope\": \"global\",\n      \"uniqueByUserId\": false,\n      \"sum\": false,\n      \"calculateFixedTimingHour\": -1,\n      \"calculateFixedTimingMinute\": 0,\n      \"calculateIntervalMinutes\": 15,\n      \"additionalScopes\": [\n        {\n          \"name\": \"daily\",\n          \"targetDays\": 1\n        },\n        {\n          \"name\": \"weekly\",\n          \"targetDays\": 7\n        }\n      ],\n      \"ignoreUserIds\": []\n    },\n    {\n      \"name\": \"category-0002\",\n      \"metadata\": \"CATEGORY_0002\",\n      \"minimumValue\": 1000,\n      \"maximumValue\": 100000,\n      \"orderDirection\": \"asc\",\n      \"scope\": \"scoped\",\n      \"uniqueByUserId\": true,\n      \"sum\": false,\n      \"calculateFixedTimingHour\": -1,\n      \"calculateFixedTimingMinute\": 0,\n      \"calculateIntervalMinutes\": 60,\n      \"additionalScopes\": [],\n      \"ignoreUserIds\": []\n    }\n  ]\n}")
            .withUploadToken(null)
    );
    CurrentRankingMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.UpdateCurrentRankingMasterResult> asyncResult = null;
yield return client.UpdateCurrentRankingMaster(
    new Gs2.Gs2Ranking.Request.UpdateCurrentRankingMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\n  \"version\": \"2019-09-17\",\n  \"categoryModels\": [\n    {\n      \"name\": \"category-0001\",\n      \"orderDirection\": \"asc\",\n      \"scope\": \"global\",\n      \"uniqueByUserId\": false,\n      \"sum\": false,\n      \"calculateFixedTimingHour\": -1,\n      \"calculateFixedTimingMinute\": 0,\n      \"calculateIntervalMinutes\": 15,\n      \"additionalScopes\": [\n        {\n          \"name\": \"daily\",\n          \"targetDays\": 1\n        },\n        {\n          \"name\": \"weekly\",\n          \"targetDays\": 7\n        }\n      ],\n      \"ignoreUserIds\": []\n    },\n    {\n      \"name\": \"category-0002\",\n      \"metadata\": \"CATEGORY_0002\",\n      \"minimumValue\": 1000,\n      \"maximumValue\": 100000,\n      \"orderDirection\": \"asc\",\n      \"scope\": \"scoped\",\n      \"uniqueByUserId\": true,\n      \"sum\": false,\n      \"calculateFixedTimingHour\": -1,\n      \"calculateFixedTimingMinute\": 0,\n      \"calculateIntervalMinutes\": 60,\n      \"additionalScopes\": [],\n      \"ignoreUserIds\": []\n    }\n  ]\n}")
        .WithUploadToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.updateCurrentRankingMaster(
        new Gs2Ranking.UpdateCurrentRankingMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2019-09-17\",\n  \"categoryModels\": [\n    {\n      \"name\": \"category-0001\",\n      \"orderDirection\": \"asc\",\n      \"scope\": \"global\",\n      \"uniqueByUserId\": false,\n      \"sum\": false,\n      \"calculateFixedTimingHour\": -1,\n      \"calculateFixedTimingMinute\": 0,\n      \"calculateIntervalMinutes\": 15,\n      \"additionalScopes\": [\n        {\n          \"name\": \"daily\",\n          \"targetDays\": 1\n        },\n        {\n          \"name\": \"weekly\",\n          \"targetDays\": 7\n        }\n      ],\n      \"ignoreUserIds\": []\n    },\n    {\n      \"name\": \"category-0002\",\n      \"metadata\": \"CATEGORY_0002\",\n      \"minimumValue\": 1000,\n      \"maximumValue\": 100000,\n      \"orderDirection\": \"asc\",\n      \"scope\": \"scoped\",\n      \"uniqueByUserId\": true,\n      \"sum\": false,\n      \"calculateFixedTimingHour\": -1,\n      \"calculateFixedTimingMinute\": 0,\n      \"calculateIntervalMinutes\": 60,\n      \"additionalScopes\": [],\n      \"ignoreUserIds\": []\n    }\n  ]\n}")
            .withUploadToken(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_current_ranking_master(
        ranking.UpdateCurrentRankingMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{\n  "version": "2019-09-17",\n  "categoryModels": [\n    {\n      "name": "category-0001",\n      "orderDirection": "asc",\n      "scope": "global",\n      "uniqueByUserId": false,\n      "sum": false,\n      "calculateFixedTimingHour": -1,\n      "calculateFixedTimingMinute": 0,\n      "calculateIntervalMinutes": 15,\n      "additionalScopes": [\n        {\n          "name": "daily",\n          "targetDays": 1\n        },\n        {\n          "name": "weekly",\n          "targetDays": 7\n        }\n      ],\n      "ignoreUserIds": []\n    },\n    {\n      "name": "category-0002",\n      "metadata": "CATEGORY_0002",\n      "minimumValue": 1000,\n      "maximumValue": 100000,\n      "orderDirection": "asc",\n      "scope": "scoped",\n      "uniqueByUserId": true,\n      "sum": false,\n      "calculateFixedTimingHour": -1,\n      "calculateFixedTimingMinute": 0,\n      "calculateIntervalMinutes": 60,\n      "additionalScopes": [],\n      "ignoreUserIds": []\n    }\n  ]\n}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

api_result = client.update_current_ranking_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2019-09-17\",\n  \"categoryModels\": [\n    {\n      \"name\": \"category-0001\",\n      \"orderDirection\": \"asc\",\n      \"scope\": \"global\",\n      \"uniqueByUserId\": false,\n      \"sum\": false,\n      \"calculateFixedTimingHour\": -1,\n      \"calculateFixedTimingMinute\": 0,\n      \"calculateIntervalMinutes\": 15,\n      \"additionalScopes\": [\n        {\n          \"name\": \"daily\",\n          \"targetDays\": 1\n        },\n        {\n          \"name\": \"weekly\",\n          \"targetDays\": 7\n        }\n      ],\n      \"ignoreUserIds\": []\n    },\n    {\n      \"name\": \"category-0002\",\n      \"metadata\": \"CATEGORY_0002\",\n      \"minimumValue\": 1000,\n      \"maximumValue\": 100000,\n      \"orderDirection\": \"asc\",\n      \"scope\": \"scoped\",\n      \"uniqueByUserId\": true,\n      \"sum\": false,\n      \"calculateFixedTimingHour\": -1,\n      \"calculateFixedTimingMinute\": 0,\n      \"calculateIntervalMinutes\": 60,\n      \"additionalScopes\": [],\n      \"ignoreUserIds\": []\n    }\n  ]\n}",
    uploadToken=nil,
})

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

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

api_result_handler = client.update_current_ranking_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2019-09-17\",\n  \"categoryModels\": [\n    {\n      \"name\": \"category-0001\",\n      \"orderDirection\": \"asc\",\n      \"scope\": \"global\",\n      \"uniqueByUserId\": false,\n      \"sum\": false,\n      \"calculateFixedTimingHour\": -1,\n      \"calculateFixedTimingMinute\": 0,\n      \"calculateIntervalMinutes\": 15,\n      \"additionalScopes\": [\n        {\n          \"name\": \"daily\",\n          \"targetDays\": 1\n        },\n        {\n          \"name\": \"weekly\",\n          \"targetDays\": 7\n        }\n      ],\n      \"ignoreUserIds\": []\n    },\n    {\n      \"name\": \"category-0002\",\n      \"metadata\": \"CATEGORY_0002\",\n      \"minimumValue\": 1000,\n      \"maximumValue\": 100000,\n      \"orderDirection\": \"asc\",\n      \"scope\": \"scoped\",\n      \"uniqueByUserId\": true,\n      \"sum\": false,\n      \"calculateFixedTimingHour\": -1,\n      \"calculateFixedTimingMinute\": 0,\n      \"calculateIntervalMinutes\": 60,\n      \"additionalScopes\": [],\n      \"ignoreUserIds\": []\n    }\n  ]\n}",
    uploadToken=nil,
})

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

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

result = api_result.result
item = result.item;

updateCurrentRankingMasterFromGitHub

Update Currently Active Ranking Model Master Data from GitHub

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
checkoutSettingGitHubCheckoutSetting
Setup to check out master data from GitHub

Result

TypeDescription
itemCurrentRankingMasterUpdated Currently Active Ranking Model Master Data

Implementation Example

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.UpdateCurrentRankingMasterFromGitHub(
    &ranking.UpdateCurrentRankingMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &ranking.GitHubCheckoutSetting{
            ApiKeyId: pointy.String("apiKeyId-0001"),
            RepositoryName: pointy.String("gs2io/master-data"),
            SourcePath: pointy.String("path/to/file.json"),
            ReferenceType: pointy.String("branch"),
            BranchName: pointy.String("develop"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking\Gs2RankingRestClient;
use Gs2\Ranking\Request\UpdateCurrentRankingMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2RankingRestClient(
    $session
);

try {
    $result = $client->updateCurrentRankingMasterFromGitHub(
        (new UpdateCurrentRankingMasterFromGitHubRequest())
            ->withNamespaceName("namespace-0001")
            ->withCheckoutSetting((new GitHubCheckoutSetting())
                ->withApiKeyId("apiKeyId-0001")
                ->withRepositoryName("gs2io/master-data")
                ->withSourcePath("path/to/file.json")
                ->withReferenceType("branch")
                ->withBranchName("develop")
            )
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.ranking.rest.Gs2RankingRestClient;
import io.gs2.ranking.request.UpdateCurrentRankingMasterFromGitHubRequest;
import io.gs2.ranking.result.UpdateCurrentRankingMasterFromGitHubResult;

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

try {
    UpdateCurrentRankingMasterFromGitHubResult result = client.updateCurrentRankingMasterFromGitHub(
        new UpdateCurrentRankingMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentRankingMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.UpdateCurrentRankingMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentRankingMasterFromGitHub(
    new Gs2.Gs2Ranking.Request.UpdateCurrentRankingMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Ranking.Model.GitHubCheckoutSetting()
            .WithApiKeyId("apiKeyId-0001")
            .WithRepositoryName("gs2io/master-data")
            .WithSourcePath("path/to/file.json")
            .WithReferenceType("branch")
            .WithBranchName("develop")
        ),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.updateCurrentRankingMasterFromGitHub(
        new Gs2Ranking.UpdateCurrentRankingMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Ranking.model.GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_current_ranking_master_from_git_hub(
        ranking.UpdateCurrentRankingMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(ranking.GitHubCheckoutSetting()
                .with_api_key_id('apiKeyId-0001')
                .with_repository_name('gs2io/master-data')
                .with_source_path('path/to/file.json')
                .with_reference_type('branch')
                .with_branch_name('develop')
            )
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

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

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

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

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

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

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

result = api_result.result
item = result.item;

describeCategoryModelMasters

Get list of category model masters

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefixstring~ 64 charsFilter by category model name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint
301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<CategoryModelMaster>List of Category Model Masters
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2RankingRestClient(
    $session
);

try {
    $result = $client->describeCategoryModelMasters(
        (new DescribeCategoryModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<CategoryModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.DescribeCategoryModelMastersResult> asyncResult = null;
yield return client.DescribeCategoryModelMasters(
    new Gs2.Gs2Ranking.Request.DescribeCategoryModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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('namespace-0001')
            .with_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking')

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

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

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

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

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

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

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

createCategoryModelMaster

Create a new category model master

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namestring
~ 128 charsCategory Model Name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
metadatastring~ 1024 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
minimumValuelong0 ~ 9223372036854775805Minimum Score
maximumValuelong0 ~ 9223372036854775805Maximum Score
orderDirectionString Enum
enum {
  “asc”,
  “desc”
}
Sort direction of scores
Enumerator String DefinitionDescription
“asc”ascending-order
“desc”descending-order
scopeString Enum
enum {
  “global”,
  “scoped”
}
Type of Ranking
Enumerator String DefinitionDescription
“global”Global
“scoped”Scoped
globalRankingSettingGlobalRankingSetting{scope} == “global”
✓*
Global Ranking Setting
* Required if scope is “global”
entryPeriodEventIdstring~ 1024 charsPeriod during which scores can be registered GS2-Schedule Event GRN
accessPeriodEventIdstring~ 1024 charsPeriod during which ranking data can be accessed GS2-Schedule Event GRN
sumbool
falseAdd up the scores received and compete for the total value

Result

TypeDescription
itemCategoryModelMasterCreated category model master

Implementation Example

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("namespace-0001"),
        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 Gs2RankingRestClient(
    $session
);

try {
    $result = $client->createCategoryModelMaster(
        (new CreateCategoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.CreateCategoryModelMasterResult> asyncResult = null;
yield return client.CreateCategoryModelMaster(
    new Gs2.Gs2Ranking.Request.CreateCategoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    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['errorMessage'])
end

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

api_result_handler = client.create_category_model_master_async({
    namespaceName="namespace-0001",
    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,
})

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

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

result = api_result.result
item = result.item;

getCategoryModelMaster

Get Category Model Master

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model Name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCategoryModelMasterCategory Model Master

Implementation Example

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("namespace-0001"),
        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 Gs2RankingRestClient(
    $session
);

try {
    $result = $client->getCategoryModelMaster(
        (new GetCategoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withCategoryName("category-0001")
    );
    CategoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.GetCategoryModelMasterResult> asyncResult = null;
yield return client.GetCategoryModelMaster(
    new Gs2.Gs2Ranking.Request.GetCategoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    categoryName="category-0001",
})

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

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

api_result_handler = client.get_category_model_master_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
})

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

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

result = api_result.result
item = result.item;

updateCategoryModelMaster

Update Category Model Master

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model Name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
metadatastring~ 1024 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
minimumValuelong0 ~ 9223372036854775805Minimum Score
maximumValuelong0 ~ 9223372036854775805Maximum Score
orderDirectionString Enum
enum {
  “asc”,
  “desc”
}
Sort direction of scores
Enumerator String DefinitionDescription
“asc”ascending-order
“desc”descending-order
scopeString Enum
enum {
  “global”,
  “scoped”
}
Type of Ranking
Enumerator String DefinitionDescription
“global”Global
“scoped”Scoped
globalRankingSettingGlobalRankingSetting{scope} == “global”
✓*
Global Ranking Setting
* Required if scope is “global”
entryPeriodEventIdstring~ 1024 charsPeriod during which scores can be registered GS2-Schedule Event GRN
accessPeriodEventIdstring~ 1024 charsPeriod during which ranking data can be accessed GS2-Schedule Event GRN
sumbool
falseAdd up the scores received and compete for the total value

Result

TypeDescription
itemCategoryModelMasterUpdated Category Model Master

Implementation Example

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("namespace-0001"),
        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 Gs2RankingRestClient(
    $session
);

try {
    $result = $client->updateCategoryModelMaster(
        (new UpdateCategoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.UpdateCategoryModelMasterResult> asyncResult = null;
yield return client.UpdateCategoryModelMaster(
    new Gs2.Gs2Ranking.Request.UpdateCategoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    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['errorMessage'])
end

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

api_result_handler = client.update_category_model_master_async({
    namespaceName="namespace-0001",
    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,
})

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

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

result = api_result.result
item = result.item;

deleteCategoryModelMaster

Delete Category Model Master

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
categoryNamestring
~ 128 charsCategory Model Name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCategoryModelMasterDeleted Category Model Master

Implementation Example

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("namespace-0001"),
        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 Gs2RankingRestClient(
    $session
);

try {
    $result = $client->deleteCategoryModelMaster(
        (new DeleteCategoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withCategoryName("category-0001")
    );
    CategoryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

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

AsyncResult<Gs2.Gs2Ranking.Result.DeleteCategoryModelMasterResult> asyncResult = null;
yield return client.DeleteCategoryModelMaster(
    new Gs2.Gs2Ranking.Request.DeleteCategoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    categoryName="category-0001",
})

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

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

api_result_handler = client.delete_category_model_master_async({
    namespaceName="namespace-0001",
    categoryName="category-0001",
})

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

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

result = api_result.result
item = result.item;