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 ;