GS2-SeasonRating SDK API Reference
Model
Namespace
Namespace
A Namespace allows multiple independent instances of the same service within a single project by separating data spaces and usage contexts. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the namespace differs, the data is treated as a completely independent data space.
Therefore, you must create a namespace before you can start using each service.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceId | string | * | ~ 1024 chars | Namespace GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| transactionSetting | TransactionSetting | ✓ | Transaction Settings Configuration for transaction processing used when applying season rating results. | |||
| logSetting | LogSetting | Log Output Settings Configuration for logging season rating operations such as ballot issuance, vote submissions, and rating calculations. When set, operation logs are output to the specified GS2-Log namespace. | ||||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
TransactionSetting
Transaction Settings
Transaction Settings control how transactions are executed, their consistency, asynchronous processing, and conflict avoidance mechanisms. Combining features like AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, and asynchronous Acquire Actions via GS2-JobQueue enables robust transaction management tailored to game logic.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| enableAtomicCommit | bool | false | Whether to commit the execution of transactions atomically | |||
| transactionUseDistributor | bool | {enableAtomicCommit} == true | false | Whether to execute transactions asynchronously * Applicable only if enableAtomicCommit is true | ||
| commitScriptResultInUseDistributor | bool | {transactionUseDistributor} == true | false | Whether to execute the commit processing of the script result asynchronously * Applicable only if transactionUseDistributor is true | ||
| acquireActionUseJobQueue | bool | {enableAtomicCommit} == true | false | Whether to use GS2-JobQueue to execute the acquire action * Applicable only if enableAtomicCommit is true | ||
| distributorNamespaceId | string | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024 chars | GS2-Distributor Namespace GRN used to execute transactions | ||
| queueNamespaceId | string | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024 chars | GS2-JobQueue Namespace GRN used to execute transactions |
ScriptSetting
Script Setting
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’s execution results to halt API execution or control the API’s response content.
In contrast, asynchronous execution does not block processing until the script has finished executing. However, because the script result cannot be used to stop the API execution or modify the API response, asynchronous execution does not affect the API response flow and is generally recommended.
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.
Details
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| triggerScriptId | string | ~ 1024 chars | GS2-Script script GRN
executed synchronously when the API is executed Must be specified in GRN format starting with “grn:gs2:”. | |||||||||||
| doneTriggerTargetType | String Enum enum { “none”, “gs2_script”, “aws” } | “none” | How to execute asynchronous scripts Specifies the type of script to use for asynchronous execution. You can choose from “Do not use asynchronous execution (none)”, “Use GS2-Script (gs2_script)”, and “Use Amazon EventBridge (aws)”.
| |||||||||||
| doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | GS2-Script script GRN
for asynchronous execution Must be specified in GRN format starting with “grn:gs2:”. * Applicable only if doneTriggerTargetType is “gs2_script” | ||||||||||
| doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | GS2-JobQueue namespace GRN
to execute asynchronous execution scripts If you want to execute asynchronous execution scripts via GS2-JobQueue instead of executing them directly, specify the GS2-JobQueue namespace GRN. There are not many cases where GS2-JobQueue is required, so you generally do not need to specify it unless you have a specific reason. * Applicable only if doneTriggerTargetType is “gs2_script” |
LogSetting
Log Output Settings
Log Output Settings define how log data is exported. This type holds the GS2-Log namespace identifier (Namespace ID) used to export log data. Specify the GS2-Log namespace where log data is collected and stored in the GRN format for the Log Namespace ID (loggingNamespaceId). Configuring this setting ensures that log data for API requests and responses occurring within the specified namespace is output to the target GS2-Log namespace. GS2-Log provides real-time logs that can be used for system monitoring, analysis, debugging, and other operational purposes.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| loggingNamespaceId | string | ✓ | ~ 1024 chars | GS2-Log namespace GRN
to output logs Must be specified in GRN format starting with “grn:gs2:”. |
GitHubCheckoutSetting
Setup to check out master data from GitHub
Details
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| apiKeyId | string | ✓ | ~ 1024 chars | GitHub API Key GRN | ||||||||||
| repositoryName | string | ✓ | ~ 1024 chars | Repository Name | ||||||||||
| sourcePath | string | ✓ | ~ 1024 chars | Master data (JSON) file path | ||||||||||
| referenceType | String Enum enum { “commit_hash”, “branch”, “tag” } | ✓ | Source of code
| |||||||||||
| commitHash | string | {referenceType} == “commit_hash” | ✓* | ~ 1024 chars | Commit hash * Required if referenceType is “commit_hash” | |||||||||
| branchName | string | {referenceType} == “branch” | ✓* | ~ 1024 chars | Branch Name * Required if referenceType is “branch” | |||||||||
| tagName | string | {referenceType} == “tag” | ✓* | ~ 1024 chars | Tag Name * Required if referenceType is “tag” |
MatchSession
Match Session
A temporary entity that manages the voting context for each match. Players obtain ballots from the MatchSession and finalize results through voting. It has a TTL (expiration time), and results are finalized upon majority vote or expiration.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| sessionId | string | * | ~ 1024 chars | MatchSession GRN * Set automatically by the server | ||
| name | string | ✓ | UUID | ~ 128 chars | Session name Session-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | |
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
Ballot
Ballot
A voting ticket issued to each player for a specific match session. Contains the match context (season, session, number of players) and the player’s user ID. The ballot is signed by the server and returned to the player, who then fills in game results and submits it back as part of a WrittenBallot. During vote aggregation, ballots from all participants are compared via majority consensus to prevent result manipulation.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| seasonName | string | ✓ | ~ 128 chars | Season Name The name of the season model used for this match’s rating calculations. References the SeasonModel that defines the tier structure and point adjustment rules applied to this match. | ||
| sessionName | string | ✓ | ~ 128 chars | Session Name The name of the match session this ballot belongs to. All ballots within the same session are aggregated together during the voting process. | ||
| numberOfPlayer | int | ✓ | 2 ~ 10 | Number of Players The total number of participants in this match. Determines when the vote is considered complete: all ballots must be collected (or majority achieved) before results are finalized. Valid range: 2 to 10. |
Vote
Vote
Aggregates the voting state for a specific match session within a season. Collects WrittenBallots from all participants and determines the official match result through majority consensus. The vote is considered complete when the number of submitted ballots reaches the expected number of players. If a majority (more than half) of ballots agree on the results, the outcome is finalized; otherwise, a “minority” error occurs.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| voteId | string | * | ~ 1024 chars | Vote GRN * Set automatically by the server | ||
| seasonName | string | ✓ | ~ 128 chars | Season Name The name of the season model associated with this vote. References the SeasonModel that defines the tier structure and point adjustment rules for this match. | ||
| sessionName | string | ✓ | ~ 128 chars | Session Name The name of the match session this vote belongs to. Combined with the season name, uniquely identifies the vote within the namespace. | ||
| writtenBallots | List<WrittenBallot> | [] | 0 ~ 10 items | List of Written Ballots The collection of submitted ballots from match participants. Each ballot is appended or replaced by user ID as players submit their results. When all expected players have submitted (or the session expires), the ballots are aggregated via majority consensus to determine the official match outcome. Maximum 10 entries (matching the maximum number of players per match). | ||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
SeasonModel
Season Model
Defines the tier structure and point adjustment rules applied during a season. Specifies tier-based point change ranges, entry fees, rank-up bonuses, and the Experience Model used for point management. Actual user data (points and tier affiliation) is managed by GS2-Experience.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| seasonModelId | string | * | ~ 1024 chars | Season Model GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Season Model name Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 128 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| tiers | List<TierModel> | ✓ | 1 ~ 100 items | List of Tier Models The ordered list of tier definitions that compose the season’s ranking ladder. Each tier defines its own point adjustment rules (entry fee, min/max change, rank-up bonus). Players progress through tiers based on their accumulated points managed by GS2-Experience. Minimum 1 tier, maximum 100 tiers. | ||
| experienceModelId | string | ✓ | ~ 1024 chars | Experience Model ID GRN of the GS2-Experience experience model used to manage season points and tier progression. The experience model’s rank thresholds determine tier boundaries, and experience values represent the player’s current season points. Point changes from match results are applied to this experience model. | ||
| challengePeriodEventId | string | ~ 1024 chars | Challenge Period Event ID GRN of the GS2-Schedule event that defines the period during which the season is open for competitive matches. When set, players can only participate in matches while the referenced event is active. If not set, the season has no time restriction. |
TierModel
Tier Model
TierModel defines the point adjustment rules for each tier within a season. Specifies point change ranges by rank, entry fees, and promotion bonuses. While actual point data is managed by GS2-Experience, the calculation logic for point adjustments is determined by the TierModel configuration.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| metadata | string | ~ 128 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| raiseRankBonus | int | ✓ | 0 ~ 10000 | Raise Rank Bonus Bonus points added when a player is promoted to this tier, providing a buffer to prevent immediate demotion. For example, if set to 100, the player starts the new tier with 100 extra points above the promotion threshold. Valid range: 0 to 10000. | ||
| entryFee | int | ✓ | 0 ~ 10000 | Entry Fee Points deducted from the player before the match begins as a participation cost. This fee is always subtracted regardless of the match outcome, creating a risk element in competitive play. Valid range: 0 to 10000. | ||
| minimumChangePoint | int | ✓ | -99999999 ~ -1 | Minimum Change Point The minimum (most negative) point change that can occur from a single match result, typically representing the worst-case loss. Must be a negative value. The actual point change for a losing player falls between this value and 0. Valid range: -99999999 to -1. | ||
| maximumChangePoint | int | ✓ | 1 ~ 99999999 | Maximum Change Point The maximum (most positive) point change that can occur from a single match result, typically representing the best-case win. Must be a positive value. The actual point change for a winning player falls between 0 and this value. Valid range: 1 to 99999999. |
VerifyActionResult
Verify Action execution result
Details
ConsumeActionResult
Consume Action execution result
Details
AcquireActionResult
Acquire Action execution result
Details
TransactionResult
Transaction execution results
Result of a transaction executed using the server-side automatic transaction execution feature
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| transactionId | string | ✓ | 36 ~ 36 chars | Transaction ID | ||
| verifyResults | List<VerifyActionResult> | 0 ~ 10 items | List of verify action execution results | |||
| consumeResults | List<ConsumeActionResult> | [] | 0 ~ 10 items | List of Consume Action execution results | ||
| acquireResults | List<AcquireActionResult> | [] | 0 ~ 100 items | List of Acquire Action execution results | ||
| hasError | bool | false | Whether an error occurred during transaction execution |
GameResult
Match Result
Represents the outcome of a single player in a match. Contains the player’s user ID and their finishing rank. Used within a WrittenBallot to report the results of all participants. During vote aggregation, game results are compared across all submitted ballots using majority consensus to determine the official outcome.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| rank | int | ✓ | 0 ~ 2147483646 | Rank The finishing position of this player in the match. 1 indicates first place (winner). The rank value is used to determine point adjustments based on the TierModel configuration. | ||
| userId | string | ✓ | ~ 128 chars | User ID |
SignedBallot
Signed Ballot
A ballot that has been cryptographically signed by the server using GS2-Key. The signature ensures that the ballot content (season, session, player, number of participants) has not been tampered with. When submitting a vote, the signed ballot is verified server-side before the game results are accepted.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| body | string | ✓ | ~ 1024 chars | Body The serialized JSON representation of the ballot data that serves as the signature target. Contains the ballot content (user ID, season name, session name, number of players) in a format that can be verified against the signature. Maximum 1024 characters. | ||
| signature | string | ✓ | ~ 256 chars | Signature The cryptographic signature generated by GS2-Key for the ballot body. Used to verify that the ballot was issued by the server and has not been modified by the client. Base64-encoded, maximum 256 characters. |
WrittenBallot
Written Ballot
A data model representing a ballot with written match results. It contains user IDs and ranks, and is submitted with a signature to the Vote API.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| ballot | Ballot | ✓ | Ballot The original ballot issued to the player for this match. Contains the match context (season, session, player ID, number of participants) and is used to identify the voter during aggregation. | |||
| gameResults | List<GameResult> | 0 ~ 10 items | List of Match Results The game results reported by this player, one entry per participant in the match. Each entry contains a user ID and rank. User IDs must be unique within the list (enforced by child_unique constraint). During vote aggregation, results are sorted by user ID and compared across all submitted ballots to reach majority consensus. Maximum 10 entries. |
CurrentSeasonModelMaster
Currently active Season Model master data
This master data describes the definitions of Season Models currently active within the namespace. GS2 uses JSON format files for managing master data. By uploading these files, the master data settings are updated on the server.
To create JSON files, GS2 provides a master data editor within the management console. Additionally, you can create tools better suited for game operations and export JSON files in the appropriate format.
Note
Please refer to Master Data Reference of GS2-SeasonRating for the JSON file format.Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceId | string | * | ~ 1024 chars | Namespace GRN * Set automatically by the server | ||
| settings | string | ✓ | ~ 5242880 bytes (5MB) | Master Data |
SeasonModelMaster
Season Model Master
Season Model Master is data used to edit and manage Season Model within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as Season Model actually referenced by the game.
Season models are master data that define the tier structure and point fluctuation rules applicable during the season period. Specifies tier-based point change ranges, entry fees, rank-up bonuses, and the Experience Model used for point management. Actual user data (points and tier affiliation) is managed by GS2-Experience.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| seasonModelId | string | * | ~ 1024 chars | Season Model Master GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Season Model name Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 128 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| description | string | ~ 1024 chars | Description | |||
| tiers | List<TierModel> | ✓ | 1 ~ 100 items | List of Tier Models The ordered list of tier definitions that compose the season’s ranking ladder. Each tier defines its own point adjustment rules (entry fee, min/max change, rank-up bonus). Players progress through tiers based on their accumulated points managed by GS2-Experience. Minimum 1 tier, maximum 100 tiers. | ||
| experienceModelId | string | ✓ | ~ 1024 chars | Experience Model ID GRN of the GS2-Experience experience model used to manage season points and tier progression. The experience model’s rank thresholds determine tier boundaries, and experience values represent the player’s current season points. Point changes from match results are applied to this experience model. | ||
| challengePeriodEventId | string | ~ 1024 chars | Challenge Period Event ID GRN of the GS2-Schedule event that defines the period during which the season is open for competitive matches. When set, players can only participate in matches while the referenced event is active. If not set, the season has no time restriction. | |||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
Methods
describeNamespaces
Get a list of Namespaces
Retrieves a list of namespaces that have been created on a per-service basis within the project. You can use the optional page token to start acquiring data from a specific location in the list. You can also limit the number of namespaces to be acquired.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namePrefix | string | ~ 64 chars | Filter by Namespace name prefix | |||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data acquired |
Result
| Type | Description | |
|---|---|---|
| items | List<Namespace> | List of Namespace |
| nextPageToken | string | Page 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/seasonRating"
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 {
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->describeNamespaces(
(new DescribeNamespacesRequest())
->withNamePrefix(null)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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()
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<Namespace> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2SeasonRating.Request.DescribeNamespacesRequest()
.WithNamePrefix(null)
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as 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()
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import 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_name_prefix(None)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.describe_namespaces({
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('season_rating')
api_result_handler = client.describe_namespaces_async({
namePrefix=nil,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createNamespace
Create a new Namespace
You must specify detailed information including the name, description, and various settings of the namespace.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| transactionSetting | TransactionSetting | ✓ | Transaction Settings Configuration for transaction processing used when applying season rating results. | |||
| logSetting | LogSetting | Log Output Settings Configuration for logging season rating operations such as ballot issuance, vote submissions, and rating calculations. When set, operation logs are output to the specified GS2-Log namespace. |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | Namespace created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
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.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->createNamespace(
(new CreateNamespaceRequest())
->withName("namespace-0001")
->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("namespace-0001")
.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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2SeasonRating.Request.CreateNamespaceRequest()
.WithName("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.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('season_rating')
api_result = client.create_namespace({
name="namespace-0001",
description=nil,
transactionSetting=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.create_namespace_async({
name="namespace-0001",
description=nil,
transactionSetting=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getNamespaceStatus
Get Namespace status
Get the current status of the specified namespace. This includes whether the Namespace is active, pending, or in some other state.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| status | string |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
status := result.Statususe 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->getNamespaceStatus(
(new GetNamespaceStatusRequest())
->withNamespaceName("namespace-0001")
);
$status = $result->getStatus();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
);
String status = result.getStatus();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2SeasonRating.Request.GetNamespaceStatusRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
);
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('namespace-0001')
)
status = result.status
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.get_namespace_status({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
status = result.status;client = gs2('season_rating')
api_result_handler = client.get_namespace_status_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
status = result.status;getNamespace
Get namespace
Get detailed information about the specified namespace. This includes the name, description, and other settings of the namespace.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | Namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->getNamespace(
(new GetNamespaceRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2SeasonRating.Request.GetNamespaceRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as 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("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.get_namespace(
season_rating.GetNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.get_namespace({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.get_namespace_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateNamespace
Update Namespace
Update the settings of the specified namespace. You can change the description of the Namespace and specific settings.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| transactionSetting | TransactionSetting | ✓ | Transaction Settings Configuration for transaction processing used when applying season rating results. | |||
| logSetting | LogSetting | Log Output Settings Configuration for logging season rating operations such as ballot issuance, vote submissions, and rating calculations. When set, operation logs are output to the specified GS2-Log namespace. |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | Namespace updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
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.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->updateNamespace(
(new UpdateNamespaceRequest())
->withNamespaceName("namespace-0001")
->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("namespace-0001")
.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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2SeasonRating.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.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('season_rating')
api_result = client.update_namespace({
namespaceName="namespace-0001",
description="description1",
transactionSetting=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.update_namespace_async({
namespaceName="namespace-0001",
description="description1",
transactionSetting=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteNamespace
Delete Namespace
Delete the specified namespace. This operation is irreversible and all data associated with the deleted Namespace will be lost.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | The deleted Namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->deleteNamespace(
(new DeleteNamespaceRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2SeasonRating.Request.DeleteNamespaceRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as 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("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.delete_namespace(
season_rating.DeleteNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.delete_namespace({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.delete_namespace_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getServiceVersion
Get the microservice version
Details
Request
Request parameters: None
Result
| Type | Description | |
|---|---|---|
| item | string | Version |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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.GetServiceVersion(
&season_rating.GetServiceVersionRequest {
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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\GetServiceVersionRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->getServiceVersion(
(new GetServiceVersionRequest())
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.GetServiceVersionRequest;
import io.gs2.seasonRating.result.GetServiceVersionResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2SeasonRatingRestClient client = new Gs2SeasonRatingRestClient(session);
try {
GetServiceVersionResult result = client.getServiceVersion(
new GetServiceVersionRequest()
);
String item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
new Gs2.Gs2SeasonRating.Request.GetServiceVersionRequest(),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as 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.getServiceVersion(
new Gs2SeasonRating.GetServiceVersionRequest()
);
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_service_version(
season_rating.GetServiceVersionRequest()
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.get_service_version({
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.get_service_version_async({
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;dumpUserDataByUserId
Dump data associated with the specified user ID
Can be used to meet legal requirements for the protection of personal information, or to back up or migrate data.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description |
|---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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 Gs2SeasonRatingRestClient(
$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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new 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('season_rating')
api_result = client.dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultclient = gs2('season_rating')
api_result_handler = client.dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultcheckDumpUserDataByUserId
Check if the dump of the data associated with the specified user ID is complete
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| url | string | URL of output data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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.Urluse 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 Gs2SeasonRatingRestClient(
$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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new 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('season_rating')
api_result = client.check_dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
url = result.url;client = gs2('season_rating')
api_result_handler = client.check_dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
url = result.url;cleanUserDataByUserId
Delete user data
Execute cleaning of data associated with the specified user ID This allows you to safely delete specific user data from the project.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description |
|---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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 Gs2SeasonRatingRestClient(
$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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new 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('season_rating')
api_result = client.clean_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultclient = gs2('season_rating')
api_result_handler = client.clean_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultcheckCleanUserDataByUserId
Check if the clean of the data associated with the specified user ID is complete
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description |
|---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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 Gs2SeasonRatingRestClient(
$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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new 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('season_rating')
api_result = client.check_clean_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultclient = gs2('season_rating')
api_result_handler = client.check_clean_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultprepareImportUserDataByUserId
Execute import of data associated with the specified user ID
The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.
You can start the actual import process by uploading the exported zip file to the URL returned in the return value of this API and calling importUserDataByUserId.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| uploadToken | string | Token used to reflect results after upload |
| uploadUrl | string | URL used to upload user data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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.UploadUrluse 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 Gs2SeasonRatingRestClient(
$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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new 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('season_rating')
api_result = client.prepare_import_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;client = gs2('season_rating')
api_result_handler = client.prepare_import_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;importUserDataByUserId
Execute import of data associated with the specified user ID
The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.
Before calling this API, you must call prepareImportUserDataByUserId to complete the upload preparation.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| uploadToken | string | ✓ | ~ 1024 chars | Token received in preparation for upload | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description |
|---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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 Gs2SeasonRatingRestClient(
$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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new 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('season_rating')
api_result = client.import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultclient = gs2('season_rating')
api_result_handler = client.import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultcheckImportUserDataByUserId
Check if the import of the data associated with the specified user ID is complete
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| uploadToken | string | ✓ | ~ 1024 chars | Token received in preparation for upload | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| url | string | URL of log data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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.Urluse 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 Gs2SeasonRatingRestClient(
$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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new 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('season_rating')
api_result = client.check_import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
url = result.url;client = gs2('season_rating')
api_result_handler = client.check_import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
url = result.url;describeMatchSessions
Get a list of MatchSessions
Retrieves a paginated list of match sessions in the namespace. Match sessions represent individual matches and are used to group players for rating calculation.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data acquired |
Result
| Type | Description | |
|---|---|---|
| items | List<MatchSession> | List of MatchSession |
| nextPageToken | string | Page 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/seasonRating"
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("namespace-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->describeMatchSessions(
(new DescribeMatchSessionsRequest())
->withNamespaceName("namespace-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
List<MatchSession> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.DescribeMatchSessionsResult> asyncResult = null;
yield return client.DescribeMatchSessions(
new Gs2.Gs2SeasonRating.Request.DescribeMatchSessionsRequest()
.WithNamespaceName("namespace-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import 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('namespace-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.describe_match_sessions({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('season_rating')
api_result_handler = client.describe_match_sessions_async({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
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.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| sessionName | string | UUID | ~ 128 chars | Session name Session-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| ttlSeconds | int | 60 | 60 ~ 7200 | MatchSession expiration time (seconds) |
Result
| Type | Description | |
|---|---|---|
| item | MatchSession | Created MatchSession |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
SessionName: pointy.String("matchSession-0001"),
TtlSeconds: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->createMatchSession(
(new CreateMatchSessionRequest())
->withNamespaceName("namespace-0001")
->withSessionName("matchSession-0001")
->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("namespace-0001")
.withSessionName("matchSession-0001")
.withTtlSeconds(null)
);
MatchSession item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.CreateMatchSessionResult> asyncResult = null;
yield return client.CreateMatchSession(
new Gs2.Gs2SeasonRating.Request.CreateMatchSessionRequest()
.WithNamespaceName("namespace-0001")
.WithSessionName("matchSession-0001")
.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("namespace-0001")
.withSessionName("matchSession-0001")
.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('namespace-0001')
.with_session_name('matchSession-0001')
.with_ttl_seconds(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.create_match_session({
namespaceName="namespace-0001",
sessionName="matchSession-0001",
ttlSeconds=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.create_match_session_async({
namespaceName="namespace-0001",
sessionName="matchSession-0001",
ttlSeconds=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getMatchSession
Get MatchSession
Retrieves the specified match session including its name and TTL information.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| sessionName | string | ✓ | UUID | ~ 128 chars | Session name Session-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | MatchSession | MatchSession |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
SessionName: pointy.String("matchSession-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->getMatchSession(
(new GetMatchSessionRequest())
->withNamespaceName("namespace-0001")
->withSessionName("matchSession-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.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("namespace-0001")
.withSessionName("matchSession-0001")
);
MatchSession item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.GetMatchSessionResult> asyncResult = null;
yield return client.GetMatchSession(
new Gs2.Gs2SeasonRating.Request.GetMatchSessionRequest()
.WithNamespaceName("namespace-0001")
.WithSessionName("matchSession-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.getMatchSession(
new Gs2SeasonRating.GetMatchSessionRequest()
.withNamespaceName("namespace-0001")
.withSessionName("matchSession-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.get_match_session(
season_rating.GetMatchSessionRequest()
.with_namespace_name('namespace-0001')
.with_session_name('matchSession-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.get_match_session({
namespaceName="namespace-0001",
sessionName="matchSession-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.get_match_session_async({
namespaceName="namespace-0001",
sessionName="matchSession-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteMatchSession
Delete MatchSession
Deletes the specified match session. Any pending votes associated with the session will also be invalidated.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| sessionName | string | ✓ | UUID | ~ 128 chars | Session name Session-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | MatchSession | MatchSession deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
SessionName: pointy.String("matchSession-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->deleteMatchSession(
(new DeleteMatchSessionRequest())
->withNamespaceName("namespace-0001")
->withSessionName("matchSession-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.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("namespace-0001")
.withSessionName("matchSession-0001")
);
MatchSession item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.DeleteMatchSessionResult> asyncResult = null;
yield return client.DeleteMatchSession(
new Gs2.Gs2SeasonRating.Request.DeleteMatchSessionRequest()
.WithNamespaceName("namespace-0001")
.WithSessionName("matchSession-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.deleteMatchSession(
new Gs2SeasonRating.DeleteMatchSessionRequest()
.withNamespaceName("namespace-0001")
.withSessionName("matchSession-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.delete_match_session(
season_rating.DeleteMatchSessionRequest()
.with_namespace_name('namespace-0001')
.with_session_name('matchSession-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.delete_match_session({
namespaceName="namespace-0001",
sessionName="matchSession-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.delete_match_session_async({
namespaceName="namespace-0001",
sessionName="matchSession-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getBallot
Prepared ballot along with signatures
Issues a ballot for the requesting user to participate in a match session’s rating vote. Validates that the player is within the season’s challenge period, deducts any configured entry fee from the player’s rating, and generates a signed ballot using the specified encryption key. The signed ballot is then used when submitting vote or voteMultiple.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| seasonName | string | ✓ | ~ 128 chars | Season Model name Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| sessionName | string | ✓ | UUID | ~ 128 chars | Session name Session-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | |
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| numberOfPlayer | int | ✓ | 2 ~ 10 | Number of participants | ||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024 chars | Encryption Key GRN |
Result
| Type | Description | |
|---|---|---|
| item | Ballot | Ballot |
| body | string | Data to be signed |
| signature | string | Signature |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
SeasonName: pointy.String("season-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.Signatureuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->getBallot(
(new GetBallotRequest())
->withNamespaceName("namespace-0001")
->withSeasonName("season-0001")
->withSessionName("gathering-0001")
->withAccessToken("accessToken-0001")
->withNumberOfPlayer(4)
->withKeyId("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("namespace-0001")
.withSeasonName("season-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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.GetBallotResult> asyncResult = null;
yield return client.GetBallot(
new Gs2.Gs2SeasonRating.Request.GetBallotRequest()
.WithNamespaceName("namespace-0001")
.WithSeasonName("season-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("namespace-0001")
.withSeasonName("season-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('namespace-0001')
.with_season_name('season-0001')
.with_session_name('gathering-0001')
.with_access_token('accessToken-0001')
.with_number_of_player(4)
.with_key_id('key-0001')
)
item = result.item
body = result.body
signature = result.signature
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.get_ballot({
namespaceName="namespace-0001",
seasonName="season-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['errorMessage'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;client = gs2('season_rating')
api_result_handler = client.get_ballot_async({
namespaceName="namespace-0001",
seasonName="season-0001",
sessionName="gathering-0001",
accessToken="accessToken-0001",
numberOfPlayer=4,
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;getBallotByUserId
Create ballot with signatures, specifying user ID
Issues a ballot for the specified user to participate in a match session’s rating vote. Validates the challenge period, deducts entry fees, and generates a signed ballot using the specified encryption key.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| seasonName | string | ✓ | ~ 128 chars | Season Model name Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| sessionName | string | ✓ | UUID | ~ 128 chars | Session name Session-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | |
| userId | string | ✓ | ~ 128 chars | User ID | ||
| numberOfPlayer | int | ✓ | 2 ~ 10 | Number of participants | ||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024 chars | Encryption Key GRN | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | Ballot | Ballot |
| body | string | Data to be signed |
| signature | string | Signature |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
SeasonName: pointy.String("season-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.Signatureuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->getBallotByUserId(
(new GetBallotByUserIdRequest())
->withNamespaceName("namespace-0001")
->withSeasonName("season-0001")
->withSessionName("gathering-0001")
->withUserId("user-0001")
->withNumberOfPlayer(4)
->withKeyId("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("namespace-0001")
.withSeasonName("season-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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.GetBallotByUserIdResult> asyncResult = null;
yield return client.GetBallotByUserId(
new Gs2.Gs2SeasonRating.Request.GetBallotByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithSeasonName("season-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("namespace-0001")
.withSeasonName("season-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('namespace-0001')
.with_season_name('season-0001')
.with_session_name('gathering-0001')
.with_user_id('user-0001')
.with_number_of_player(4)
.with_key_id('key-0001')
.with_time_offset_token(None)
)
item = result.item
body = result.body
signature = result.signature
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.get_ballot_by_user_id({
namespaceName="namespace-0001",
seasonName="season-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['errorMessage'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;client = gs2('season_rating')
api_result_handler = client.get_ballot_by_user_id_async({
namespaceName="namespace-0001",
seasonName="season-0001",
sessionName="gathering-0001",
userId="user-0001",
numberOfPlayer=4,
keyId="key-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;vote
Vote on match results
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.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| ballotBody | string | ✓ | ~ 1024 chars | Data for ballot signature targets | ||
| ballotSignature | string | ✓ | ~ 256 chars | Signature | ||
| gameResults | List<GameResult> | 0 ~ 10 items | Match Results List of user IDs belonging to the player group that participated in the match | |||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024 chars | Encryption Key GRN |
Result
| Type | Description | |
|---|---|---|
| item | Ballot | Ballot |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
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.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->vote(
(new VoteRequest())
->withNamespaceName("namespace-0001")
->withBallotBody("ballotBody...")
->withBallotSignature("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("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("namespace-0001")
.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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.VoteResult> asyncResult = null;
yield return client.Vote(
new Gs2.Gs2SeasonRating.Request.VoteRequest()
.WithNamespaceName("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.with_ballot_body('ballotBody...')
.with_ballot_signature('ballotSignature...')
.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('key-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.vote({
namespaceName="namespace-0001",
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['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.vote_async({
namespaceName="namespace-0001",
ballotBody="ballotBody...",
ballotSignature="ballotSignature...",
gameResults={
{
rank=1,
user_id="user-0001",
},
{
rank=2,
user_id="user-0002",
},
{
rank=2,
user_id="user-0003",
},
{
rank=3,
user_id="user-0004",
}
},
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;voteMultiple
Compile match results and vote
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.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| signedBallots | List<SignedBallot> | 0 ~ 10 items | List of Ballot with signatures | |||
| gameResults | List<GameResult> | 0 ~ 10 items | List of Results | |||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024 chars | Encryption Key GRN |
Result
| Type | Description | |
|---|---|---|
| item | Ballot | Ballot |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
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.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->voteMultiple(
(new VoteMultipleRequest())
->withNamespaceName("namespace-0001")
->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("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("namespace-0001")
.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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.VoteMultipleResult> asyncResult = null;
yield return client.VoteMultiple(
new Gs2.Gs2SeasonRating.Request.VoteMultipleRequest()
.WithNamespaceName("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.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('key-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.vote_multiple({
namespaceName="namespace-0001",
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['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.vote_multiple_async({
namespaceName="namespace-0001",
signedBallots={
{
body="aaa",
signature="bbb",
},
{
body="aaa",
signature="bbb",
},
{
body="aaa",
signature="bbb",
},
{
body="aaa",
signature="bbb",
}
},
gameResults={
{
rank=1,
user_id="user-0001",
},
{
rank=2,
user_id="user-0002",
},
{
rank=2,
user_id="user-0003",
},
{
rank=3,
user_id="user-0004",
}
},
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;commitVote
Forced determination of voting status
Manually triggers the rating calculation for a match session without waiting for all votes to be collected. Processes the pending votes, calculates rating changes based on the current vote state, and deletes the vote record and match session after processing.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| seasonName | string | ✓ | ~ 128 chars | Season Model name Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| sessionName | string | ✓ | ~ 128 chars | Session Name The name of the match session this vote belongs to. Combined with the season name, uniquely identifies the vote within the namespace. |
Result
| Type | Description |
|---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->commitVote(
(new CommitVoteRequest())
->withNamespaceName("namespace-0001")
->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("namespace-0001")
.withSeasonName("rating-0001")
.withSessionName("gathering-0001")
);
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.CommitVoteResult> asyncResult = null;
yield return client.CommitVote(
new Gs2.Gs2SeasonRating.Request.CommitVoteRequest()
.WithNamespaceName("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.with_season_name('rating-0001')
.with_session_name('gathering-0001')
)
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.commit_vote({
namespaceName="namespace-0001",
seasonName="rating-0001",
sessionName="gathering-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultclient = gs2('season_rating')
api_result_handler = client.commit_vote_async({
namespaceName="namespace-0001",
seasonName="rating-0001",
sessionName="gathering-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultdescribeSeasonModels
Get a list of Season Models
Retrieves the list of currently active season models. Season models define the rating tiers, experience model reference, and challenge period event for seasonal rating calculations.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<SeasonModel> | List of Season Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->describeSeasonModels(
(new DescribeSeasonModelsRequest())
->withNamespaceName("namespace-0001")
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
);
List<SeasonModel> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.DescribeSeasonModelsResult> asyncResult = null;
yield return client.DescribeSeasonModels(
new Gs2.Gs2SeasonRating.Request.DescribeSeasonModelsRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
);
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('namespace-0001')
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.describe_season_models({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('season_rating')
api_result_handler = client.describe_season_models_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;getSeasonModel
Get Season Model
Retrieves the specified season model including its rating tiers, experience model reference, and challenge period event configuration.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| seasonName | string | ✓ | ~ 128 chars | Season Model name Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | SeasonModel | Season Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
SeasonName: pointy.String("mode1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->getSeasonModel(
(new GetSeasonModelRequest())
->withNamespaceName("namespace-0001")
->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("namespace-0001")
.withSeasonName("mode1")
);
SeasonModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.GetSeasonModelResult> asyncResult = null;
yield return client.GetSeasonModel(
new Gs2.Gs2SeasonRating.Request.GetSeasonModelRequest()
.WithNamespaceName("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.with_season_name('mode1')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.get_season_model({
namespaceName="namespace-0001",
seasonName="mode1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.get_season_model_async({
namespaceName="namespace-0001",
seasonName="mode1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;exportMaster
Export Model Master in a master data format that can be activated
Exports the currently registered season model masters in an activatable master data format. The exported data contains all season rating definitions including rating tiers, experience model references, and challenge period configurations.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | CurrentSeasonModelMaster | master data that can be activated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->exportMaster(
(new ExportMasterRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
);
CurrentSeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
new Gs2.Gs2SeasonRating.Request.ExportMasterRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as 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("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.export_master(
season_rating.ExportMasterRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.export_master({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.export_master_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getCurrentSeasonModelMaster
Get currently active Season Model master data
Retrieves the currently active season model master data including all season rating definitions that are being used for rating calculations.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | CurrentSeasonModelMaster | Currently active Season Model master data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->getCurrentSeasonModelMaster(
(new GetCurrentSeasonModelMasterRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
);
CurrentSeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.GetCurrentSeasonModelMasterResult> asyncResult = null;
yield return client.GetCurrentSeasonModelMaster(
new Gs2.Gs2SeasonRating.Request.GetCurrentSeasonModelMasterRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as 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("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.get_current_season_model_master(
season_rating.GetCurrentSeasonModelMasterRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.get_current_season_model_master({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.get_current_season_model_master_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;preUpdateCurrentSeasonModelMaster
Update currently active Season Model master data (3-phase version)
When uploading master data larger than 1MB, the update is performed in 3 phases.
- Execute this API to obtain a token and URL for uploading.
- Upload the master data to the obtained URL.
- Execute UpdateCurrentModelMaster by passing the token obtained from the the upload to reflect the master data.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| uploadToken | string | Token used to reflect results after upload |
| uploadUrl | string | URL used to upload |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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.PreUpdateCurrentSeasonModelMaster(
&season_rating.PreUpdateCurrentSeasonModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrluse 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\PreUpdateCurrentSeasonModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->preUpdateCurrentSeasonModelMaster(
(new PreUpdateCurrentSeasonModelMasterRequest())
->withNamespaceName("namespace-0001")
);
$uploadToken = $result->getUploadToken();
$uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient;
import io.gs2.seasonRating.request.PreUpdateCurrentSeasonModelMasterRequest;
import io.gs2.seasonRating.result.PreUpdateCurrentSeasonModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2SeasonRatingRestClient client = new Gs2SeasonRatingRestClient(session);
try {
PreUpdateCurrentSeasonModelMasterResult result = client.preUpdateCurrentSeasonModelMaster(
new PreUpdateCurrentSeasonModelMasterRequest()
.withNamespaceName("namespace-0001")
);
String uploadToken = result.getUploadToken();
String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.PreUpdateCurrentSeasonModelMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentSeasonModelMaster(
new Gs2.Gs2SeasonRating.Request.PreUpdateCurrentSeasonModelMasterRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;import Gs2Core from '@/gs2/core';
import * as 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.preUpdateCurrentSeasonModelMaster(
new Gs2SeasonRating.PreUpdateCurrentSeasonModelMasterRequest()
.withNamespaceName("namespace-0001")
);
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.pre_update_current_season_model_master(
season_rating.PreUpdateCurrentSeasonModelMasterRequest()
.with_namespace_name('namespace-0001')
)
upload_token = result.upload_token
upload_url = result.upload_url
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.pre_update_current_season_model_master({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;client = gs2('season_rating')
api_result_handler = client.pre_update_current_season_model_master_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;updateCurrentSeasonModelMaster
Update currently active Season Model master data
Updates the currently active season model master data. Supports both direct update mode and pre-upload mode for handling large master data. In pre-upload mode, the settings are read using the upload token obtained from the PreUpdate API.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| mode | String Enum enum { “direct”, “preUpload” } | “direct” | Update mode
| |||||||||
| settings | string | {mode} == “direct” | ✓* | ~ 5242880 chars | Master Data * Required if mode is “direct” | |||||||
| uploadToken | string | {mode} == “preUpload” | ✓* | ~ 1024 chars | Token obtained by pre-upload Used to apply the uploaded master data. * Required if mode is “preUpload” |
Result
| Type | Description | |
|---|---|---|
| item | CurrentSeasonModelMaster | Updated master data of the currently active Season Models |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
Mode: pointy.String("direct"),
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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\", \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}]}"),
UploadToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->updateCurrentSeasonModelMaster(
(new UpdateCurrentSeasonModelMasterRequest())
->withNamespaceName("namespace-0001")
->withMode("direct")
->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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\", \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}]}")
->withUploadToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
.withMode("direct")
.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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\", \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}]}")
.withUploadToken(null)
);
CurrentSeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.UpdateCurrentSeasonModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentSeasonModelMaster(
new Gs2.Gs2SeasonRating.Request.UpdateCurrentSeasonModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithMode("direct")
.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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\", \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}]}")
.WithUploadToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
.withMode("direct")
.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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\", \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}]}")
.withUploadToken(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_current_season_model_master(
season_rating.UpdateCurrentSeasonModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_mode('direct')
.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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level", "challengePeriodEventId": "grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"}]}')
.with_upload_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.update_current_season_model_master({
namespaceName="namespace-0001",
mode="direct",
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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\", \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}]}",
uploadToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.update_current_season_model_master_async({
namespaceName="namespace-0001",
mode="direct",
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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level\", \"challengePeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001\"}]}",
uploadToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateCurrentSeasonModelMasterFromGitHub
Update currently active Season Model master data from GitHub
Updates the currently active season model master data by checking out master data from a GitHub repository using the specified checkout settings. The API key is decrypted via the key service to authenticate with GitHub.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| checkoutSetting | GitHubCheckoutSetting | ✓ | Setup to check out master data from GitHub |
Result
| Type | Description | |
|---|---|---|
| item | CurrentSeasonModelMaster | Updated master data of the currently active Season Models |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
CheckoutSetting: &seasonRating.GitHubCheckoutSetting{
ApiKeyId: pointy.String("apiKeyId-0001"),
RepositoryName: pointy.String("gs2io/master-data"),
SourcePath: pointy.String("path/to/file.json"),
ReferenceType: pointy.String("branch"),
BranchName: pointy.String("develop"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->updateCurrentSeasonModelMasterFromGitHub(
(new UpdateCurrentSeasonModelMasterFromGitHubRequest())
->withNamespaceName("namespace-0001")
->withCheckoutSetting((new GitHubCheckoutSetting())
->withApiKeyId("apiKeyId-0001")
->withRepositoryName("gs2io/master-data")
->withSourcePath("path/to/file.json")
->withReferenceType("branch")
->withBranchName("develop")
)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
.withCheckoutSetting(new GitHubCheckoutSetting()
.withApiKeyId("apiKeyId-0001")
.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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.UpdateCurrentSeasonModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentSeasonModelMasterFromGitHub(
new Gs2.Gs2SeasonRating.Request.UpdateCurrentSeasonModelMasterFromGitHubRequest()
.WithNamespaceName("namespace-0001")
.WithCheckoutSetting(new Gs2.Gs2SeasonRating.Model.GitHubCheckoutSetting()
.WithApiKeyId("apiKeyId-0001")
.WithRepositoryName("gs2io/master-data")
.WithSourcePath("path/to/file.json")
.WithReferenceType("branch")
.WithBranchName("develop")
),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
.withCheckoutSetting(new Gs2SeasonRating.model.GitHubCheckoutSetting()
.withApiKeyId("apiKeyId-0001")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import 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('namespace-0001')
.with_checkout_setting(season_rating.GitHubCheckoutSetting()
.with_api_key_id('apiKeyId-0001')
.with_repository_name('gs2io/master-data')
.with_source_path('path/to/file.json')
.with_reference_type('branch')
.with_branch_name('develop')
)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.update_current_season_model_master_from_git_hub({
namespaceName="namespace-0001",
checkoutSetting={
api_key_id="apiKeyId-0001",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.update_current_season_model_master_from_git_hub_async({
namespaceName="namespace-0001",
checkoutSetting={
api_key_id="apiKeyId-0001",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;describeSeasonModelMasters
Get a list of Season Model Masters
Retrieves a paginated list of season model masters. Can filter by name prefix. Season model masters define rating tiers, experience model reference, and challenge period event for seasonal rating.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| namePrefix | string | ~ 64 chars | Filter by Season Model name prefix | |||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data acquired |
Result
| Type | Description | |
|---|---|---|
| items | List<SeasonModelMaster> | List of Season Model Master |
| nextPageToken | string | Page 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/seasonRating"
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("namespace-0001"),
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->describeSeasonModelMasters(
(new DescribeSeasonModelMastersRequest())
->withNamespaceName("namespace-0001")
->withNamePrefix(null)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<SeasonModelMaster> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.DescribeSeasonModelMastersResult> asyncResult = null;
yield return client.DescribeSeasonModelMasters(
new Gs2.Gs2SeasonRating.Request.DescribeSeasonModelMastersRequest()
.WithNamespaceName("namespace-0001")
.WithNamePrefix(null)
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import 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('namespace-0001')
.with_name_prefix(None)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.describe_season_model_masters({
namespaceName="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('season_rating')
api_result_handler = client.describe_season_model_masters_async({
namespaceName="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createSeasonModelMaster
Create a new Season Model Master
Creates a new season model master with rating tiers, a reference to a GS2-Experience experience model for rating storage, and an optional challenge period event ID to restrict when players can participate.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| name | string | ✓ | ~ 128 chars | Season Model name Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 128 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| tiers | List<TierModel> | ✓ | 1 ~ 100 items | List of Tier Models The ordered list of tier definitions that compose the season’s ranking ladder. Each tier defines its own point adjustment rules (entry fee, min/max change, rank-up bonus). Players progress through tiers based on their accumulated points managed by GS2-Experience. Minimum 1 tier, maximum 100 tiers. | ||
| experienceModelId | string | ✓ | ~ 1024 chars | Experience Model ID GRN of the GS2-Experience experience model used to manage season points and tier progression. The experience model’s rank thresholds determine tier boundaries, and experience values represent the player’s current season points. Point changes from match results are applied to this experience model. | ||
| challengePeriodEventId | string | ~ 1024 chars | Challenge Period Event ID GRN of the GS2-Schedule event that defines the period during which the season is open for competitive matches. When set, players can only participate in matches while the referenced event is active. If not set, the season has no time restriction. |
Result
| Type | Description | |
|---|---|---|
| item | SeasonModelMaster | Created Rating Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level"),
ChallengePeriodEventId: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->createSeasonModelMaster(
(new CreateSeasonModelMasterRequest())
->withNamespaceName("namespace-0001")
->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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model: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("namespace-0001")
.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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level")
.withChallengePeriodEventId(null)
);
SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.CreateSeasonModelMasterResult> asyncResult = null;
yield return client.CreateSeasonModelMaster(
new Gs2.Gs2SeasonRating.Request.CreateSeasonModelMasterRequest()
.WithNamespaceName("namespace-0001")
.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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model: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("namespace-0001")
.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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model: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('namespace-0001')
.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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level')
.with_challenge_period_event_id(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.create_season_model_master({
namespaceName="namespace-0001",
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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level",
challengePeriodEventId=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.create_season_model_master_async({
namespaceName="namespace-0001",
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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level",
challengePeriodEventId=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getSeasonModelMaster
Get Season Model Master
Retrieves the specified season model master including its rating tiers, experience model reference, and challenge period event configuration.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| seasonName | string | ✓ | ~ 128 chars | Season Model name Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | SeasonModelMaster | Season Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
SeasonName: pointy.String("mode1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->getSeasonModelMaster(
(new GetSeasonModelMasterRequest())
->withNamespaceName("namespace-0001")
->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("namespace-0001")
.withSeasonName("mode1")
);
SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.GetSeasonModelMasterResult> asyncResult = null;
yield return client.GetSeasonModelMaster(
new Gs2.Gs2SeasonRating.Request.GetSeasonModelMasterRequest()
.WithNamespaceName("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.with_season_name('mode1')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.get_season_model_master({
namespaceName="namespace-0001",
seasonName="mode1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.get_season_model_master_async({
namespaceName="namespace-0001",
seasonName="mode1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateSeasonModelMaster
Update Season Model Master
Updates the specified season model master’s rating tiers, experience model reference, challenge period event, and other properties.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| seasonName | string | ✓ | ~ 128 chars | Season Model name Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 128 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| tiers | List<TierModel> | ✓ | 1 ~ 100 items | List of Tier Models The ordered list of tier definitions that compose the season’s ranking ladder. Each tier defines its own point adjustment rules (entry fee, min/max change, rank-up bonus). Players progress through tiers based on their accumulated points managed by GS2-Experience. Minimum 1 tier, maximum 100 tiers. | ||
| experienceModelId | string | ✓ | ~ 1024 chars | Experience Model ID GRN of the GS2-Experience experience model used to manage season points and tier progression. The experience model’s rank thresholds determine tier boundaries, and experience values represent the player’s current season points. Point changes from match results are applied to this experience model. | ||
| challengePeriodEventId | string | ~ 1024 chars | Challenge Period Event ID GRN of the GS2-Schedule event that defines the period during which the season is open for competitive matches. When set, players can only participate in matches while the referenced event is active. If not set, the season has no time restriction. |
Result
| Type | Description | |
|---|---|---|
| item | SeasonModelMaster | Season Model Master updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2"),
ChallengePeriodEventId: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->updateSeasonModelMaster(
(new UpdateSeasonModelMasterRequest())
->withNamespaceName("namespace-0001")
->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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model: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("namespace-0001")
.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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2")
.withChallengePeriodEventId(null)
);
SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.UpdateSeasonModelMasterResult> asyncResult = null;
yield return client.UpdateSeasonModelMaster(
new Gs2.Gs2SeasonRating.Request.UpdateSeasonModelMasterRequest()
.WithNamespaceName("namespace-0001")
.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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model: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("namespace-0001")
.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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model: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('namespace-0001')
.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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2')
.with_challenge_period_event_id(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.update_season_model_master({
namespaceName="namespace-0001",
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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2",
challengePeriodEventId=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.update_season_model_master_async({
namespaceName="namespace-0001",
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:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:level2",
challengePeriodEventId=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteSeasonModelMaster
Delete Season Model Master
Deletes the specified season model master.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| seasonName | string | ✓ | ~ 128 chars | Season Model name Season Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | SeasonModelMaster | Season Model Master deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/seasonRating"
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("namespace-0001"),
SeasonName: pointy.String("mode1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse 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 Gs2SeasonRatingRestClient(
$session
);
try {
$result = $client->deleteSeasonModelMaster(
(new DeleteSeasonModelMasterRequest())
->withNamespaceName("namespace-0001")
->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("namespace-0001")
.withSeasonName("mode1")
);
SeasonModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2SeasonRatingRestClient(session);
AsyncResult<Gs2.Gs2SeasonRating.Result.DeleteSeasonModelMasterResult> asyncResult = null;
yield return client.DeleteSeasonModelMaster(
new Gs2.Gs2SeasonRating.Request.DeleteSeasonModelMasterRequest()
.WithNamespaceName("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.with_season_name('mode1')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('season_rating')
api_result = client.delete_season_model_master({
namespaceName="namespace-0001",
seasonName="mode1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('season_rating')
api_result_handler = client.delete_season_model_master_async({
namespaceName="namespace-0001",
seasonName="mode1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;