GS2-SeasonRating SDK API リファレンス 各種プログラミング言語向け GS2-SDK の モデルの仕様 と API のリファレンス
モデル Namespace ネームスペース
ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。 GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
型 有効化条件 必須 デフォルト 値の制限 説明 namespaceId string ✓ ~ 1024文字 ネームスペースGRN name string ✓ ~ 128文字 ネームスペース名 description string ~ 1024文字 説明文 transactionSetting TransactionSetting ✓ トランザクション設定 logSetting LogSetting ログの出力設定 createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒) updatedAt long ✓ 現在時刻 最終更新日時 (UNIX時間 単位:ミリ秒) revision long 0 ~ 9223372036854775805 リビジョン
MatchSession セッション
型 有効化条件 必須 デフォルト 値の制限 説明 sessionId string ✓ ~ 1024文字 セッションGRN name string ✓ UUID ~ 128文字 セッション名 createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒) revision long 0 ~ 9223372036854775805 リビジョン
SeasonModelMaster シーズンモデルマスター
GS2 ではレーティングアルゴリズムとして Glicko-2 を採用しています。 Glicko-2 には複数のパラメータがありますが、GS2-Matchmaking ではそれらを総合的に表す ボラティリティ という1つのパラメータに集約しています。 ボラティリティ は変化の大きさを表すパラメータで、値が大きいほどレーティングの値の変動量が大きくなります。
型 有効化条件 必須 デフォルト 値の制限 説明 seasonModelId string ✓ ~ 1024文字 シーズンモデルマスターGRN name string ✓ ~ 128文字 シーズンモデル名 metadata string ~ 128文字 メタデータ description string ~ 1024文字 説明文 tiers List<TierModel> ✓ 1 ~ 100 items ティアーリスト experienceModelId string ✓ ~ 1024文字 経験値モデルGRN challengePeriodEventId string ~ 1024文字 シーズンの期間を設定した GS2-Schedule イベントGRN createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒) updatedAt long ✓ 現在時刻 最終更新日時 (UNIX時間 単位:ミリ秒) revision long 0 ~ 9223372036854775805 リビジョン
SeasonModel シーズンモデル
GS2 ではレーティングアルゴリズムとして Glicko-2 を採用しています。 Glicko-2 には複数のパラメータがありますが、GS2-Matchmaking ではそれらを総合的に表す ボラティリティ という1つのパラメータに集約しています。 ボラティリティ は変化の大きさを表すパラメータで、値が大きいほどレーティングの値の変動量が大きくなります。
型 有効化条件 必須 デフォルト 値の制限 説明 seasonModelId string ✓ ~ 1024文字 シーズンモデルGRN name string ✓ ~ 128文字 シーズンモデル名 metadata string ~ 128文字 メタデータ tiers List<TierModel> ✓ 1 ~ 100 items ティアーリスト experienceModelId string ✓ ~ 1024文字 経験値モデルGRN challengePeriodEventId string ~ 1024文字 シーズンの期間を設定した GS2-Schedule イベントGRN
TierModel ティアーモデル
型 有効化条件 必須 デフォルト 値の制限 説明 metadata string ~ 128文字 メタデータ raiseRankBonus int ✓ ~ 10000 ランク昇格時にすぐにランク降格を防ぐために加算するボーナスポイント entryFee int ✓ ~ 10000 ゲームを開始するための参加料として減算するポイント minimumChangePoint int ✓ ~ -1 負けた際に変動するレート値の最小値 maximumChangePoint int ✓ 1 ~ 99999999 勝った際に変動するレート値の最大値
CurrentSeasonModelMaster 現在有効なマスターデータ
GS2ではマスターデータの管理にJSON形式のファイルを使用します。 ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
型 有効化条件 必須 デフォルト 値の制限 説明 namespaceId string ✓ ~ 1024文字 現在有効なレーティングマスターGRN settings string ✓ ~ 5242880文字 マスターデータ
VerifyActionResult 検証アクションの実行結果
型 有効化条件 必須 デフォルト 値の制限 説明 action enum { } ✓ ~ 128文字 検証アクションで実行するアクションの種類 verifyRequest string ✓ ~ 1048576文字 リクエストのJSON statusCode int ~ 999 ステータスコード verifyResult string ~ 1048576文字 結果内容
action に指定する列挙型の定義 ConsumeActionResult 消費アクションの実行結果
型 有効化条件 必須 デフォルト 値の制限 説明 action enum { } ✓ ~ 128文字 消費アクションで実行するアクションの種類 consumeRequest string ✓ ~ 1048576文字 リクエストのJSON statusCode int ~ 999 ステータスコード consumeResult string ~ 1048576文字 結果内容
action に指定する列挙型の定義 AcquireActionResult 入手アクションの実行結果
型 有効化条件 必須 デフォルト 値の制限 説明 action enum { } ✓ ~ 128文字 入手アクションで実行するアクションの種類 acquireRequest string ✓ ~ 1048576文字 リクエストのJSON statusCode int ~ 999 ステータスコード acquireResult string ~ 1048576文字 結果内容
action に指定する列挙型の定義 TransactionResult トランザクション実行結果
サーバーサイドでのトランザクションの自動実行機能を利用して実行されたトランザクションの実行結果
TransactionSetting トランザクション設定
型 有効化条件 必須 デフォルト 値の制限 説明 enableAtomicCommit bool ✓ false トランザクションの実行をアトミックにコミットするか transactionUseDistributor bool {enableAtomicCommit} == true ✓ false トランザクションを非同期処理で実行する acquireActionUseJobQueue bool {enableAtomicCommit} == true ✓ false 入手アクションを実行する際に GS2-JobQueue を使用するか distributorNamespaceId string ✓ “grn:gs2:{region}:{ownerId}:distributor:default” ~ 1024文字 トランザクションの実行に使用する GS2-Distributor ネームスペース queueNamespaceId string ✓ “grn:gs2:{region}:{ownerId}:queue:default” ~ 1024文字 トランザクションの実行に使用する GS2-JobQueue のネームスペース
ScriptSetting スクリプト設定
GS2 ではマイクロサービスのイベントに関連づけて、カスタムスクリプトを実行することができます。 このモデルは、スクリプトの実行をトリガーするための設定を保持します。
スクリプトの実行方式は大きく2種類あり、それは「同期実行」と「非同期実行」です。 同期実行は、スクリプトの実行が完了するまで処理がブロックされます。 かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることができます。
一方、非同期実行は、スクリプトの実行が完了するまで処理がブロックされません。 かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることはできません。 しかし、非同期実行は、スクリプトの実行が完了するまで処理がブロックされないため、APIの応答に影響を与えないため、原則非同期実行を使用することをおすすめします。
非同期実行には実行方式が2種類あり、GS2-Script と Amazon EventBridge があります。 Amazon EventBridge を使用することで、Lua 以外の言語で処理を記述することができます。
型 有効化条件 必須 デフォルト 値の制限 説明 triggerScriptId string ~ 1024文字 スクリプトGRN doneTriggerTargetType enum { “none”, “gs2_script”, “aws” } ✓ “none” ~ 128文字 完了通知の通知先 doneTriggerScriptId string {doneTriggerTargetType} == “gs2_script” ~ 1024文字 スクリプトGRN doneTriggerQueueNamespaceId string {doneTriggerTargetType} == “gs2_script” ~ 1024文字 ネームスペースGRN
doneTriggerTargetType に指定する列挙型の定義 定義 説明 none なし gs2_script GS2-Script aws Amazon EventBridge
LogSetting ログの書き出し設定
ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用されるログ名前空間の識別子(Namespace ID)を保持します。 ログ名前空間IDは、ログデータを集約し、保存する対象の GS2-Log の名前空間を指定します。 この設定を通じて、この名前空間以下のAPIリクエスト・レスポンスログデータが対象の GS2-Log へ出力されるようになります。 GS2-Log にはリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。
型 有効化条件 必須 デフォルト 値の制限 説明 loggingNamespaceId string ✓ ~ 1024文字 ネームスペースGRN
GitHubCheckoutSetting GitHubからマスターデータをチェックアウトする設定
型 有効化条件 必須 デフォルト 値の制限 説明 apiKeyId string ✓ ~ 1024文字 GitHub のAPIキーGRN repositoryName string ✓ ~ 1024文字 リポジトリ名 sourcePath string ✓ ~ 1024文字 ソースコードのファイルパス referenceType enum { “commit_hash”, “branch”, “tag” } ✓ ~ 128文字 コードの取得元 commitHash string {referenceType} == “commit_hash” ✓ ~ 1024文字 コミットハッシュ branchName string {referenceType} == “branch” ✓ ~ 1024文字 ブランチ名 tagName string {referenceType} == “tag” ✓ ~ 1024文字 タグ名
referenceType に指定する列挙型の定義 定義 説明 commit_hash コミットハッシュ branch ブランチ tag タグ
GameResult 対戦結果
型 有効化条件 必須 デフォルト 値の制限 説明 rank int ✓ ~ 2147483646 順位 userId string ✓ ~ 128文字 ユーザーID
Ballot 投票用紙
型 有効化条件 必須 デフォルト 値の制限 説明 userId string ✓ ~ 128文字 ユーザーID seasonName string ✓ ~ 128文字 レーティング計算に使用するシーズン名 sessionName string ✓ ~ 128文字 投票対象のセッション名 numberOfPlayer int ✓ 2 ~ 10 参加人数
SignedBallot 署名付の投票用紙
型 有効化条件 必須 デフォルト 値の制限 説明 body string ✓ ~ 1024文字 投票用紙の署名対象のデータ signature string ✓ ~ 256文字 投票用紙の署名
WrittenBallot 投票用紙
Vote 投票状況
型 有効化条件 必須 デフォルト 値の制限 説明 voteId string ✓ ~ 1024文字 投票状況GRN seasonName string ✓ ~ 128文字 シーズン名 sessionName string ✓ ~ 128文字 投票対象のセッション名 writtenBallots List<WrittenBallot> [] ~ 10 items 投票用紙のリスト createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒) updatedAt long ✓ 現在時刻 最終更新日時 (UNIX時間 単位:ミリ秒) revision long 0 ~ 9223372036854775805 リビジョン
メソッド describeNamespaces ネームスペースの一覧を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン limit int ✓ 30 1 ~ 1000 データの取得件数
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . DescribeNamespaces (
& season_rating . DescribeNamespacesRequest {
PageToken : nil ,
Limit : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
nextPageToken := result . NextPageToken
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\DescribeNamespacesRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeNamespaces (
( new DescribeNamespacesRequest ())
-> withPageToken ( null )
-> withLimit ( null )
);
$items = $result -> getItems ();
$nextPageToken = $result -> getNextPageToken ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient ;
import io.gs2.seasonRating.request.DescribeNamespacesRequest ;
import io.gs2.seasonRating.result.DescribeNamespacesResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2SeasonRatingRestClient client = new Gs2SeasonRatingRestClient ( session );
try {
DescribeNamespacesResult result = client . describeNamespaces (
new DescribeNamespacesRequest ()
. withPageToken ( null )
. withLimit ( null )
);
List < Namespace > items = result . getItems ();
String nextPageToken = result . getNextPageToken ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.DescribeNamespacesRequest ;
using Gs2.Gs2SeasonRating.Result.DescribeNamespacesResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . DescribeNamespacesResult > asyncResult = null ;
yield return client . DescribeNamespaces (
new Gs2 . Gs2SeasonRating . Request . DescribeNamespacesRequest ()
. WithPageToken ( null )
. WithLimit ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var items = result . Items ;
var nextPageToken = result . NextPageToken ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2SeasonRating from '@/gs2/seasonRating' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2SeasonRating . Gs2SeasonRatingRestClient ( session );
try {
const result = await client . describeNamespaces (
new Gs2SeasonRating . DescribeNamespacesRequest ()
. withPageToken ( null )
. withLimit ( null )
);
const items = result . getItems ();
const nextPageToken = result . getNextPageToken ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import season_rating
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = season_rating . Gs2SeasonRatingRestClient ( session )
try :
result = client . describe_namespaces (
season_rating . DescribeNamespacesRequest ()
. with_page_token ( None )
. with_limit ( None )
)
items = result . items
next_page_token = result . next_page_token
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'seasonRating' )
api_result = client.describe_namespaces ({
pageToken = nil ,
limit = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
client = gs2 ( 'seasonRating' )
api_result_handler = client.describe_namespaces_async ({
pageToken = nil ,
limit = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
createNamespace ネームスペースを新規作成
Request 型 有効化条件 必須 デフォルト 値の制限 説明 name string ✓ ~ 128文字 ネームスペース名 description string ~ 1024文字 説明文 transactionSetting TransactionSetting ✓ トランザクション設定 logSetting LogSetting ログの出力設定
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . CreateNamespace (
& season_rating . CreateNamespaceRequest {
Name : pointy . String ( "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 . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\CreateNamespaceRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> createNamespace (
( new CreateNamespaceRequest ())
-> withName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.CreateNamespaceRequest ;
using Gs2.Gs2SeasonRating.Result.CreateNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . CreateNamespaceResult > asyncResult = null ;
yield return client . CreateNamespace (
new Gs2 . Gs2SeasonRating . Request . CreateNamespaceRequest ()
. WithName ( "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 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
getNamespaceStatus ネームスペースの状態を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . GetNamespaceStatus (
& season_rating . GetNamespaceStatusRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
status := result . Status
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\GetNamespaceStatusRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getNamespaceStatus (
( new GetNamespaceStatusRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.GetNamespaceStatusRequest ;
using Gs2.Gs2SeasonRating.Result.GetNamespaceStatusResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . GetNamespaceStatusResult > asyncResult = null ;
yield return client . GetNamespaceStatus (
new Gs2 . Gs2SeasonRating . Request . GetNamespaceStatusRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
api_result = client.get_namespace_status ({
namespaceName = "namespace-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
status = result.status ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
status = result.status ;
getNamespace ネームスペースを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . GetNamespace (
& season_rating . GetNamespaceRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\GetNamespaceRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getNamespace (
( new GetNamespaceRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.GetNamespaceRequest ;
using Gs2.Gs2SeasonRating.Result.GetNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . GetNamespaceResult > asyncResult = null ;
yield return client . GetNamespace (
new Gs2 . Gs2SeasonRating . Request . GetNamespaceRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
api_result = client.get_namespace ({
namespaceName = "namespace-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
updateNamespace ネームスペースを更新
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 description string ~ 1024文字 説明文 transactionSetting TransactionSetting ✓ トランザクション設定 logSetting LogSetting ログの出力設定
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . UpdateNamespace (
& season_rating . UpdateNamespaceRequest {
NamespaceName : pointy . String ( "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 . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\UpdateNamespaceRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateNamespace (
( new UpdateNamespaceRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.UpdateNamespaceRequest ;
using Gs2.Gs2SeasonRating.Result.UpdateNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . UpdateNamespaceResult > asyncResult = null ;
yield return client . UpdateNamespace (
new Gs2 . Gs2SeasonRating . Request . UpdateNamespaceRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
deleteNamespace ネームスペースを削除
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . DeleteNamespace (
& season_rating . DeleteNamespaceRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\DeleteNamespaceRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> deleteNamespace (
( new DeleteNamespaceRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.DeleteNamespaceRequest ;
using Gs2.Gs2SeasonRating.Result.DeleteNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . DeleteNamespaceResult > asyncResult = null ;
yield return client . DeleteNamespace (
new Gs2 . Gs2SeasonRating . Request . DeleteNamespaceRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
api_result = client.delete_namespace ({
namespaceName = "namespace-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
dumpUserDataByUserId 指定したユーザーIDに紐づくデータのダンプを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 userId string ✓ ~ 128文字 ユーザーID timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . DumpUserDataByUserId (
& season_rating . DumpUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\DumpUserDataByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> dumpUserDataByUserId (
( new DumpUserDataByUserIdRequest ())
-> withUserId ( "user-0001" )
-> withTimeOffsetToken ( null )
);
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient ;
import io.gs2.seasonRating.request.DumpUserDataByUserIdRequest ;
import io.gs2.seasonRating.result.DumpUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2SeasonRatingRestClient client = new Gs2SeasonRatingRestClient ( session );
try {
DumpUserDataByUserIdResult result = client . dumpUserDataByUserId (
new DumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.DumpUserDataByUserIdRequest ;
using Gs2.Gs2SeasonRating.Result.DumpUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . DumpUserDataByUserIdResult > asyncResult = null ;
yield return client . DumpUserDataByUserId (
new Gs2 . Gs2SeasonRating . Request . DumpUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2SeasonRating from '@/gs2/seasonRating' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2SeasonRating . Gs2SeasonRatingRestClient ( session );
try {
const result = await client . dumpUserDataByUserId (
new Gs2SeasonRating . DumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import season_rating
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = season_rating . Gs2SeasonRatingRestClient ( session )
try :
result = client . dump_user_data_by_user_id (
season_rating . DumpUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'seasonRating' )
api_result = client.dump_user_data_by_user_id ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
client = gs2 ( 'seasonRating' )
api_result_handler = client.dump_user_data_by_user_id_async ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
checkDumpUserDataByUserId 指定したユーザーIDに紐づくデータのダンプが完了しているか確認
Request 型 有効化条件 必須 デフォルト 値の制限 説明 userId string ✓ ~ 128文字 ユーザーID timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . CheckDumpUserDataByUserId (
& season_rating . CheckDumpUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
url := result . Url
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\CheckDumpUserDataByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> checkDumpUserDataByUserId (
( new CheckDumpUserDataByUserIdRequest ())
-> withUserId ( "user-0001" )
-> withTimeOffsetToken ( null )
);
$url = $result -> getUrl ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient ;
import io.gs2.seasonRating.request.CheckDumpUserDataByUserIdRequest ;
import io.gs2.seasonRating.result.CheckDumpUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2SeasonRatingRestClient client = new Gs2SeasonRatingRestClient ( session );
try {
CheckDumpUserDataByUserIdResult result = client . checkDumpUserDataByUserId (
new CheckDumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
String url = result . getUrl ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.CheckDumpUserDataByUserIdRequest ;
using Gs2.Gs2SeasonRating.Result.CheckDumpUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . CheckDumpUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckDumpUserDataByUserId (
new Gs2 . Gs2SeasonRating . Request . CheckDumpUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var url = result . Url ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2SeasonRating from '@/gs2/seasonRating' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2SeasonRating . Gs2SeasonRatingRestClient ( session );
try {
const result = await client . checkDumpUserDataByUserId (
new Gs2SeasonRating . CheckDumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
const url = result . getUrl ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import season_rating
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = season_rating . Gs2SeasonRatingRestClient ( session )
try :
result = client . check_dump_user_data_by_user_id (
season_rating . CheckDumpUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
url = result . url
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'seasonRating' )
api_result = client.check_dump_user_data_by_user_id ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
url = result.url ;
client = gs2 ( 'seasonRating' )
api_result_handler = client.check_dump_user_data_by_user_id_async ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
url = result.url ;
cleanUserDataByUserId 指定したユーザーIDに紐づくデータのダンプを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 userId string ✓ ~ 128文字 ユーザーID timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . CleanUserDataByUserId (
& season_rating . CleanUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\CleanUserDataByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> cleanUserDataByUserId (
( new CleanUserDataByUserIdRequest ())
-> withUserId ( "user-0001" )
-> withTimeOffsetToken ( null )
);
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient ;
import io.gs2.seasonRating.request.CleanUserDataByUserIdRequest ;
import io.gs2.seasonRating.result.CleanUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2SeasonRatingRestClient client = new Gs2SeasonRatingRestClient ( session );
try {
CleanUserDataByUserIdResult result = client . cleanUserDataByUserId (
new CleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.CleanUserDataByUserIdRequest ;
using Gs2.Gs2SeasonRating.Result.CleanUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . CleanUserDataByUserIdResult > asyncResult = null ;
yield return client . CleanUserDataByUserId (
new Gs2 . Gs2SeasonRating . Request . CleanUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2SeasonRating from '@/gs2/seasonRating' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2SeasonRating . Gs2SeasonRatingRestClient ( session );
try {
const result = await client . cleanUserDataByUserId (
new Gs2SeasonRating . CleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import season_rating
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = season_rating . Gs2SeasonRatingRestClient ( session )
try :
result = client . clean_user_data_by_user_id (
season_rating . CleanUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'seasonRating' )
api_result = client.clean_user_data_by_user_id ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
client = gs2 ( 'seasonRating' )
api_result_handler = client.clean_user_data_by_user_id_async ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
checkCleanUserDataByUserId 指定したユーザーIDに紐づくデータのダンプが完了しているか確認
Request 型 有効化条件 必須 デフォルト 値の制限 説明 userId string ✓ ~ 128文字 ユーザーID timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . CheckCleanUserDataByUserId (
& season_rating . CheckCleanUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\CheckCleanUserDataByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> checkCleanUserDataByUserId (
( new CheckCleanUserDataByUserIdRequest ())
-> withUserId ( "user-0001" )
-> withTimeOffsetToken ( null )
);
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient ;
import io.gs2.seasonRating.request.CheckCleanUserDataByUserIdRequest ;
import io.gs2.seasonRating.result.CheckCleanUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2SeasonRatingRestClient client = new Gs2SeasonRatingRestClient ( session );
try {
CheckCleanUserDataByUserIdResult result = client . checkCleanUserDataByUserId (
new CheckCleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.CheckCleanUserDataByUserIdRequest ;
using Gs2.Gs2SeasonRating.Result.CheckCleanUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . CheckCleanUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckCleanUserDataByUserId (
new Gs2 . Gs2SeasonRating . Request . CheckCleanUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2SeasonRating from '@/gs2/seasonRating' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2SeasonRating . Gs2SeasonRatingRestClient ( session );
try {
const result = await client . checkCleanUserDataByUserId (
new Gs2SeasonRating . CheckCleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import season_rating
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = season_rating . Gs2SeasonRatingRestClient ( session )
try :
result = client . check_clean_user_data_by_user_id (
season_rating . CheckCleanUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'seasonRating' )
api_result = client.check_clean_user_data_by_user_id ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
client = gs2 ( 'seasonRating' )
api_result_handler = client.check_clean_user_data_by_user_id_async ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
prepareImportUserDataByUserId 指定したユーザーIDに紐づくデータのインポートを開始
Request 型 有効化条件 必須 デフォルト 値の制限 説明 userId string ✓ ~ 128文字 ユーザーID timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 型 説明 uploadToken string アップロード後に結果を反映する際に使用するトークン uploadUrl string ユーザーデータアップロード処理の実行に使用するURL
実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . PrepareImportUserDataByUserId (
& season_rating . PrepareImportUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
uploadToken := result . UploadToken
uploadUrl := result . UploadUrl
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\PrepareImportUserDataByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> prepareImportUserDataByUserId (
( new PrepareImportUserDataByUserIdRequest ())
-> withUserId ( "user-0001" )
-> withTimeOffsetToken ( null )
);
$uploadToken = $result -> getUploadToken ();
$uploadUrl = $result -> getUploadUrl ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient ;
import io.gs2.seasonRating.request.PrepareImportUserDataByUserIdRequest ;
import io.gs2.seasonRating.result.PrepareImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2SeasonRatingRestClient client = new Gs2SeasonRatingRestClient ( session );
try {
PrepareImportUserDataByUserIdResult result = client . prepareImportUserDataByUserId (
new PrepareImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
String uploadToken = result . getUploadToken ();
String uploadUrl = result . getUploadUrl ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.PrepareImportUserDataByUserIdRequest ;
using Gs2.Gs2SeasonRating.Result.PrepareImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . PrepareImportUserDataByUserIdResult > asyncResult = null ;
yield return client . PrepareImportUserDataByUserId (
new Gs2 . Gs2SeasonRating . Request . PrepareImportUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var uploadToken = result . UploadToken ;
var uploadUrl = result . UploadUrl ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2SeasonRating from '@/gs2/seasonRating' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2SeasonRating . Gs2SeasonRatingRestClient ( session );
try {
const result = await client . prepareImportUserDataByUserId (
new Gs2SeasonRating . PrepareImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
const uploadToken = result . getUploadToken ();
const uploadUrl = result . getUploadUrl ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import season_rating
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = season_rating . Gs2SeasonRatingRestClient ( session )
try :
result = client . prepare_import_user_data_by_user_id (
season_rating . PrepareImportUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
upload_token = result . upload_token
upload_url = result . upload_url
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'seasonRating' )
api_result = client.prepare_import_user_data_by_user_id ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
uploadToken = result.uploadToken ;
uploadUrl = result.uploadUrl ;
client = gs2 ( 'seasonRating' )
api_result_handler = client.prepare_import_user_data_by_user_id_async ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
uploadToken = result.uploadToken ;
uploadUrl = result.uploadUrl ;
importUserDataByUserId 指定したユーザーIDに紐づくデータのインポートを開始
Request 型 有効化条件 必須 デフォルト 値の制限 説明 userId string ✓ ~ 128文字 ユーザーID uploadToken string ✓ ~ 1024文字 アップロード準備で受け取ったトークン timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . ImportUserDataByUserId (
& season_rating . ImportUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
UploadToken : pointy . String ( "upload-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\ImportUserDataByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> importUserDataByUserId (
( new ImportUserDataByUserIdRequest ())
-> withUserId ( "user-0001" )
-> withUploadToken ( "upload-0001" )
-> withTimeOffsetToken ( null )
);
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient ;
import io.gs2.seasonRating.request.ImportUserDataByUserIdRequest ;
import io.gs2.seasonRating.result.ImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2SeasonRatingRestClient client = new Gs2SeasonRatingRestClient ( session );
try {
ImportUserDataByUserIdResult result = client . importUserDataByUserId (
new ImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withUploadToken ( "upload-0001" )
. withTimeOffsetToken ( null )
);
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.ImportUserDataByUserIdRequest ;
using Gs2.Gs2SeasonRating.Result.ImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . ImportUserDataByUserIdResult > asyncResult = null ;
yield return client . ImportUserDataByUserId (
new Gs2 . Gs2SeasonRating . Request . ImportUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithUploadToken ( "upload-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2SeasonRating from '@/gs2/seasonRating' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2SeasonRating . Gs2SeasonRatingRestClient ( session );
try {
const result = await client . importUserDataByUserId (
new Gs2SeasonRating . ImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withUploadToken ( "upload-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import season_rating
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = season_rating . Gs2SeasonRatingRestClient ( session )
try :
result = client . import_user_data_by_user_id (
season_rating . ImportUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_upload_token ( 'upload-0001' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'seasonRating' )
api_result = client.import_user_data_by_user_id ({
userId = "user-0001" ,
uploadToken = "upload-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
client = gs2 ( 'seasonRating' )
api_result_handler = client.import_user_data_by_user_id_async ({
userId = "user-0001" ,
uploadToken = "upload-0001" ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
checkImportUserDataByUserId 指定したユーザーIDに紐づくデータのインポートが完了しているか確認
Request 型 有効化条件 必須 デフォルト 値の制限 説明 userId string ✓ ~ 128文字 ユーザーID uploadToken string ✓ ~ 1024文字 アップロード準備で受け取ったトークン timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . CheckImportUserDataByUserId (
& season_rating . CheckImportUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
UploadToken : pointy . String ( "upload-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
url := result . Url
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\CheckImportUserDataByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> checkImportUserDataByUserId (
( new CheckImportUserDataByUserIdRequest ())
-> withUserId ( "user-0001" )
-> withUploadToken ( "upload-0001" )
-> withTimeOffsetToken ( null )
);
$url = $result -> getUrl ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient ;
import io.gs2.seasonRating.request.CheckImportUserDataByUserIdRequest ;
import io.gs2.seasonRating.result.CheckImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2SeasonRatingRestClient client = new Gs2SeasonRatingRestClient ( session );
try {
CheckImportUserDataByUserIdResult result = client . checkImportUserDataByUserId (
new CheckImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withUploadToken ( "upload-0001" )
. withTimeOffsetToken ( null )
);
String url = result . getUrl ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.CheckImportUserDataByUserIdRequest ;
using Gs2.Gs2SeasonRating.Result.CheckImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . CheckImportUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckImportUserDataByUserId (
new Gs2 . Gs2SeasonRating . Request . CheckImportUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithUploadToken ( "upload-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var url = result . Url ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2SeasonRating from '@/gs2/seasonRating' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2SeasonRating . Gs2SeasonRatingRestClient ( session );
try {
const result = await client . checkImportUserDataByUserId (
new Gs2SeasonRating . CheckImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withUploadToken ( "upload-0001" )
. withTimeOffsetToken ( null )
);
const url = result . getUrl ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import season_rating
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = season_rating . Gs2SeasonRatingRestClient ( session )
try :
result = client . check_import_user_data_by_user_id (
season_rating . CheckImportUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_upload_token ( 'upload-0001' )
. with_time_offset_token ( None )
)
url = result . url
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'seasonRating' )
api_result = client.check_import_user_data_by_user_id ({
userId = "user-0001" ,
uploadToken = "upload-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
url = result.url ;
client = gs2 ( 'seasonRating' )
api_result_handler = client.check_import_user_data_by_user_id_async ({
userId = "user-0001" ,
uploadToken = "upload-0001" ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
url = result.url ;
describeMatchSessions セッションの一覧を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン limit int ✓ 30 1 ~ 1000 データの取得件数
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . DescribeMatchSessions (
& season_rating . DescribeMatchSessionsRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
PageToken : nil ,
Limit : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
nextPageToken := result . NextPageToken
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\DescribeMatchSessionsRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeMatchSessions (
( new DescribeMatchSessionsRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.DescribeMatchSessionsRequest ;
using Gs2.Gs2SeasonRating.Result.DescribeMatchSessionsResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . DescribeMatchSessionsResult > asyncResult = null ;
yield return client . DescribeMatchSessions (
new Gs2 . Gs2SeasonRating . Request . DescribeMatchSessionsRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
createMatchSession セッションを作成
セッションを作成すると、セッションIDが発行されます。 対戦結果のレポート送信にはセッションIDが必要で、セッションIDを指定してレポートを送信することで、そのセッションに対するレポートを送信することができます。
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 sessionName string UUID ~ 128文字 セッション名 ttlSeconds int ✓ 60 60 ~ 7200 セッションの有効期限(秒)
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . CreateMatchSession (
& season_rating . CreateMatchSessionRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
SessionName : pointy . String ( "matchSession-0001" ),
TtlSeconds : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\CreateMatchSessionRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> createMatchSession (
( new CreateMatchSessionRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.CreateMatchSessionRequest ;
using Gs2.Gs2SeasonRating.Result.CreateMatchSessionResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . CreateMatchSessionResult > asyncResult = null ;
yield return client . CreateMatchSession (
new Gs2 . Gs2SeasonRating . Request . CreateMatchSessionRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
getMatchSession セッションを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 sessionName string ✓ UUID ~ 128文字 セッション名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . GetMatchSession (
& season_rating . GetMatchSessionRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
SessionName : pointy . String ( "matchSession-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\GetMatchSessionRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getMatchSession (
( new GetMatchSessionRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.GetMatchSessionRequest ;
using Gs2.Gs2SeasonRating.Result.GetMatchSessionResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . GetMatchSessionResult > asyncResult = null ;
yield return client . GetMatchSession (
new Gs2 . Gs2SeasonRating . Request . GetMatchSessionRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
deleteMatchSession セッションを削除
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 sessionName string ✓ UUID ~ 128文字 セッション名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . DeleteMatchSession (
& season_rating . DeleteMatchSessionRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
SessionName : pointy . String ( "matchSession-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\DeleteMatchSessionRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> deleteMatchSession (
( new DeleteMatchSessionRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.DeleteMatchSessionRequest ;
using Gs2.Gs2SeasonRating.Result.DeleteMatchSessionResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . DeleteMatchSessionResult > asyncResult = null ;
yield return client . DeleteMatchSession (
new Gs2 . Gs2SeasonRating . Request . DeleteMatchSessionRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
describeSeasonModelMasters シーズンモデルマスターの一覧を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン limit int ✓ 30 1 ~ 1000 データの取得件数
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . DescribeSeasonModelMasters (
& season_rating . DescribeSeasonModelMastersRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
PageToken : nil ,
Limit : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
nextPageToken := result . NextPageToken
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\DescribeSeasonModelMastersRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeSeasonModelMasters (
( new DescribeSeasonModelMastersRequest ())
-> withNamespaceName ( "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.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" )
. withPageToken ( null )
. withLimit ( null )
);
List < SeasonModelMaster > items = result . getItems ();
String nextPageToken = result . getNextPageToken ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.DescribeSeasonModelMastersRequest ;
using Gs2.Gs2SeasonRating.Result.DescribeSeasonModelMastersResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . DescribeSeasonModelMastersResult > asyncResult = null ;
yield return client . DescribeSeasonModelMasters (
new Gs2 . Gs2SeasonRating . Request . DescribeSeasonModelMastersRequest ()
. WithNamespaceName ( "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 . describeSeasonModelMasters (
new Gs2SeasonRating . DescribeSeasonModelMastersRequest ()
. 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_season_model_masters (
season_rating . DescribeSeasonModelMastersRequest ()
. 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 ( 'seasonRating' )
api_result = client.describe_season_model_masters ({
namespaceName = "namespace-0001" ,
pageToken = nil ,
limit = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
client = gs2 ( 'seasonRating' )
api_result_handler = client.describe_season_model_masters_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 [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
createSeasonModelMaster シーズンモデルマスターを新規作成
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 name string ✓ ~ 128文字 シーズンモデル名 description string ~ 1024文字 説明文 metadata string ~ 128文字 メタデータ tiers List<TierModel> ✓ 1 ~ 100 items ティアーリスト experienceModelId string ✓ ~ 1024文字 経験値モデルGRN challengePeriodEventId string ~ 1024文字 シーズンの期間を設定した GS2-Schedule イベントGRN
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . CreateSeasonModelMaster (
& season_rating . CreateSeasonModelMasterRequest {
NamespaceName : pointy . String ( "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:experience:level" ),
ChallengePeriodEventId : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\CreateSeasonModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> createSeasonModelMaster (
( new CreateSeasonModelMasterRequest ())
-> withNamespaceName ( "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:experience:level" )
-> withChallengePeriodEventId ( null )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient ;
import io.gs2.seasonRating.request.CreateSeasonModelMasterRequest ;
import io.gs2.seasonRating.result.CreateSeasonModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2SeasonRatingRestClient client = new Gs2SeasonRatingRestClient ( session );
try {
CreateSeasonModelMasterResult result = client . createSeasonModelMaster (
new CreateSeasonModelMasterRequest ()
. withNamespaceName ( "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:experience:level" )
. withChallengePeriodEventId ( null )
);
SeasonModelMaster item = result . getItem ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.CreateSeasonModelMasterRequest ;
using Gs2.Gs2SeasonRating.Result.CreateSeasonModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . CreateSeasonModelMasterResult > asyncResult = null ;
yield return client . CreateSeasonModelMaster (
new Gs2 . Gs2SeasonRating . Request . CreateSeasonModelMasterRequest ()
. WithNamespaceName ( "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:experience:level" )
. WithChallengePeriodEventId ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2SeasonRating from '@/gs2/seasonRating' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2SeasonRating . Gs2SeasonRatingRestClient ( session );
try {
const result = await client . createSeasonModelMaster (
new Gs2SeasonRating . CreateSeasonModelMasterRequest ()
. withNamespaceName ( "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:experience:level" )
. withChallengePeriodEventId ( null )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import season_rating
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = season_rating . Gs2SeasonRatingRestClient ( session )
try :
result = client . create_season_model_master (
season_rating . CreateSeasonModelMasterRequest ()
. with_namespace_name ( '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:experience:level' )
. with_challenge_period_event_id ( None )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'seasonRating' )
api_result = client.create_season_model_master ({
namespaceName = "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:experience:level" ,
challengePeriodEventId = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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:experience: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 [ 'message' ])
end
result = api_result.result
item = result.item ;
getSeasonModelMaster シーズンモデルマスターを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 seasonName string ✓ ~ 128文字 シーズンモデル名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . GetSeasonModelMaster (
& season_rating . GetSeasonModelMasterRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
SeasonName : pointy . String ( "mode1" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\GetSeasonModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getSeasonModelMaster (
( new GetSeasonModelMasterRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.GetSeasonModelMasterRequest ;
using Gs2.Gs2SeasonRating.Result.GetSeasonModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . GetSeasonModelMasterResult > asyncResult = null ;
yield return client . GetSeasonModelMaster (
new Gs2 . Gs2SeasonRating . Request . GetSeasonModelMasterRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
updateSeasonModelMaster シーズンモデルマスターを更新
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 seasonName string ✓ ~ 128文字 シーズンモデル名 description string ~ 1024文字 説明文 metadata string ~ 128文字 メタデータ tiers List<TierModel> ✓ 1 ~ 100 items ティアーリスト experienceModelId string ✓ ~ 1024文字 経験値モデルGRN challengePeriodEventId string ~ 1024文字 シーズンの期間を設定した GS2-Schedule イベントGRN
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . UpdateSeasonModelMaster (
& season_rating . UpdateSeasonModelMasterRequest {
NamespaceName : pointy . String ( "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:experience:level2" ),
ChallengePeriodEventId : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\UpdateSeasonModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateSeasonModelMaster (
( new UpdateSeasonModelMasterRequest ())
-> withNamespaceName ( "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:experience:level2" )
-> withChallengePeriodEventId ( null )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.seasonRating.rest.Gs2SeasonRatingRestClient ;
import io.gs2.seasonRating.request.UpdateSeasonModelMasterRequest ;
import io.gs2.seasonRating.result.UpdateSeasonModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2SeasonRatingRestClient client = new Gs2SeasonRatingRestClient ( session );
try {
UpdateSeasonModelMasterResult result = client . updateSeasonModelMaster (
new UpdateSeasonModelMasterRequest ()
. withNamespaceName ( "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:experience:level2" )
. withChallengePeriodEventId ( null )
);
SeasonModelMaster item = result . getItem ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.UpdateSeasonModelMasterRequest ;
using Gs2.Gs2SeasonRating.Result.UpdateSeasonModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . UpdateSeasonModelMasterResult > asyncResult = null ;
yield return client . UpdateSeasonModelMaster (
new Gs2 . Gs2SeasonRating . Request . UpdateSeasonModelMasterRequest ()
. WithNamespaceName ( "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:experience:level2" )
. WithChallengePeriodEventId ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2SeasonRating from '@/gs2/seasonRating' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2SeasonRating . Gs2SeasonRatingRestClient ( session );
try {
const result = await client . updateSeasonModelMaster (
new Gs2SeasonRating . UpdateSeasonModelMasterRequest ()
. withNamespaceName ( "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:experience:level2" )
. withChallengePeriodEventId ( null )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import season_rating
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = season_rating . Gs2SeasonRatingRestClient ( session )
try :
result = client . update_season_model_master (
season_rating . UpdateSeasonModelMasterRequest ()
. with_namespace_name ( '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:experience:level2' )
. with_challenge_period_event_id ( None )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'seasonRating' )
api_result = client.update_season_model_master ({
namespaceName = "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:experience:level2" ,
challengePeriodEventId = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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:experience: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 [ 'message' ])
end
result = api_result.result
item = result.item ;
deleteSeasonModelMaster シーズンモデルマスターを削除
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 seasonName string ✓ ~ 128文字 シーズンモデル名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . DeleteSeasonModelMaster (
& season_rating . DeleteSeasonModelMasterRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
SeasonName : pointy . String ( "mode1" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\DeleteSeasonModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> deleteSeasonModelMaster (
( new DeleteSeasonModelMasterRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.DeleteSeasonModelMasterRequest ;
using Gs2.Gs2SeasonRating.Result.DeleteSeasonModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . DeleteSeasonModelMasterResult > asyncResult = null ;
yield return client . DeleteSeasonModelMaster (
new Gs2 . Gs2SeasonRating . Request . DeleteSeasonModelMasterRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
describeSeasonModels シーズンモデルの一覧を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . DescribeSeasonModels (
& season_rating . DescribeSeasonModelsRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\DescribeSeasonModelsRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeSeasonModels (
( new DescribeSeasonModelsRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.DescribeSeasonModelsRequest ;
using Gs2.Gs2SeasonRating.Result.DescribeSeasonModelsResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . DescribeSeasonModelsResult > asyncResult = null ;
yield return client . DescribeSeasonModels (
new Gs2 . Gs2SeasonRating . Request . DescribeSeasonModelsRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
api_result = client.describe_season_models ({
namespaceName = "namespace-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
getSeasonModel シーズンモデルを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 seasonName string ✓ ~ 128文字 シーズンモデル名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . GetSeasonModel (
& season_rating . GetSeasonModelRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
SeasonName : pointy . String ( "mode1" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\GetSeasonModelRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getSeasonModel (
( new GetSeasonModelRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.GetSeasonModelRequest ;
using Gs2.Gs2SeasonRating.Result.GetSeasonModelResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . GetSeasonModelResult > asyncResult = null ;
yield return client . GetSeasonModel (
new Gs2 . Gs2SeasonRating . Request . GetSeasonModelRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
exportMaster 現在有効なレーティングマスターのマスターデータをエクスポート
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . ExportMaster (
& season_rating . ExportMasterRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\ExportMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> exportMaster (
( new ExportMasterRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.ExportMasterRequest ;
using Gs2.Gs2SeasonRating.Result.ExportMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . ExportMasterResult > asyncResult = null ;
yield return client . ExportMaster (
new Gs2 . Gs2SeasonRating . Request . ExportMasterRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
api_result = client.export_master ({
namespaceName = "namespace-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
getCurrentSeasonModelMaster 現在有効なレーティングマスターを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . GetCurrentSeasonModelMaster (
& season_rating . GetCurrentSeasonModelMasterRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\GetCurrentSeasonModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getCurrentSeasonModelMaster (
( new GetCurrentSeasonModelMasterRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.GetCurrentSeasonModelMasterRequest ;
using Gs2.Gs2SeasonRating.Result.GetCurrentSeasonModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . GetCurrentSeasonModelMasterResult > asyncResult = null ;
yield return client . GetCurrentSeasonModelMaster (
new Gs2 . Gs2SeasonRating . Request . GetCurrentSeasonModelMasterRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
updateCurrentSeasonModelMaster 現在有効なレーティングマスターを更新
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 settings string ✓ ~ 5242880文字 マスターデータ
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . UpdateCurrentSeasonModelMaster (
& season_rating . UpdateCurrentSeasonModelMasterRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
Settings : pointy . String ( "{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:experience:level\", \"challengePeriodEventId\": \"grn:schedule:event\"}]}" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\UpdateCurrentSeasonModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateCurrentSeasonModelMaster (
( new UpdateCurrentSeasonModelMasterRequest ())
-> withNamespaceName ( "namespace-0001" )
-> withSettings ( "{ \" version \" : \" 2024-02-23 \" , \" seasonModels \" : [{ \" name \" : \" season1 \" , \" tiers \" : [{ \" raiseRankBonus \" : 0, \" entryFee \" : 0, \" minimumChangePoint \" : -10, \" maximumChangePoint \" : 20}, { \" raiseRankBonus \" : 30, \" entryFee \" : 10, \" minimumChangePoint \" : -10, \" maximumChangePoint \" : 30}, { \" raiseRankBonus \" : 60, \" entryFee \" : 20, \" minimumChangePoint \" : -20, \" maximumChangePoint \" : 50}, { \" raiseRankBonus \" : 60, \" entryFee \" : 30, \" minimumChangePoint \" : -30, \" maximumChangePoint \" : 60}], \" experienceModelId \" : \" grn:experience:level \" , \" challengePeriodEventId \" : \" grn:schedule:event \" }]}" )
);
$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" )
. withSettings ( "{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:experience:level\", \"challengePeriodEventId\": \"grn:schedule:event\"}]}" )
);
CurrentSeasonModelMaster item = result . getItem ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.UpdateCurrentSeasonModelMasterRequest ;
using Gs2.Gs2SeasonRating.Result.UpdateCurrentSeasonModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . UpdateCurrentSeasonModelMasterResult > asyncResult = null ;
yield return client . UpdateCurrentSeasonModelMaster (
new Gs2 . Gs2SeasonRating . Request . UpdateCurrentSeasonModelMasterRequest ()
. WithNamespaceName ( "namespace-0001" )
. WithSettings ( "{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:experience:level\", \"challengePeriodEventId\": \"grn:schedule:event\"}]}" ),
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" )
. withSettings ( "{\"version\": \"2024-02-23\", \"seasonModels\": [{\"name\": \"season1\", \"tiers\": [{\"raiseRankBonus\": 0, \"entryFee\": 0, \"minimumChangePoint\": -10, \"maximumChangePoint\": 20}, {\"raiseRankBonus\": 30, \"entryFee\": 10, \"minimumChangePoint\": -10, \"maximumChangePoint\": 30}, {\"raiseRankBonus\": 60, \"entryFee\": 20, \"minimumChangePoint\": -20, \"maximumChangePoint\": 50}, {\"raiseRankBonus\": 60, \"entryFee\": 30, \"minimumChangePoint\": -30, \"maximumChangePoint\": 60}], \"experienceModelId\": \"grn:experience:level\", \"challengePeriodEventId\": \"grn:schedule:event\"}]}" )
);
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_settings ( '{"version": "2024-02-23", "seasonModels": [{"name": "season1", "tiers": [{"raiseRankBonus": 0, "entryFee": 0, "minimumChangePoint": -10, "maximumChangePoint": 20}, {"raiseRankBonus": 30, "entryFee": 10, "minimumChangePoint": -10, "maximumChangePoint": 30}, {"raiseRankBonus": 60, "entryFee": 20, "minimumChangePoint": -20, "maximumChangePoint": 50}, {"raiseRankBonus": 60, "entryFee": 30, "minimumChangePoint": -30, "maximumChangePoint": 60}], "experienceModelId": "grn:experience:level", "challengePeriodEventId": "grn:schedule:event"}]}' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'seasonRating' )
api_result = client.update_current_season_model_master ({
namespaceName = "namespace-0001" ,
settings = "{ \" version \" : \" 2024-02-23 \" , \" seasonModels \" : [{ \" name \" : \" season1 \" , \" tiers \" : [{ \" raiseRankBonus \" : 0, \" entryFee \" : 0, \" minimumChangePoint \" : -10, \" maximumChangePoint \" : 20}, { \" raiseRankBonus \" : 30, \" entryFee \" : 10, \" minimumChangePoint \" : -10, \" maximumChangePoint \" : 30}, { \" raiseRankBonus \" : 60, \" entryFee \" : 20, \" minimumChangePoint \" : -20, \" maximumChangePoint \" : 50}, { \" raiseRankBonus \" : 60, \" entryFee \" : 30, \" minimumChangePoint \" : -30, \" maximumChangePoint \" : 60}], \" experienceModelId \" : \" grn:experience:level \" , \" challengePeriodEventId \" : \" grn:schedule:event \" }]}" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
api_result_handler = client.update_current_season_model_master_async ({
namespaceName = "namespace-0001" ,
settings = "{ \" version \" : \" 2024-02-23 \" , \" seasonModels \" : [{ \" name \" : \" season1 \" , \" tiers \" : [{ \" raiseRankBonus \" : 0, \" entryFee \" : 0, \" minimumChangePoint \" : -10, \" maximumChangePoint \" : 20}, { \" raiseRankBonus \" : 30, \" entryFee \" : 10, \" minimumChangePoint \" : -10, \" maximumChangePoint \" : 30}, { \" raiseRankBonus \" : 60, \" entryFee \" : 20, \" minimumChangePoint \" : -20, \" maximumChangePoint \" : 50}, { \" raiseRankBonus \" : 60, \" entryFee \" : 30, \" minimumChangePoint \" : -30, \" maximumChangePoint \" : 60}], \" experienceModelId \" : \" grn:experience:level \" , \" challengePeriodEventId \" : \" grn:schedule:event \" }]}" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
updateCurrentSeasonModelMasterFromGitHub 現在有効なレーティングマスターを更新
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 checkoutSetting GitHubCheckoutSetting ✓ GitHubからマスターデータをチェックアウトしてくる設定
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . UpdateCurrentSeasonModelMasterFromGitHub (
& season_rating . UpdateCurrentSeasonModelMasterFromGitHubRequest {
NamespaceName : pointy . String ( "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 . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\UpdateCurrentSeasonModelMasterFromGitHubRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateCurrentSeasonModelMasterFromGitHub (
( new UpdateCurrentSeasonModelMasterFromGitHubRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.UpdateCurrentSeasonModelMasterFromGitHubRequest ;
using Gs2.Gs2SeasonRating.Result.UpdateCurrentSeasonModelMasterFromGitHubResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . UpdateCurrentSeasonModelMasterFromGitHubResult > asyncResult = null ;
yield return client . UpdateCurrentSeasonModelMasterFromGitHub (
new Gs2 . Gs2SeasonRating . Request . UpdateCurrentSeasonModelMasterFromGitHubRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
getBallot 署名と共に投票用紙を作成
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 seasonName string ✓ ~ 128文字 シーズンモデル名 sessionName string ✓ UUID ~ 128文字 セッション名 accessToken string ✓ ~ 128文字 アクセストークン numberOfPlayer int ✓ 2 ~ 10 参加人数 keyId string ✓ “grn:gs2:{region}:{ownerId}:key:default:key:default” ~ 1024文字 暗号鍵GRN
Result 型 説明 item Ballot 投票用紙 body string 署名対象のデータ signature string 署名データ
実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . GetBallot (
& season_rating . GetBallotRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
SeasonName : pointy . String ( "rating-0001" ),
SessionName : pointy . String ( "gathering-0001" ),
AccessToken : pointy . String ( "accessToken-0001" ),
NumberOfPlayer : pointy . Int32 ( 4 ),
KeyId : pointy . String ( "key-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
body := result . Body
signature := result . Signature
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\GetBallotRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getBallot (
( new GetBallotRequest ())
-> withNamespaceName ( "namespace-0001" )
-> withSeasonName ( "rating-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 ( "rating-0001" )
. withSessionName ( "gathering-0001" )
. withAccessToken ( "accessToken-0001" )
. withNumberOfPlayer ( 4 )
. withKeyId ( "key-0001" )
);
Ballot item = result . getItem ();
String body = result . getBody ();
String signature = result . getSignature ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.GetBallotRequest ;
using Gs2.Gs2SeasonRating.Result.GetBallotResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . GetBallotResult > asyncResult = null ;
yield return client . GetBallot (
new Gs2 . Gs2SeasonRating . Request . GetBallotRequest ()
. WithNamespaceName ( "namespace-0001" )
. WithSeasonName ( "rating-0001" )
. WithSessionName ( "gathering-0001" )
. WithAccessToken ( "accessToken-0001" )
. WithNumberOfPlayer ( 4 )
. WithKeyId ( "key-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
var body = result . Body ;
var signature = result . Signature ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2SeasonRating from '@/gs2/seasonRating' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2SeasonRating . Gs2SeasonRatingRestClient ( session );
try {
const result = await client . getBallot (
new Gs2SeasonRating . GetBallotRequest ()
. withNamespaceName ( "namespace-0001" )
. withSeasonName ( "rating-0001" )
. withSessionName ( "gathering-0001" )
. withAccessToken ( "accessToken-0001" )
. withNumberOfPlayer ( 4 )
. withKeyId ( "key-0001" )
);
const item = result . getItem ();
const body = result . getBody ();
const signature = result . getSignature ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import season_rating
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = season_rating . Gs2SeasonRatingRestClient ( session )
try :
result = client . get_ballot (
season_rating . GetBallotRequest ()
. with_namespace_name ( 'namespace-0001' )
. with_season_name ( 'rating-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 ( 'seasonRating' )
api_result = client.get_ballot ({
namespaceName = "namespace-0001" ,
seasonName = "rating-0001" ,
sessionName = "gathering-0001" ,
accessToken = "accessToken-0001" ,
numberOfPlayer = 4 ,
keyId = "key-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
body = result.body ;
signature = result.signature ;
client = gs2 ( 'seasonRating' )
api_result_handler = client.get_ballot_async ({
namespaceName = "namespace-0001" ,
seasonName = "rating-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 [ 'message' ])
end
result = api_result.result
item = result.item ;
body = result.body ;
signature = result.signature ;
getBallotByUserId ユーザーIDを指定して署名と共に投票用紙を作成
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 seasonName string ✓ ~ 128文字 シーズンモデル名 sessionName string ✓ UUID ~ 128文字 セッション名 userId string ✓ ~ 128文字 ユーザーID numberOfPlayer int ✓ 2 ~ 10 参加人数 keyId string ✓ “grn:gs2:{region}:{ownerId}:key:default:key:default” ~ 1024文字 暗号鍵GRN timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 型 説明 item Ballot 投票用紙 body string 署名対象のデータ signature string 署名データ
実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . GetBallotByUserId (
& season_rating . GetBallotByUserIdRequest {
NamespaceName : pointy . String ( "namespace-0001" ),
SeasonName : pointy . String ( "rating-0001" ),
SessionName : pointy . String ( "gathering-0001" ),
UserId : pointy . String ( "user-0001" ),
NumberOfPlayer : pointy . Int32 ( 4 ),
KeyId : pointy . String ( "key-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
body := result . Body
signature := result . Signature
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\GetBallotByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getBallotByUserId (
( new GetBallotByUserIdRequest ())
-> withNamespaceName ( "namespace-0001" )
-> withSeasonName ( "rating-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 ( "rating-0001" )
. withSessionName ( "gathering-0001" )
. withUserId ( "user-0001" )
. withNumberOfPlayer ( 4 )
. withKeyId ( "key-0001" )
. withTimeOffsetToken ( null )
);
Ballot item = result . getItem ();
String body = result . getBody ();
String signature = result . getSignature ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.GetBallotByUserIdRequest ;
using Gs2.Gs2SeasonRating.Result.GetBallotByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . GetBallotByUserIdResult > asyncResult = null ;
yield return client . GetBallotByUserId (
new Gs2 . Gs2SeasonRating . Request . GetBallotByUserIdRequest ()
. WithNamespaceName ( "namespace-0001" )
. WithSeasonName ( "rating-0001" )
. WithSessionName ( "gathering-0001" )
. WithUserId ( "user-0001" )
. WithNumberOfPlayer ( 4 )
. WithKeyId ( "key-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
var body = result . Body ;
var signature = result . Signature ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2SeasonRating from '@/gs2/seasonRating' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2SeasonRating . Gs2SeasonRatingRestClient ( session );
try {
const result = await client . getBallotByUserId (
new Gs2SeasonRating . GetBallotByUserIdRequest ()
. withNamespaceName ( "namespace-0001" )
. withSeasonName ( "rating-0001" )
. withSessionName ( "gathering-0001" )
. withUserId ( "user-0001" )
. withNumberOfPlayer ( 4 )
. withKeyId ( "key-0001" )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
const body = result . getBody ();
const signature = result . getSignature ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import season_rating
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = season_rating . Gs2SeasonRatingRestClient ( session )
try :
result = client . get_ballot_by_user_id (
season_rating . GetBallotByUserIdRequest ()
. with_namespace_name ( 'namespace-0001' )
. with_season_name ( 'rating-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 ( 'seasonRating' )
api_result = client.get_ballot_by_user_id ({
namespaceName = "namespace-0001" ,
seasonName = "rating-0001" ,
sessionName = "gathering-0001" ,
userId = "user-0001" ,
numberOfPlayer = 4 ,
keyId = "key-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
body = result.body ;
signature = result.signature ;
client = gs2 ( 'seasonRating' )
api_result_handler = client.get_ballot_by_user_id_async ({
namespaceName = "namespace-0001" ,
seasonName = "rating-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 [ 'message' ])
end
result = api_result.result
item = result.item ;
body = result.body ;
signature = result.signature ;
vote 対戦結果を投票します。
投票は最初の投票が行われてから5分以内に行う必要があります。 つまり、結果は即座に反映されず、投票開始からおよそ5分後または全てのプレイヤーが投票を行った際に結果が反映されます。 5分以内に全ての投票用紙を回収できなかった場合はその時点の投票内容で多数決をとって結果を決定します。
結果を即座に反映したい場合は、勝利した側の代表プレイヤーが投票用紙を各プレイヤーから集めて voteMultiple を呼び出すことで結果を即座に反映できます。
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 ballotBody string ✓ ~ 1024文字 投票用紙の署名対象のデータ ballotSignature string ✓ ~ 256文字 投票用紙の署名 gameResults List<GameResult> ~ 10 items 投票内容。対戦を行ったプレイヤーグループ1に所属するユーザIDのリスト keyId string ✓ “grn:gs2:{region}:{ownerId}:key:default:key:default” ~ 1024文字 暗号鍵GRN
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . Vote (
& season_rating . VoteRequest {
NamespaceName : pointy . String ( "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 . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\VoteRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> vote (
( new VoteRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.VoteRequest ;
using Gs2.Gs2SeasonRating.Result.VoteResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . VoteResult > asyncResult = null ;
yield return client . Vote (
new Gs2 . Gs2SeasonRating . Request . VoteRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
voteMultiple 対戦結果をまとめて投票します。
ゲームに勝利した側が他プレイヤーの投票用紙を集めてまとめて投票するのに使用します。 『勝利した側』としているのは、敗北した側が自分たちが勝ったことにして報告することにインセンティブはありますが、その逆はないためです。 負けた側が投票用紙を渡してこない可能性がありますが、その場合も過半数の投票用紙があれば結果を通すことができます。
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 signedBallots List<SignedBallot> ~ 10 items 署名付の投票用紙リスト gameResults List<GameResult> ~ 10 items 投票内容。対戦を行ったプレイヤーグループ1に所属するユーザIDのリスト keyId string ✓ “grn:gs2:{region}:{ownerId}:key:default:key:default” ~ 1024文字 暗号鍵GRN
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . VoteMultiple (
& season_rating . VoteMultipleRequest {
NamespaceName : pointy . String ( "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 . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\SeasonRating\Gs2SeasonRatingRestClient ;
use Gs2\SeasonRating\Request\VoteMultipleRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> voteMultiple (
( new VoteMultipleRequest ())
-> withNamespaceName ( "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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.VoteMultipleRequest ;
using Gs2.Gs2SeasonRating.Result.VoteMultipleResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . VoteMultipleResult > asyncResult = null ;
yield return client . VoteMultiple (
new Gs2 . Gs2SeasonRating . Request . VoteMultipleRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
commitVote 投票状況を強制確定
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 seasonName string ✓ ~ 128文字 シーズンモデル名 sessionName string ✓ ~ 128文字 投票対象のセッション名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/season_rating"
import "github.com/openlyinc/pointy"
session := core . Gs2RestSession {
Credential : & core . BasicGs2Credential {
ClientId : "your client id" ,
ClientSecret : "your client secret" ,
},
Region : core . ApNortheast1 ,
}
if err := session . Connect (); err != nil {
panic ( "error occurred" )
}
client := season_rating . Gs2SeasonRatingRestClient {
Session : & session ,
}
result , err := client . CommitVote (
& season_rating . CommitVoteRequest {
NamespaceName : pointy . String ( "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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2SeasonRating.Gs2SeasonRatingRestClient ;
using Gs2.Gs2SeasonRating.Request.CommitVoteRequest ;
using Gs2.Gs2SeasonRating.Result.CommitVoteResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2SeasonRatingRestClient ( session );
AsyncResult < Gs2 . Gs2SeasonRating . Result . CommitVoteResult > asyncResult = null ;
yield return client . CommitVote (
new Gs2 . Gs2SeasonRating . Request . CommitVoteRequest ()
. WithNamespaceName ( "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 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result
client = gs2 ( 'seasonRating' )
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 [ 'message' ])
end
result = api_result.result