API Reference of GS2-SeasonRating SDK

Model

Namespace

Namespace

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

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

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsNamespace GRN
namestring~ 32 charsNamespace name
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction settings
logSettingLogSettingLog output settings
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

MatchSession

Session

TypeConditionRequireDefaultLimitationDescription
sessionIdstring~ 1024 charsMatchSession GRN
namestringUUID~ 128 charsSession Name
createdAtlongDatetime of creation
revisionlong0~ 9223372036854775805Revision

SeasonModelMaster

Season Model Master

GS2 uses Glicko-2 as its rating algorithm. Glicko-2 has several parameters, but GS2-Matchmaking aggregates them into a single parameter, volatility, which represents the totality of the parameters. Volatility is a parameter that expresses the magnitude of change; the larger the value, the greater the change in the rating value.

TypeConditionRequireDefaultLimitationDescription
seasonModelIdstring~ 1024 charsSeason Model Master GRN
namestring~ 128 charsSeason Model Name
metadatastring~ 128 charsmetadata
descriptionstring~ 1024 charsDescription
tiersList<TierModel>1 ~ 100 itemsList of Tier
experienceModelIdstring~ 1024 charsExperience Model GRN
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN that sets the period during which the season is open.
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

SeasonModel

Season Model

GS2 uses Glicko-2 as its rating algorithm. Glicko-2 has several parameters, but GS2-Matchmaking aggregates them into a single parameter, volatility, which represents the totality of the parameters. Volatility is a parameter that expresses the magnitude of change; the larger the value, the greater the change in the rating value.

TypeConditionRequireDefaultLimitationDescription
seasonModelIdstring~ 1024 charsSeason Model GRN
namestring~ 128 charsSeason Model Name
metadatastring~ 128 charsmetadata
tiersList<TierModel>1 ~ 100 itemsList of Tier
experienceModelIdstring~ 1024 charsExperience Model GRN
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN that sets the period during which the season is open.

TierModel

Tear model

TypeConditionRequireDefaultLimitationDescription
metadatastring~ 128 charsmetadata
raiseRankBonusint~ 10000The bonus points added to prevent immediate rank demotion when the rank is promoted.
entryFeeint~ 10000Points to be subtracted as an entry fee to start the game.
minimumChangePointint~ -1Change point minimum value when losing
maximumChangePointint1 ~ 99999999Change point maximum value when winning

CurrentSeasonModelMaster

Currently available master data

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

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

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

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

TransactionSetting

Transaction settings

TypeConditionRequireDefaultLimitationDescription
distributorNamespaceIdstring“grn:gs2:{region}:{ownerId}:distributor:default”~ 1024 charsGS2-Distributor namespace used for stamp sheet execution
queueNamespaceIdstring“grn:gs2:{region}:{ownerId}:queue:default”~ 1024 charsNamespace in GS2-JobQueue used to run the stamp sheet

ScriptSetting

Script settings

In GS2, you can associate custom scripts with microservice events and execute them. This model holds the settings for triggering script execution.

There are two main ways to execute a script: synchronous execution and asynchronous execution. Synchronous execution blocks processing until the script has finished executing. Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API.

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

There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge. By using Amazon EventBridge, you can write processing in languages other than Lua.

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

LogSetting

Log setting

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

TypeConditionRequireDefaultLimitationDescription
loggingNamespaceIdstring~ 1024 charsNamespace GRN

GitHubCheckoutSetting

Setup to check out master data from GitHub

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

GameResult

Match Results

TypeConditionRequireDefaultLimitationDescription
rankint~ 2147483646Rank
userIdstring~ 128 charsUser Id

Ballot

Ballot Paper

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
seasonNamestring~ 128 charsRating name used for rating calculations
sessionNamestring~ 128 charsName of MatchSession to be voted
numberOfPlayerint2 ~ 10Number of participants

SignedBallot

Ballot with signatures

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

WrittenBallot

Ballot Paper

TypeConditionRequireDefaultLimitationDescription
ballotBallotBallot
gameResultsList<GameResult>~ 10 itemsList of Results

Vote

Voting Situation

TypeConditionRequireDefaultLimitationDescription
voteIdstring~ 1024 charsVote GRN
seasonNamestring~ 128 charsRating Name
sessionNamestring~ 128 charsMatchSession Name
writtenBallotsList<WrittenBallot>[]~ 10 itemsList of Ballots
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

Methods

describeNamespaces

Get list of namespaces

Request

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

Result

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

Implementation Example

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

createNamespace

Create a new namespace

Request

TypeConditionRequireDefaultLimitationDescription
namestring~ 32 charsNamespace name
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction settings
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceNamespace created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &season_rating.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        TransactionSetting: nil,
        LogSetting: &seasonRating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName(self::namespace1)
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withLogSetting((new \Gs2\SeasonRating\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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.CreateNamespaceRequest;
import io.gs2.seasonRating.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withTransactionSetting(null)
            .withLogSetting(new io.gs2.seasonRating.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.CreateNamespaceRequest;
using Gs2.Gs2SeasonRating.Result.CreateNamespaceResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2SeasonRating.Request.CreateNamespaceRequest()
        .WithName("namespace1")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithLogSetting(new Gs2.Gs2SeasonRating.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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.createNamespace(
        new Gs2SeasonRating.CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withTransactionSetting(null)
            .withLogSetting(new Gs2SeasonRating.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 season_rating

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

try:
    result = client.create_namespace(
        season_rating.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_transaction_setting(None)
            .with_log_setting(
                season_rating.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('seasonRating')

api_result = client.create_namespace({
    name="namespace1",
    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['message'])
end

result = api_result.result
item = result.item;

getNamespaceStatus

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
statusstring

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &season_rating.GetNamespaceStatusRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetNamespaceStatusRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
status = result.status;

getNamespace

Get namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemNamespaceNamespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &season_rating.GetNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

updateNamespace

Update namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction settings
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceUpdated namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &season_rating.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        LogSetting: &seasonRating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName(self::namespace1)
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withLogSetting((new \Gs2\SeasonRating\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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.UpdateNamespaceRequest;
import io.gs2.seasonRating.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withLogSetting(new io.gs2.seasonRating.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.UpdateNamespaceRequest;
using Gs2.Gs2SeasonRating.Result.UpdateNamespaceResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2SeasonRating.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace1")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithLogSetting(new Gs2.Gs2SeasonRating.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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.updateNamespace(
        new Gs2SeasonRating.UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withLogSetting(new Gs2SeasonRating.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 season_rating

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

try:
    result = client.update_namespace(
        season_rating.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_transaction_setting(None)
            .with_log_setting(
                season_rating.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('seasonRating')

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

result = api_result.result
item = result.item;

deleteNamespace

Delete namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemNamespaceDeleted namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &season_rating.DeleteNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DeleteNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

dumpUserDataByUserId

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

Request

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

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result

checkDumpUserDataByUserId

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

Request

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

Result

TypeDescription
urlstringURL of output data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CheckDumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
url = result.url;

cleanUserDataByUserId

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

Request

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

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result

checkCleanUserDataByUserId

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

Request

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

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CheckCleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result

prepareImportUserDataByUserId

Start importing data associated with the specified user ID

Request

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

Result

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

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\PrepareImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

importUserDataByUserId

Start importing data associated with the specified user ID

Request

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

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\ImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result

checkImportUserDataByUserId

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

Request

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

Result

TypeDescription
urlstringURL of log data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &season_rating.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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CheckImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

result = api_result.result
url = result.url;

describeMatchSessions

Get list of MatchSessions

Request

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

Result

TypeDescription
itemsList<MatchSession>List of MatchSession
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/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DescribeMatchSessions(
    &season_rating.DescribeMatchSessionsRequest {
        NamespaceName: pointy.String("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DescribeMatchSessionsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeMatchSessionsResult result = client.describeMatchSessions(
        new DescribeMatchSessionsRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<MatchSession> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.DescribeMatchSessionsRequest;
using Gs2.Gs2SeasonRating.Result.DescribeMatchSessionsResult;

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

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

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

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

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

try:
    result = client.describe_match_sessions(
        season_rating.DescribeMatchSessionsRequest()
            .with_namespace_name(self.hash1)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

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

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

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

createMatchSession

Create a MatchSession

When you create a session, a session ID is issued. A session ID is required to send a report of the battle result, and by specifying the session ID, you can send a report for that session.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
sessionNamestringUUID~ 128 charsSession Name
ttlSecondsint6060 ~ 7200MatchSession expiration time (seconds)

Result

TypeDescription
itemMatchSessionCreated MatchSession

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CreateMatchSession(
    &season_rating.CreateMatchSessionRequest {
        NamespaceName: pointy.String("namespace1"),
        SessionName: pointy.String("$matchSession1.name"),
        TtlSeconds: 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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CreateMatchSessionRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createMatchSession(
        (new CreateMatchSessionRequest())
            ->withNamespaceName(self::namespace1)
            ->withSessionName(self::$matchSession1.name)
            ->withTtlSeconds(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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.CreateMatchSessionRequest;
import io.gs2.seasonRating.result.CreateMatchSessionResult;

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

try {
    CreateMatchSessionResult result = client.createMatchSession(
        new CreateMatchSessionRequest()
            .withNamespaceName("namespace1")
            .withSessionName("$matchSession1.name")
            .withTtlSeconds(null)
    );
    MatchSession item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.CreateMatchSessionRequest;
using Gs2.Gs2SeasonRating.Result.CreateMatchSessionResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.CreateMatchSessionResult> asyncResult = null;
yield return client.CreateMatchSession(
    new Gs2.Gs2SeasonRating.Request.CreateMatchSessionRequest()
        .WithNamespaceName("namespace1")
        .WithSessionName("$matchSession1.name")
        .WithTtlSeconds(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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.createMatchSession(
        new Gs2SeasonRating.CreateMatchSessionRequest()
            .withNamespaceName("namespace1")
            .withSessionName("$matchSession1.name")
            .withTtlSeconds(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.create_match_session(
        season_rating.CreateMatchSessionRequest()
            .with_namespace_name(self.hash1)
            .with_session_name(self.match_session1.name)
            .with_ttl_seconds(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

api_result = client.create_match_session({
    namespaceName="namespace1",
    sessionName="$matchSession1.name",
    ttlSeconds=nil,
})

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

result = api_result.result
item = result.item;

getMatchSession

Get MatchSession

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
sessionNamestringUUID~ 128 charsSession Name

Result

TypeDescription
itemMatchSessionMatchSession

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetMatchSession(
    &season_rating.GetMatchSessionRequest {
        NamespaceName: pointy.String("namespace1"),
        SessionName: pointy.String("$matchSession1.name"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetMatchSessionRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getMatchSession(
        (new GetMatchSessionRequest())
            ->withNamespaceName(self::namespace1)
            ->withSessionName(self::$matchSession1.name)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.GetMatchSessionRequest;
import io.gs2.seasonRating.result.GetMatchSessionResult;

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

try {
    GetMatchSessionResult result = client.getMatchSession(
        new GetMatchSessionRequest()
            .withNamespaceName("namespace1")
            .withSessionName("$matchSession1.name")
    );
    MatchSession item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.GetMatchSessionRequest;
using Gs2.Gs2SeasonRating.Result.GetMatchSessionResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.GetMatchSessionResult> asyncResult = null;
yield return client.GetMatchSession(
    new Gs2.Gs2SeasonRating.Request.GetMatchSessionRequest()
        .WithNamespaceName("namespace1")
        .WithSessionName("$matchSession1.name"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.getMatchSession(
        new Gs2SeasonRating.GetMatchSessionRequest()
            .withNamespaceName("namespace1")
            .withSessionName("$matchSession1.name")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.get_match_session(
        season_rating.GetMatchSessionRequest()
            .with_namespace_name(self.hash1)
            .with_session_name(self.match_session1.name)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

api_result = client.get_match_session({
    namespaceName="namespace1",
    sessionName="$matchSession1.name",
})

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

result = api_result.result
item = result.item;

deleteMatchSession

Delete MatchSession

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
sessionNamestringUUID~ 128 charsSession Name

Result

TypeDescription
itemMatchSessionDeleted MatchSession

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DeleteMatchSession(
    &season_rating.DeleteMatchSessionRequest {
        NamespaceName: pointy.String("namespace1"),
        SessionName: pointy.String("$matchSession1.name"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DeleteMatchSessionRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteMatchSession(
        (new DeleteMatchSessionRequest())
            ->withNamespaceName(self::namespace1)
            ->withSessionName(self::$matchSession1.name)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.DeleteMatchSessionRequest;
import io.gs2.seasonRating.result.DeleteMatchSessionResult;

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

try {
    DeleteMatchSessionResult result = client.deleteMatchSession(
        new DeleteMatchSessionRequest()
            .withNamespaceName("namespace1")
            .withSessionName("$matchSession1.name")
    );
    MatchSession item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.DeleteMatchSessionRequest;
using Gs2.Gs2SeasonRating.Result.DeleteMatchSessionResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.DeleteMatchSessionResult> asyncResult = null;
yield return client.DeleteMatchSession(
    new Gs2.Gs2SeasonRating.Request.DeleteMatchSessionRequest()
        .WithNamespaceName("namespace1")
        .WithSessionName("$matchSession1.name"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.deleteMatchSession(
        new Gs2SeasonRating.DeleteMatchSessionRequest()
            .withNamespaceName("namespace1")
            .withSessionName("$matchSession1.name")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.delete_match_session(
        season_rating.DeleteMatchSessionRequest()
            .with_namespace_name(self.hash1)
            .with_session_name(self.match_session1.name)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

api_result = client.delete_match_session({
    namespaceName="namespace1",
    sessionName="$matchSession1.name",
})

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

result = api_result.result
item = result.item;

describeSeasonModelMasters

Get list of rating model masters

Request

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

Result

TypeDescription
itemsList<SeasonModelMaster>List of Season Model Master
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DescribeSeasonModelMasters(
    &season_rating.DescribeSeasonModelMastersRequest {
        NamespaceName: pointy.String("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DescribeSeasonModelMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeSeasonModelMastersResult result = client.describeSeasonModelMasters(
        new DescribeSeasonModelMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SeasonModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.DescribeSeasonModelMastersRequest;
using Gs2.Gs2SeasonRating.Result.DescribeSeasonModelMastersResult;

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

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

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

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

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

try:
    result = client.describe_season_model_masters(
        season_rating.DescribeSeasonModelMastersRequest()
            .with_namespace_name(self.hash1)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

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

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

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

createSeasonModelMaster

Create a new rating model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
namestring~ 128 charsSeason Model Name
descriptionstring~ 1024 charsDescription
metadatastring~ 128 charsmetadata
tiersList<TierModel>1 ~ 100 itemsList of Tier
experienceModelIdstring~ 1024 charsExperience Model GRN
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN that sets the period during which the season is open.

Result

TypeDescription
itemSeasonModelMasterCreated rating model master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CreateSeasonModelMaster(
    &season_rating.CreateSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("mode1"),
        Description: nil,
        Metadata: nil,
        Tiers: []seasonRating.TierModel{
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(0),
                EntryFee: pointy.Int32(0),
                MinimumChangePoint: pointy.Int32(-10),
                MaximumChangePoint: pointy.Int32(20),
            },
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(30),
                EntryFee: pointy.Int32(10),
                MinimumChangePoint: pointy.Int32(-10),
                MaximumChangePoint: pointy.Int32(30),
            },
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(60),
                EntryFee: pointy.Int32(20),
                MinimumChangePoint: pointy.Int32(-20),
                MaximumChangePoint: pointy.Int32(50),
            },
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(60),
                EntryFee: pointy.Int32(30),
                MinimumChangePoint: pointy.Int32(-30),
                MaximumChangePoint: pointy.Int32(60),
            },
        },
        ExperienceModelId: pointy.String("grn:experience:level"),
        ChallengePeriodEventId: 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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CreateSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createSeasonModelMaster(
        (new CreateSeasonModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("mode1")
            ->withDescription(null)
            ->withMetadata(null)
            ->withTiers([
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(0)
                    ->withEntryFee(0)
                    ->withMinimumChangePoint(-10)
                    ->withMaximumChangePoint(20),
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(30)
                    ->withEntryFee(10)
                    ->withMinimumChangePoint(-10)
                    ->withMaximumChangePoint(30),
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(60)
                    ->withEntryFee(20)
                    ->withMinimumChangePoint(-20)
                    ->withMaximumChangePoint(50),
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(60)
                    ->withEntryFee(30)
                    ->withMinimumChangePoint(-30)
                    ->withMaximumChangePoint(60),
            ])
            ->withExperienceModelId("grn:experience:level")
            ->withChallengePeriodEventId(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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.CreateSeasonModelMasterRequest;
import io.gs2.seasonRating.result.CreateSeasonModelMasterResult;

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

try {
    CreateSeasonModelMasterResult result = client.createSeasonModelMaster(
        new CreateSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("mode1")
            .withDescription(null)
            .withMetadata(null)
            .withTiers(Arrays.asList(
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(0)
                    .withEntryFee(0)
                    .withMinimumChangePoint(-10)
                    .withMaximumChangePoint(20),
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(30)
                    .withEntryFee(10)
                    .withMinimumChangePoint(-10)
                    .withMaximumChangePoint(30),
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(60)
                    .withEntryFee(20)
                    .withMinimumChangePoint(-20)
                    .withMaximumChangePoint(50),
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(60)
                    .withEntryFee(30)
                    .withMinimumChangePoint(-30)
                    .withMaximumChangePoint(60)
            ))
            .withExperienceModelId("grn:experience:level")
            .withChallengePeriodEventId(null)
    );
    SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.CreateSeasonModelMasterRequest;
using Gs2.Gs2SeasonRating.Result.CreateSeasonModelMasterResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.CreateSeasonModelMasterResult> asyncResult = null;
yield return client.CreateSeasonModelMaster(
    new Gs2.Gs2SeasonRating.Request.CreateSeasonModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithName("mode1")
        .WithDescription(null)
        .WithMetadata(null)
        .WithTiers(new Gs2.Gs2SeasonRating.Model.TierModel[] {
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(0)
                .WithEntryFee(0)
                .WithMinimumChangePoint(-10)
                .WithMaximumChangePoint(20),
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(30)
                .WithEntryFee(10)
                .WithMinimumChangePoint(-10)
                .WithMaximumChangePoint(30),
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(60)
                .WithEntryFee(20)
                .WithMinimumChangePoint(-20)
                .WithMaximumChangePoint(50),
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(60)
                .WithEntryFee(30)
                .WithMinimumChangePoint(-30)
                .WithMaximumChangePoint(60),
        })
        .WithExperienceModelId("grn:experience:level")
        .WithChallengePeriodEventId(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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.createSeasonModelMaster(
        new Gs2SeasonRating.CreateSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("mode1")
            .withDescription(null)
            .withMetadata(null)
            .withTiers([
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(0)
                    .withEntryFee(0)
                    .withMinimumChangePoint(-10)
                    .withMaximumChangePoint(20),
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(30)
                    .withEntryFee(10)
                    .withMinimumChangePoint(-10)
                    .withMaximumChangePoint(30),
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(60)
                    .withEntryFee(20)
                    .withMinimumChangePoint(-20)
                    .withMaximumChangePoint(50),
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(60)
                    .withEntryFee(30)
                    .withMinimumChangePoint(-30)
                    .withMaximumChangePoint(60),
            ])
            .withExperienceModelId("grn:experience:level")
            .withChallengePeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.create_season_model_master(
        season_rating.CreateSeasonModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('mode1')
            .with_description(None)
            .with_metadata(None)
            .with_tiers([
                season_rating.TierModel()
                    .with_raise_rank_bonus(0)
                    .with_entry_fee(0)
                    .with_minimum_change_point(-10)
                    .with_maximum_change_point(20),
                season_rating.TierModel()
                    .with_raise_rank_bonus(30)
                    .with_entry_fee(10)
                    .with_minimum_change_point(-10)
                    .with_maximum_change_point(30),
                season_rating.TierModel()
                    .with_raise_rank_bonus(60)
                    .with_entry_fee(20)
                    .with_minimum_change_point(-20)
                    .with_maximum_change_point(50),
                season_rating.TierModel()
                    .with_raise_rank_bonus(60)
                    .with_entry_fee(30)
                    .with_minimum_change_point(-30)
                    .with_maximum_change_point(60),
            ])
            .with_experience_model_id('grn:experience:level')
            .with_challenge_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

api_result = client.create_season_model_master({
    namespaceName="namespace1",
    name="mode1",
    description=nil,
    metadata=nil,
    tiers={
        {
            raiseRankBonus=0,
            entryFee=0,
            minimumChangePoint=-10,
            maximumChangePoint=20,
        },
        {
            raiseRankBonus=30,
            entryFee=10,
            minimumChangePoint=-10,
            maximumChangePoint=30,
        },
        {
            raiseRankBonus=60,
            entryFee=20,
            minimumChangePoint=-20,
            maximumChangePoint=50,
        },
        {
            raiseRankBonus=60,
            entryFee=30,
            minimumChangePoint=-30,
            maximumChangePoint=60,
        }
    },
    experienceModelId="grn:experience:level",
    challengePeriodEventId=nil,
})

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

result = api_result.result
item = result.item;

getSeasonModelMaster

Obtain rating model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
seasonNamestring~ 128 charsSeason Model Name

Result

TypeDescription
itemSeasonModelMasterSeason Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetSeasonModelMaster(
    &season_rating.GetSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SeasonName: pointy.String("mode1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSeasonModelMaster(
        (new GetSeasonModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSeasonName("mode1")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.GetSeasonModelMasterRequest;
import io.gs2.seasonRating.result.GetSeasonModelMasterResult;

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

try {
    GetSeasonModelMasterResult result = client.getSeasonModelMaster(
        new GetSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("mode1")
    );
    SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.GetSeasonModelMasterRequest;
using Gs2.Gs2SeasonRating.Result.GetSeasonModelMasterResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.GetSeasonModelMasterResult> asyncResult = null;
yield return client.GetSeasonModelMaster(
    new Gs2.Gs2SeasonRating.Request.GetSeasonModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSeasonName("mode1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.getSeasonModelMaster(
        new Gs2SeasonRating.GetSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("mode1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.get_season_model_master(
        season_rating.GetSeasonModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('mode1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

api_result = client.get_season_model_master({
    namespaceName="namespace1",
    seasonName="mode1",
})

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

result = api_result.result
item = result.item;

updateSeasonModelMaster

Update rating model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
seasonNamestring~ 128 charsSeason Model Name
descriptionstring~ 1024 charsDescription
metadatastring~ 128 charsmetadata
tiersList<TierModel>1 ~ 100 itemsList of Tier
experienceModelIdstring~ 1024 charsExperience Model GRN
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN that sets the period during which the season is open.

Result

TypeDescription
itemSeasonModelMasterUpdated rating model master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.UpdateSeasonModelMaster(
    &season_rating.UpdateSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SeasonName: pointy.String("mode1"),
        Description: pointy.String("description1"),
        Metadata: nil,
        Tiers: []seasonRating.TierModel{
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(0),
                EntryFee: pointy.Int32(0),
                MinimumChangePoint: pointy.Int32(-100),
                MaximumChangePoint: pointy.Int32(200),
            },
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(300),
                EntryFee: pointy.Int32(100),
                MinimumChangePoint: pointy.Int32(-100),
                MaximumChangePoint: pointy.Int32(300),
            },
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(600),
                EntryFee: pointy.Int32(200),
                MinimumChangePoint: pointy.Int32(-200),
                MaximumChangePoint: pointy.Int32(500),
            },
            seasonRating.TierModel{
                RaiseRankBonus: pointy.Int32(600),
                EntryFee: pointy.Int32(300),
                MinimumChangePoint: pointy.Int32(-300),
                MaximumChangePoint: pointy.Int32(600),
            },
        },
        ExperienceModelId: pointy.String("grn:experience:level2"),
        ChallengePeriodEventId: 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\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\UpdateSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateSeasonModelMaster(
        (new UpdateSeasonModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSeasonName("mode1")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withTiers([
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(0)
                    ->withEntryFee(0)
                    ->withMinimumChangePoint(-100)
                    ->withMaximumChangePoint(200),
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(300)
                    ->withEntryFee(100)
                    ->withMinimumChangePoint(-100)
                    ->withMaximumChangePoint(300),
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(600)
                    ->withEntryFee(200)
                    ->withMinimumChangePoint(-200)
                    ->withMaximumChangePoint(500),
                (new \Gs2\SeasonRating\Model\TierModel())
                    ->withRaiseRankBonus(600)
                    ->withEntryFee(300)
                    ->withMinimumChangePoint(-300)
                    ->withMaximumChangePoint(600),
            ])
            ->withExperienceModelId("grn:experience:level2")
            ->withChallengePeriodEventId(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.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.UpdateSeasonModelMasterRequest;
import io.gs2.seasonRating.result.UpdateSeasonModelMasterResult;

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

try {
    UpdateSeasonModelMasterResult result = client.updateSeasonModelMaster(
        new UpdateSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("mode1")
            .withDescription("description1")
            .withMetadata(null)
            .withTiers(Arrays.asList(
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(0)
                    .withEntryFee(0)
                    .withMinimumChangePoint(-100)
                    .withMaximumChangePoint(200),
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(300)
                    .withEntryFee(100)
                    .withMinimumChangePoint(-100)
                    .withMaximumChangePoint(300),
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(600)
                    .withEntryFee(200)
                    .withMinimumChangePoint(-200)
                    .withMaximumChangePoint(500),
                new io.gs2.seasonRating.model.TierModel()
                    .withRaiseRankBonus(600)
                    .withEntryFee(300)
                    .withMinimumChangePoint(-300)
                    .withMaximumChangePoint(600)
            ))
            .withExperienceModelId("grn:experience:level2")
            .withChallengePeriodEventId(null)
    );
    SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.UpdateSeasonModelMasterRequest;
using Gs2.Gs2SeasonRating.Result.UpdateSeasonModelMasterResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.UpdateSeasonModelMasterResult> asyncResult = null;
yield return client.UpdateSeasonModelMaster(
    new Gs2.Gs2SeasonRating.Request.UpdateSeasonModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSeasonName("mode1")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithTiers(new Gs2.Gs2SeasonRating.Model.TierModel[] {
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(0)
                .WithEntryFee(0)
                .WithMinimumChangePoint(-100)
                .WithMaximumChangePoint(200),
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(300)
                .WithEntryFee(100)
                .WithMinimumChangePoint(-100)
                .WithMaximumChangePoint(300),
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(600)
                .WithEntryFee(200)
                .WithMinimumChangePoint(-200)
                .WithMaximumChangePoint(500),
            new Gs2.Gs2SeasonRating.Model.TierModel()
                .WithRaiseRankBonus(600)
                .WithEntryFee(300)
                .WithMinimumChangePoint(-300)
                .WithMaximumChangePoint(600),
        })
        .WithExperienceModelId("grn:experience:level2")
        .WithChallengePeriodEventId(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 Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.updateSeasonModelMaster(
        new Gs2SeasonRating.UpdateSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("mode1")
            .withDescription("description1")
            .withMetadata(null)
            .withTiers([
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(0)
                    .withEntryFee(0)
                    .withMinimumChangePoint(-100)
                    .withMaximumChangePoint(200),
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(300)
                    .withEntryFee(100)
                    .withMinimumChangePoint(-100)
                    .withMaximumChangePoint(300),
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(600)
                    .withEntryFee(200)
                    .withMinimumChangePoint(-200)
                    .withMaximumChangePoint(500),
                new Gs2SeasonRating.model.TierModel()
                    .withRaiseRankBonus(600)
                    .withEntryFee(300)
                    .withMinimumChangePoint(-300)
                    .withMaximumChangePoint(600),
            ])
            .withExperienceModelId("grn:experience:level2")
            .withChallengePeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.update_season_model_master(
        season_rating.UpdateSeasonModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('mode1')
            .with_description('description1')
            .with_metadata(None)
            .with_tiers([
                season_rating.TierModel()
                    .with_raise_rank_bonus(0)
                    .with_entry_fee(0)
                    .with_minimum_change_point(-100)
                    .with_maximum_change_point(200),
                season_rating.TierModel()
                    .with_raise_rank_bonus(300)
                    .with_entry_fee(100)
                    .with_minimum_change_point(-100)
                    .with_maximum_change_point(300),
                season_rating.TierModel()
                    .with_raise_rank_bonus(600)
                    .with_entry_fee(200)
                    .with_minimum_change_point(-200)
                    .with_maximum_change_point(500),
                season_rating.TierModel()
                    .with_raise_rank_bonus(600)
                    .with_entry_fee(300)
                    .with_minimum_change_point(-300)
                    .with_maximum_change_point(600),
            ])
            .with_experience_model_id('grn:experience:level2')
            .with_challenge_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

api_result = client.update_season_model_master({
    namespaceName="namespace1",
    seasonName="mode1",
    description="description1",
    metadata=nil,
    tiers={
        {
            raiseRankBonus=0,
            entryFee=0,
            minimumChangePoint=-100,
            maximumChangePoint=200,
        },
        {
            raiseRankBonus=300,
            entryFee=100,
            minimumChangePoint=-100,
            maximumChangePoint=300,
        },
        {
            raiseRankBonus=600,
            entryFee=200,
            minimumChangePoint=-200,
            maximumChangePoint=500,
        },
        {
            raiseRankBonus=600,
            entryFee=300,
            minimumChangePoint=-300,
            maximumChangePoint=600,
        }
    },
    experienceModelId="grn:experience:level2",
    challengePeriodEventId=nil,
})

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

result = api_result.result
item = result.item;

deleteSeasonModelMaster

Delete Season Model Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
seasonNamestring~ 128 charsSeason Model Name

Result

TypeDescription
itemSeasonModelMasterDeleted Season Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DeleteSeasonModelMaster(
    &season_rating.DeleteSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SeasonName: pointy.String("mode1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DeleteSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteSeasonModelMaster(
        (new DeleteSeasonModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSeasonName("mode1")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.DeleteSeasonModelMasterRequest;
import io.gs2.seasonRating.result.DeleteSeasonModelMasterResult;

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

try {
    DeleteSeasonModelMasterResult result = client.deleteSeasonModelMaster(
        new DeleteSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("mode1")
    );
    SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.DeleteSeasonModelMasterRequest;
using Gs2.Gs2SeasonRating.Result.DeleteSeasonModelMasterResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.DeleteSeasonModelMasterResult> asyncResult = null;
yield return client.DeleteSeasonModelMaster(
    new Gs2.Gs2SeasonRating.Request.DeleteSeasonModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSeasonName("mode1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.deleteSeasonModelMaster(
        new Gs2SeasonRating.DeleteSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("mode1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.delete_season_model_master(
        season_rating.DeleteSeasonModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('mode1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

api_result = client.delete_season_model_master({
    namespaceName="namespace1",
    seasonName="mode1",
})

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

result = api_result.result
item = result.item;

describeSeasonModels

Get list of rating models

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemsList<SeasonModel>List of Season Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.DescribeSeasonModels(
    &season_rating.DescribeSeasonModelsRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\DescribeSeasonModelsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeSeasonModels(
        (new DescribeSeasonModelsRequest())
            ->withNamespaceName(self::namespace1)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.DescribeSeasonModelsRequest;
import io.gs2.seasonRating.result.DescribeSeasonModelsResult;

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

try {
    DescribeSeasonModelsResult result = client.describeSeasonModels(
        new DescribeSeasonModelsRequest()
            .withNamespaceName("namespace1")
    );
    List<SeasonModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.DescribeSeasonModelsRequest;
using Gs2.Gs2SeasonRating.Result.DescribeSeasonModelsResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.DescribeSeasonModelsResult> asyncResult = null;
yield return client.DescribeSeasonModels(
    new Gs2.Gs2SeasonRating.Request.DescribeSeasonModelsRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.describeSeasonModels(
        new Gs2SeasonRating.DescribeSeasonModelsRequest()
            .withNamespaceName("namespace1")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.describe_season_models(
        season_rating.DescribeSeasonModelsRequest()
            .with_namespace_name(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

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

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

result = api_result.result
items = result.items;

getSeasonModel

Obtain rating model

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
seasonNamestring~ 128 charsSeason Model Name

Result

TypeDescription
itemSeasonModelSeason Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetSeasonModel(
    &season_rating.GetSeasonModelRequest {
        NamespaceName: pointy.String("namespace1"),
        SeasonName: pointy.String("mode1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetSeasonModelRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSeasonModel(
        (new GetSeasonModelRequest())
            ->withNamespaceName(self::namespace1)
            ->withSeasonName("mode1")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.GetSeasonModelRequest;
import io.gs2.seasonRating.result.GetSeasonModelResult;

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

try {
    GetSeasonModelResult result = client.getSeasonModel(
        new GetSeasonModelRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("mode1")
    );
    SeasonModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.GetSeasonModelRequest;
using Gs2.Gs2SeasonRating.Result.GetSeasonModelResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.GetSeasonModelResult> asyncResult = null;
yield return client.GetSeasonModel(
    new Gs2.Gs2SeasonRating.Request.GetSeasonModelRequest()
        .WithNamespaceName("namespace1")
        .WithSeasonName("mode1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.getSeasonModel(
        new Gs2SeasonRating.GetSeasonModelRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("mode1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.get_season_model(
        season_rating.GetSeasonModelRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('mode1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

api_result = client.get_season_model({
    namespaceName="namespace1",
    seasonName="mode1",
})

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

result = api_result.result
item = result.item;

exportMaster

Export master data for currently available rating masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemCurrentSeasonModelMasterCurrently available rating masters

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &season_rating.ExportMasterRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\ExportMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentSeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.ExportMasterRequest;
using Gs2.Gs2SeasonRating.Result.ExportMasterResult;

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

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

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

try {
    const result = await client.exportMaster(
        new Gs2SeasonRating.ExportMasterRequest()
            .withNamespaceName("namespace1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.export_master(
        season_rating.ExportMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

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

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

result = api_result.result
item = result.item;

getCurrentSeasonModelMaster

Get currently available rating masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemCurrentSeasonModelMasterCurrently available rating masters

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetCurrentSeasonModelMaster(
    &season_rating.GetCurrentSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetCurrentSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCurrentSeasonModelMaster(
        (new GetCurrentSeasonModelMasterRequest())
            ->withNamespaceName(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.GetCurrentSeasonModelMasterRequest;
import io.gs2.seasonRating.result.GetCurrentSeasonModelMasterResult;

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

try {
    GetCurrentSeasonModelMasterResult result = client.getCurrentSeasonModelMaster(
        new GetCurrentSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentSeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.GetCurrentSeasonModelMasterRequest;
using Gs2.Gs2SeasonRating.Result.GetCurrentSeasonModelMasterResult;

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

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

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

try {
    const result = await client.getCurrentSeasonModelMaster(
        new Gs2SeasonRating.GetCurrentSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.get_current_season_model_master(
        season_rating.GetCurrentSeasonModelMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

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

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

result = api_result.result
item = result.item;

updateCurrentSeasonModelMaster

Update and currently available rating master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
settingsstring~ 5242880 charsMaster data

Result

TypeDescription
itemCurrentSeasonModelMasterUpdated and currently available rating master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentSeasonModelMaster(
    &season_rating.UpdateCurrentSeasonModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Settings: pointy.String("{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:experience:level\"}]}"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\UpdateCurrentSeasonModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentSeasonModelMaster(
        (new UpdateCurrentSeasonModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSettings("{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:experience:level\"}]}")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.UpdateCurrentSeasonModelMasterRequest;
import io.gs2.seasonRating.result.UpdateCurrentSeasonModelMasterResult;

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

try {
    UpdateCurrentSeasonModelMasterResult result = client.updateCurrentSeasonModelMaster(
        new UpdateCurrentSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:experience:level\"}]}")
    );
    CurrentSeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.UpdateCurrentSeasonModelMasterRequest;
using Gs2.Gs2SeasonRating.Result.UpdateCurrentSeasonModelMasterResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.UpdateCurrentSeasonModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentSeasonModelMaster(
    new Gs2.Gs2SeasonRating.Request.UpdateCurrentSeasonModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSettings("{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:experience:level\"}]}"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.updateCurrentSeasonModelMaster(
        new Gs2SeasonRating.UpdateCurrentSeasonModelMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:experience:level\"}]}")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.update_current_season_model_master(
        season_rating.UpdateCurrentSeasonModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_settings('{"version": "2024-02-23", "seasonModels": [{"name": "season1", "tiers": [{"raiseRankBonus": 0, "entryFee": 0, "minimumChangePoint": -10, "maximumChangePoint": 20}, {"raiseRankBonus": 30, "entryFee": 10, "minimumChangePoint": -10, "maximumChangePoint": 30}, {"raiseRankBonus": 60, "entryFee": 20, "minimumChangePoint": -20, "maximumChangePoint": 50}, {"raiseRankBonus": 60, "entryFee": 30, "minimumChangePoint": -30, "maximumChangePoint": 60}], "experienceModelId": "grn:experience:level"}]}')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

api_result = client.update_current_season_model_master({
    namespaceName="namespace1",
    settings="{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:experience:level\"}]}",
})

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

result = api_result.result
item = result.item;

updateCurrentSeasonModelMasterFromGitHub

Update and currently available rating master

Request

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

Result

TypeDescription
itemCurrentSeasonModelMasterUpdated and currently available rating master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentSeasonModelMasterFromGitHub(
    &season_rating.UpdateCurrentSeasonModelMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace1"),
        CheckoutSetting: &seasonRating.GitHubCheckoutSetting{
            ApiKeyId: pointy.String("$gitHubApiKey1.apiKeyId"),
            RepositoryName: pointy.String("gs2io/master-data"),
            SourcePath: pointy.String("path/to/file.json"),
            ReferenceType: pointy.String("branch"),
            BranchName: pointy.String("develop"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\UpdateCurrentSeasonModelMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentSeasonModelMasterFromGitHub(
        (new UpdateCurrentSeasonModelMasterFromGitHubRequest())
            ->withNamespaceName(self::namespace1)
            ->withCheckoutSetting((new GitHubCheckoutSetting())
                ->withApiKeyId(self::$gitHubApiKey1.apiKeyId)
                ->withRepositoryName("gs2io/master-data")
                ->withSourcePath("path/to/file.json")
                ->withReferenceType("branch")
                ->withBranchName("develop")
            )
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.UpdateCurrentSeasonModelMasterFromGitHubRequest;
import io.gs2.seasonRating.result.UpdateCurrentSeasonModelMasterFromGitHubResult;

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

try {
    UpdateCurrentSeasonModelMasterFromGitHubResult result = client.updateCurrentSeasonModelMasterFromGitHub(
        new UpdateCurrentSeasonModelMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("$gitHubApiKey1.apiKeyId")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentSeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.UpdateCurrentSeasonModelMasterFromGitHubRequest;
using Gs2.Gs2SeasonRating.Result.UpdateCurrentSeasonModelMasterFromGitHubResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.UpdateCurrentSeasonModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentSeasonModelMasterFromGitHub(
    new Gs2.Gs2SeasonRating.Request.UpdateCurrentSeasonModelMasterFromGitHubRequest()
        .WithNamespaceName("namespace1")
        .WithCheckoutSetting(new Gs2.Gs2SeasonRating.Model.GitHubCheckoutSetting()
            .WithApiKeyId("$gitHubApiKey1.apiKeyId")
            .WithRepositoryName("gs2io/master-data")
            .WithSourcePath("path/to/file.json")
            .WithReferenceType("branch")
            .WithBranchName("develop")
        ),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.updateCurrentSeasonModelMasterFromGitHub(
        new Gs2SeasonRating.UpdateCurrentSeasonModelMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting(new Gs2SeasonRating.model.GitHubCheckoutSetting()
                .withApiKeyId("$gitHubApiKey1.apiKeyId")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.update_current_season_model_master_from_git_hub(
        season_rating.UpdateCurrentSeasonModelMasterFromGitHubRequest()
            .with_namespace_name(self.hash1)
            .with_checkout_setting(season_rating.GitHubCheckoutSetting()
                .with_api_key_id(self.git_hub_api_key1.api_key_id)
                .with_repository_name('gs2io/master-data')
                .with_source_path('path/to/file.json')
                .with_reference_type('branch')
                .with_branch_name('develop')
            )
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

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

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

result = api_result.result
item = result.item;

getBallot

Prepared ballot along with signatures

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
seasonNamestring~ 128 charsSeason Model Name
sessionNamestringUUID~ 128 charsSession Name
accessTokenstring~ 128 charsUser Id
numberOfPlayerint2 ~ 10Number of participants
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024 charsencryption key GRN

Result

TypeDescription
itemBallotBallot
bodystringData to be signed
signaturestringSignature

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetBallot(
    &season_rating.GetBallotRequest {
        NamespaceName: pointy.String("namespace1"),
        SeasonName: pointy.String("rating-0001"),
        SessionName: pointy.String("gathering-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        NumberOfPlayer: pointy.Int32(4),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetBallotRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    GetBallotResult result = client.getBallot(
        new GetBallotRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("rating-0001")
            .withSessionName("gathering-0001")
            .withAccessToken("accessToken-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
    );
    Ballot item = result.getItem();
    String body = result.getBody();
    String signature = result.getSignature();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.GetBallotRequest;
using Gs2.Gs2SeasonRating.Result.GetBallotResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.GetBallotResult> asyncResult = null;
yield return client.GetBallot(
    new Gs2.Gs2SeasonRating.Request.GetBallotRequest()
        .WithNamespaceName("namespace1")
        .WithSeasonName("rating-0001")
        .WithSessionName("gathering-0001")
        .WithAccessToken("accessToken-0001")
        .WithNumberOfPlayer(4)
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.getBallot(
        new Gs2SeasonRating.GetBallotRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("rating-0001")
            .withSessionName("gathering-0001")
            .withAccessToken("accessToken-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
    );
    const item = result.getItem();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

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

api_result = client.get_ballot({
    namespaceName="namespace1",
    seasonName="rating-0001",
    sessionName="gathering-0001",
    accessToken="accessToken-0001",
    numberOfPlayer=4,
    keyId="key-0001",
})

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

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

getBallotByUserId

Create ballot with signatures, specifying user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
seasonNamestring~ 128 charsSeason Model Name
sessionNamestringUUID~ 128 charsSession Name
userIdstring~ 128 charsUser Id
numberOfPlayerint2 ~ 10Number of participants
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024 charsencryption key GRN
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemBallotBallot
bodystringData to be signed
signaturestringSignature

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.GetBallotByUserId(
    &season_rating.GetBallotByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        SeasonName: pointy.String("rating-0001"),
        SessionName: pointy.String("gathering-0001"),
        UserId: pointy.String("user-0001"),
        NumberOfPlayer: pointy.Int32(4),
        KeyId: pointy.String("key-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\GetBallotByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    GetBallotByUserIdResult result = client.getBallotByUserId(
        new GetBallotByUserIdRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("rating-0001")
            .withSessionName("gathering-0001")
            .withUserId("user-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
            .withTimeOffsetToken(null)
    );
    Ballot item = result.getItem();
    String body = result.getBody();
    String signature = result.getSignature();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.GetBallotByUserIdRequest;
using Gs2.Gs2SeasonRating.Result.GetBallotByUserIdResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.GetBallotByUserIdResult> asyncResult = null;
yield return client.GetBallotByUserId(
    new Gs2.Gs2SeasonRating.Request.GetBallotByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithSeasonName("rating-0001")
        .WithSessionName("gathering-0001")
        .WithUserId("user-0001")
        .WithNumberOfPlayer(4)
        .WithKeyId("key-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.getBallotByUserId(
        new Gs2SeasonRating.GetBallotByUserIdRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("rating-0001")
            .withSessionName("gathering-0001")
            .withUserId("user-0001")
            .withNumberOfPlayer(4)
            .withKeyId("key-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

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

api_result = client.get_ballot_by_user_id({
    namespaceName="namespace1",
    seasonName="rating-0001",
    sessionName="gathering-0001",
    userId="user-0001",
    numberOfPlayer=4,
    keyId="key-0001",
    timeOffsetToken=nil,
})

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

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

vote

Vote on the results of the matchups.

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

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

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
ballotBodystring~ 1024 charsData for ballot signature targets
ballotSignaturestring~ 256 charsSignature
gameResultsList<GameResult>~ 10 itemsList of Results
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024 charsencryption key GRN

Result

TypeDescription
itemBallotBallot

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.Vote(
    &season_rating.VoteRequest {
        NamespaceName: pointy.String("namespace1"),
        BallotBody: pointy.String("ballotBody"),
        BallotSignature: pointy.String("ballotSignature"),
        GameResults: []seasonRating.GameResult{
            seasonRating.GameResult{
                Rank: pointy.Int32(1),
                UserId: pointy.String("user-0001"),
            },
            seasonRating.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0002"),
            },
            seasonRating.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0003"),
            },
            seasonRating.GameResult{
                Rank: pointy.Int32(3),
                UserId: pointy.String("user-0004"),
            },
        },
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\VoteRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    VoteResult result = client.vote(
        new VoteRequest()
            .withNamespaceName("namespace1")
            .withBallotBody("ballotBody")
            .withBallotSignature("ballotSignature")
            .withGameResults(Arrays.asList(
                new GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new GameResult()
                    .withRank(3)
                    .withUserId("user-0004")
            ))
            .withKeyId("key-0001")
    );
    Ballot item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.VoteRequest;
using Gs2.Gs2SeasonRating.Result.VoteResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.VoteResult> asyncResult = null;
yield return client.Vote(
    new Gs2.Gs2SeasonRating.Request.VoteRequest()
        .WithNamespaceName("namespace1")
        .WithBallotBody("ballotBody")
        .WithBallotSignature("ballotSignature")
        .WithGameResults(new Gs2.Gs2SeasonRating.Model.GameResult[] {
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(1)
                .WithUserId("user-0001"),
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0002"),
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0003"),
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(3)
                .WithUserId("user-0004"),
        })
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.vote(
        new Gs2SeasonRating.VoteRequest()
            .withNamespaceName("namespace1")
            .withBallotBody("ballotBody")
            .withBallotSignature("ballotSignature")
            .withGameResults([
                new Gs2SeasonRating.model.GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new Gs2SeasonRating.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new Gs2SeasonRating.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new Gs2SeasonRating.model.GameResult()
                    .withRank(3)
                    .withUserId("user-0004"),
            ])
            .withKeyId("key-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

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

api_result = client.vote({
    namespaceName="namespace1",
    ballotBody="ballotBody",
    ballotSignature="ballotSignature",
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
    keyId="key-0001",
})

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

result = api_result.result
item = result.item;

voteMultiple

Vote on the results of the matchups together.

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

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
signedBallotsList<SignedBallot>~ 10 itemsList of Ballot with signatures
gameResultsList<GameResult>~ 10 itemsList of Results
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024 charsencryption key GRN

Result

TypeDescription
itemBallotBallot

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.VoteMultiple(
    &season_rating.VoteMultipleRequest {
        NamespaceName: pointy.String("namespace1"),
        SignedBallots: []seasonRating.SignedBallot{
            seasonRating.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
            seasonRating.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
            seasonRating.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
            seasonRating.SignedBallot{
                Body: pointy.String("aaa"),
                Signature: pointy.String("bbb"),
            },
        },
        GameResults: []seasonRating.GameResult{
            seasonRating.GameResult{
                Rank: pointy.Int32(1),
                UserId: pointy.String("user-0001"),
            },
            seasonRating.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0002"),
            },
            seasonRating.GameResult{
                Rank: pointy.Int32(2),
                UserId: pointy.String("user-0003"),
            },
            seasonRating.GameResult{
                Rank: pointy.Int32(3),
                UserId: pointy.String("user-0004"),
            },
        },
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\VoteMultipleRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->voteMultiple(
        (new VoteMultipleRequest())
            ->withNamespaceName(self::namespace1)
            ->withSignedBallots([
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
                (new SignedBallot())
                    ->withBody("aaa")
                    ->withSignature("bbb"),
            ])
            ->withGameResults([
                (new GameResult())
                    ->withRank(1)
                    ->withUserId("user-0001"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0002"),
                (new GameResult())
                    ->withRank(2)
                    ->withUserId("user-0003"),
                (new GameResult())
                    ->withRank(3)
                    ->withUserId("user-0004"),
            ])
            ->withKeyId(self::key-0001)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.VoteMultipleRequest;
import io.gs2.seasonRating.result.VoteMultipleResult;

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

try {
    VoteMultipleResult result = client.voteMultiple(
        new VoteMultipleRequest()
            .withNamespaceName("namespace1")
            .withSignedBallots(Arrays.asList(
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb")
            ))
            .withGameResults(Arrays.asList(
                new GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new GameResult()
                    .withRank(3)
                    .withUserId("user-0004")
            ))
            .withKeyId("key-0001")
    );
    Ballot item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.VoteMultipleRequest;
using Gs2.Gs2SeasonRating.Result.VoteMultipleResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.VoteMultipleResult> asyncResult = null;
yield return client.VoteMultiple(
    new Gs2.Gs2SeasonRating.Request.VoteMultipleRequest()
        .WithNamespaceName("namespace1")
        .WithSignedBallots(new Gs2.Gs2SeasonRating.Model.SignedBallot[] {
            new Gs2.Gs2SeasonRating.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
            new Gs2.Gs2SeasonRating.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
            new Gs2.Gs2SeasonRating.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
            new Gs2.Gs2SeasonRating.Model.SignedBallot()
                .WithBody("aaa")
                .WithSignature("bbb"),
        })
        .WithGameResults(new Gs2.Gs2SeasonRating.Model.GameResult[] {
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(1)
                .WithUserId("user-0001"),
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0002"),
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(2)
                .WithUserId("user-0003"),
            new Gs2.Gs2SeasonRating.Model.GameResult()
                .WithRank(3)
                .WithUserId("user-0004"),
        })
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.voteMultiple(
        new Gs2SeasonRating.VoteMultipleRequest()
            .withNamespaceName("namespace1")
            .withSignedBallots([
                new Gs2SeasonRating.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new Gs2SeasonRating.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new Gs2SeasonRating.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
                new Gs2SeasonRating.model.SignedBallot()
                    .withBody("aaa")
                    .withSignature("bbb"),
            ])
            .withGameResults([
                new Gs2SeasonRating.model.GameResult()
                    .withRank(1)
                    .withUserId("user-0001"),
                new Gs2SeasonRating.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0002"),
                new Gs2SeasonRating.model.GameResult()
                    .withRank(2)
                    .withUserId("user-0003"),
                new Gs2SeasonRating.model.GameResult()
                    .withRank(3)
                    .withUserId("user-0004"),
            ])
            .withKeyId("key-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.vote_multiple(
        season_rating.VoteMultipleRequest()
            .with_namespace_name(self.hash1)
            .with_signed_ballots([
                season_rating.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
                season_rating.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
                season_rating.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
                season_rating.SignedBallot()
                    .with_body('aaa')
                    .with_signature('bbb'),
            ])
            .with_game_results([
                season_rating.GameResult()
                    .with_rank(1)
                    .with_user_id('user-0001'),
                season_rating.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0002'),
                season_rating.GameResult()
                    .with_rank(2)
                    .with_user_id('user-0003'),
                season_rating.GameResult()
                    .with_rank(3)
                    .with_user_id('user-0004'),
            ])
            .with_key_id(self.key1.key_id)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

api_result = client.vote_multiple({
    namespaceName="namespace1",
    signedBallots={
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        },
        {
            body="aaa",
            signature="bbb",
        }
    },
    gameResults={
        {
            rank=1,
            user_id="user-0001",
        },
        {
            rank=2,
            user_id="user-0002",
        },
        {
            rank=2,
            user_id="user-0003",
        },
        {
            rank=3,
            user_id="user-0004",
        }
    },
    keyId="key-0001",
})

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

result = api_result.result
item = result.item;

commitVote

Forced determination of voting status

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
seasonNamestring~ 128 charsSeason Model Name
sessionNamestring~ 128 charsMatchSession Name

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
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 := season_rating.Gs2SeasonRatingRestClient{
    Session: &session,
}
result, err := client.CommitVote(
    &season_rating.CommitVoteRequest {
        NamespaceName: pointy.String("namespace1"),
        SeasonName: pointy.String("rating-0001"),
        SessionName: pointy.String("gathering-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient;
use Gs2\SeasonRating\Request\CommitVoteRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    CommitVoteResult result = client.commitVote(
        new CommitVoteRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("rating-0001")
            .withSessionName("gathering-0001")
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient;
using Gs2.Gs2SeasonRating.Request.CommitVoteRequest;
using Gs2.Gs2SeasonRating.Result.CommitVoteResult;

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

AsyncResult<Gs2.Gs2SeasonRating.Result.CommitVoteResult> asyncResult = null;
yield return client.CommitVote(
    new Gs2.Gs2SeasonRating.Request.CommitVoteRequest()
        .WithNamespaceName("namespace1")
        .WithSeasonName("rating-0001")
        .WithSessionName("gathering-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2SeasonRating from '@/gs2/seasonRating';

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

try {
    const result = await client.commitVote(
        new Gs2SeasonRating.CommitVoteRequest()
            .withNamespaceName("namespace1")
            .withSeasonName("rating-0001")
            .withSessionName("gathering-0001")
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import season_rating

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

try:
    result = client.commit_vote(
        season_rating.CommitVoteRequest()
            .with_namespace_name(self.hash1)
            .with_season_name('rating-0001')
            .with_session_name('gathering-0001')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('seasonRating')

api_result = client.commit_vote({
    namespaceName="namespace1",
    seasonName="rating-0001",
    sessionName="gathering-0001",
})

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

result = api_result.result