GS2-Grade SDK API リファレンス モデル Namespace ネームスペース
ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。 GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
型 有効化条件 必須 デフォルト 値の制限 説明 namespaceId string ✓ ~ 1024文字 ネームスペースGRN name string ✓ ~ 128文字 ネームスペース名 description string ~ 1024文字 説明文 transactionSetting TransactionSetting トランザクション設定 changeGradeScript ScriptSetting グレード変化したときに実行するスクリプト logSetting LogSetting ログの出力設定 createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒) updatedAt long ✓ 現在時刻 最終更新日時 (UNIX時間 単位:ミリ秒) revision long 0 ~ 9223372036854775805 リビジョン
GradeModelMaster グレードモデルマスター
グレードモデルとは、ランクアップに必要なグレードの閾値や、デフォルトのランクキャップ・最大ランクキャップ毎に設定するエンティティです。
型 有効化条件 必須 デフォルト 値の制限 説明 gradeModelId string ✓ ~ 1024文字 グレードモデルマスターGRN name string ✓ ~ 128文字 グレードモデル名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ defaultGrades List<DefaultGradeModel> ~ 100 items デフォルトグレードモデルリスト experienceModelId string ✓ ~ 1024文字 グレードとランクキャップを連動させる経験値モデルGRN gradeEntries List<GradeEntryModel> ~ 100 items グレードエントリリスト acquireActionRates List<AcquireActionRate> ~ 100 items 報酬加算テーブルリスト createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒) updatedAt long ✓ 現在時刻 最終更新日時 (UNIX時間 単位:ミリ秒) revision long 0 ~ 9223372036854775805 リビジョン
GradeModel グレードモデル
グレードとは、キャラクターや装備のランクを示すエンティティで、グレードによって GS2-Experience のランクキャップを設定することができます。
型 有効化条件 必須 デフォルト 値の制限 説明 gradeModelId string ✓ ~ 1024文字 グレードモデルGRN name string ✓ ~ 128文字 グレードモデル名 metadata string ~ 2048文字 メタデータ defaultGrades List<DefaultGradeModel> ~ 100 items デフォルトグレードモデルリスト experienceModelId string ✓ ~ 1024文字 グレードとランクキャップを連動させる経験値モデルGRN gradeEntries List<GradeEntryModel> ✓ 1 ~ 100 items グレードエントリリスト acquireActionRates List<AcquireActionRate> ~ 100 items 報酬加算テーブルリスト
Status ステータス
ステータスとはプロパティID毎に存在するエンティティで、 現在のグレードの値を保持します。
プロパティID とはステータス固有のIDで、開発者が任意の値を設定できます。 連動する GS2-Experience のプロパティIDと完全に一致する値を使用することを強く推奨しています。
型 有効化条件 必須 デフォルト 値の制限 説明 statusId string ✓ ~ 1024文字 ステータスGRN gradeName string ✓ ~ 128文字 グレードモデルの名前 userId string ✓ ~ 128文字 ユーザーID propertyId string ✓ ~ 1024文字 プロパティID gradeValue long ✓ 1 1 ~ 9223372036854775805 現在のグレード createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒) updatedAt long ✓ 現在時刻 最終更新日時 (UNIX時間 単位:ミリ秒) revision long 0 ~ 9223372036854775805 リビジョン
DefaultGradeModel デフォルトグレードモデル
グレードを新規作成する際にプロパティIDの正規表現へのマッチに応じてデフォルトのグレード値を設定することができます。
型 有効化条件 必須 デフォルト 値の制限 説明 propertyIdRegex string ✓ ~ 1024文字 デフォルト値を適用するプロパティIDの正規表現 defaultGradeValue long ✓ ~ 9223372036854775805 デフォルトのグレード値
GradeEntryModel グレードエントリ
型 有効化条件 必須 デフォルト 値の制限 説明 metadata string ~ 2048文字 メタデータ rankCapValue long ✓ ~ 9223372036854775805 GS2-Experience に設定するランクキャップ値 propertyIdRegex string ✓ ~ 1024文字 プロパティIDからグレードアップに使用可能なリソースを特定するための変数を取り出すための正規表現 gradeUpPropertyIdRegex string ✓ ~ 1024文字 グレードアップに利用可能なリソースのプロパティIDの正規表現
AcquireActionRate 報酬加算テーブルマスター
グレードに応じて報酬の量を調整することができます。
型 有効化条件 必須 デフォルト 値の制限 説明 name string ✓ ~ 128文字 報酬加算テーブル名 mode enum { “double”, “big” } ✓ “double” ~ 128文字 報酬加算テーブルの種類 rates List<double> {mode} == “double” ✓ 1 ~ 1000 items グレードごとの加算量(倍率) bigRates List<string> {mode} == “big” ✓ 1 ~ 1000 items グレードごとの加算量(倍率)
mode に指定する列挙型の定義 定義 説明 double 2^48 未満の浮動小数点数 big 文字列表記で1024桁未満の浮動小数点数
CurrentGradeMaster 現在有効なマスターデータ
GS2ではマスターデータの管理にJSON形式のファイルを使用します。 ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
型 有効化条件 必須 デフォルト 値の制限 説明 namespaceId string ✓ ~ 1024文字 現在有効なグレード設定GRN settings string ✓ ~ 5242880文字 マスターデータ
AcquireAction 入手アクション
型 有効化条件 必須 デフォルト 値の制限 説明 action enum {"Gs2AdReward:AcquirePointByUserId" ,"Gs2Dictionary:AddEntriesByUserId" ,"Gs2Enchant:ReDrawBalanceParameterStatusByUserId" ,"Gs2Enchant:SetBalanceParameterStatusByUserId" ,"Gs2Enchant:ReDrawRarityParameterStatusByUserId" ,"Gs2Enchant:AddRarityParameterStatusByUserId" ,"Gs2Enchant:SetRarityParameterStatusByUserId" ,"Gs2Enhance:DirectEnhanceByUserId" ,"Gs2Enhance:UnleashByUserId" ,"Gs2Enhance:CreateProgressByUserId" ,"Gs2Exchange:ExchangeByUserId" ,"Gs2Exchange:IncrementalExchangeByUserId" ,"Gs2Exchange:CreateAwaitByUserId" ,"Gs2Exchange:AcquireForceByUserId" ,"Gs2Exchange:SkipByUserId" ,"Gs2Experience:AddExperienceByUserId" ,"Gs2Experience:SetExperienceByUserId" ,"Gs2Experience:AddRankCapByUserId" ,"Gs2Experience:SetRankCapByUserId" ,"Gs2Experience:MultiplyAcquireActionsByUserId" ,"Gs2Formation:AddMoldCapacityByUserId" ,"Gs2Formation:SetMoldCapacityByUserId" ,"Gs2Formation:AcquireActionsToFormProperties" ,"Gs2Formation:SetFormByUserId" ,"Gs2Formation:AcquireActionsToPropertyFormProperties" ,"Gs2Friend:UpdateProfileByUserId" ,"Gs2Grade:AddGradeByUserId" ,"Gs2Grade:ApplyRankCapByUserId" ,"Gs2Grade:MultiplyAcquireActionsByUserId" ,"Gs2Guild:IncreaseMaximumCurrentMaximumMemberCountByGuildName" ,"Gs2Guild:SetMaximumCurrentMaximumMemberCountByGuildName" ,"Gs2Idle:IncreaseMaximumIdleMinutesByUserId" ,"Gs2Idle:SetMaximumIdleMinutesByUserId" ,"Gs2Idle:ReceiveByUserId" ,"Gs2Inbox:SendMessageByUserId" ,"Gs2Inventory:AddCapacityByUserId" ,"Gs2Inventory:SetCapacityByUserId" ,"Gs2Inventory:AcquireItemSetByUserId" ,"Gs2Inventory:AcquireItemSetWithGradeByUserId" ,"Gs2Inventory:AddReferenceOfByUserId" ,"Gs2Inventory:DeleteReferenceOfByUserId" ,"Gs2Inventory:AcquireSimpleItemsByUserId" ,"Gs2Inventory:SetSimpleItemsByUserId" ,"Gs2Inventory:AcquireBigItemByUserId" ,"Gs2Inventory:SetBigItemByUserId" ,"Gs2JobQueue:PushByUserId" ,"Gs2Limit:CountDownByUserId" ,"Gs2Limit:DeleteCounterByUserId" ,"Gs2LoginReward:DeleteReceiveStatusByUserId" ,"Gs2LoginReward:UnmarkReceivedByUserId" ,"Gs2Lottery:DrawByUserId" ,"Gs2Lottery:ResetBoxByUserId" ,"Gs2Mission:RevertReceiveByUserId" ,"Gs2Mission:IncreaseCounterByUserId" ,"Gs2Mission:SetCounterByUserId" ,"Gs2Money:DepositByUserId" ,"Gs2Money:RevertRecordReceipt" ,"Gs2Money2:DepositByUserId" ,"Gs2Quest:CreateProgressByUserId" ,"Gs2Schedule:TriggerByUserId" ,"Gs2Script:InvokeScript" ,"Gs2SerialKey:RevertUseByUserId" ,"Gs2SerialKey:IssueOnce" ,"Gs2Showcase:DecrementPurchaseCountByUserId" ,"Gs2Showcase:ForceReDrawByUserId" ,"Gs2SkillTree:MarkReleaseByUserId" ,"Gs2Stamina:RecoverStaminaByUserId" ,"Gs2Stamina:RaiseMaxValueByUserId" ,"Gs2Stamina:SetMaxValueByUserId" ,"Gs2Stamina:SetRecoverIntervalByUserId" ,"Gs2Stamina:SetRecoverValueByUserId" ,"Gs2StateMachine:StartStateMachineByUserId" , } ✓ ~ 128文字 入手アクションで実行するアクションの種類 request string ✓ ~ 1048576文字 リクエストのJSON
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 トランザクション実行結果
サーバーサイドでのトランザクションの自動実行機能を利用して実行されたトランザクションの実行結果
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 タグ
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
TransactionSetting トランザクション設定
型 有効化条件 必須 デフォルト 値の制限 説明 enableAutoRun bool ✓ false 発行したトランザクションをサーバーサイドで自動的に実行するか enableAtomicCommit bool {enableAutoRun} == true ✓ 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 のネームスペース
メソッド 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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . DescribeNamespaces (
& grade . 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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.DescribeNamespacesRequest ;
import io.gs2.grade.result.DescribeNamespacesResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.DescribeNamespacesRequest ;
using Gs2.Gs2Grade.Result.DescribeNamespacesResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . DescribeNamespacesResult > asyncResult = null ;
yield return client . DescribeNamespaces (
new Gs2 . Gs2Grade . 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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . describeNamespaces (
new Gs2Grade . 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 grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . describe_namespaces (
grade . 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 ( 'grade' )
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 ( 'grade' )
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 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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . CreateNamespace (
& grade . CreateNamespaceRequest {
Name : pointy . String ( "namespace1" ),
Description : nil ,
TransactionSetting : nil ,
ChangeGradeScript : nil ,
LogSetting : & grade . LogSetting {
LoggingNamespaceId : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ),
},
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\CreateNamespaceRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> createNamespace (
( new CreateNamespaceRequest ())
-> withName ( self :: namespace1 )
-> withDescription ( null )
-> withTransactionSetting ( null )
-> withChangeGradeScript ( null )
-> withLogSetting (( new \Gs2\Grade\Model\LogSetting ())
-> withLoggingNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:log: \n amespace1" ))
);
$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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.CreateNamespaceRequest ;
import io.gs2.grade.result.CreateNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
CreateNamespaceResult result = client . createNamespace (
new CreateNamespaceRequest ()
. withName ( "namespace1" )
. withDescription ( null )
. withTransactionSetting ( null )
. withChangeGradeScript ( null )
. withLogSetting ( new io . gs2 . grade . model . LogSetting ()
. withLoggingNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ))
);
Namespace item = result . getItem ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.CreateNamespaceRequest ;
using Gs2.Gs2Grade.Result.CreateNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . CreateNamespaceResult > asyncResult = null ;
yield return client . CreateNamespace (
new Gs2 . Gs2Grade . Request . CreateNamespaceRequest ()
. WithName ( "namespace1" )
. WithDescription ( null )
. WithTransactionSetting ( null )
. WithChangeGradeScript ( null )
. WithLogSetting ( new Gs2 . Gs2Grade . Model . LogSetting ()
. WithLoggingNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" )),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . createNamespace (
new Gs2Grade . CreateNamespaceRequest ()
. withName ( "namespace1" )
. withDescription ( null )
. withTransactionSetting ( null )
. withChangeGradeScript ( null )
. withLogSetting ( new Gs2Grade . model . LogSetting ()
. withLoggingNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ))
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . create_namespace (
grade . CreateNamespaceRequest ()
. with_name ( self . hash1 )
. with_description ( None )
. with_transaction_setting ( None )
. with_change_grade_script ( None )
. with_log_setting (
grade . LogSetting ()
. with_logging_namespace_id ( 'grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1' ))
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.create_namespace ({
name = "namespace1" ,
description = nil ,
transactionSetting = nil ,
changeGradeScript = nil ,
logSetting = {
loggingNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ,
},
})
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 ( 'grade' )
api_result_handler = client.create_namespace_async ({
name = "namespace1" ,
description = nil ,
transactionSetting = nil ,
changeGradeScript = nil ,
logSetting = {
loggingNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ,
},
})
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . GetNamespaceStatus (
& grade . GetNamespaceStatusRequest {
NamespaceName : pointy . String ( "namespace1" ),
}
)
if err != nil {
panic ( "error occurred" )
}
status := result . Status
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\GetNamespaceStatusRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getNamespaceStatus (
( new GetNamespaceStatusRequest ())
-> withNamespaceName ( self :: namespace1 )
);
$status = $result -> getStatus ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.GetNamespaceStatusRequest ;
import io.gs2.grade.result.GetNamespaceStatusResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
GetNamespaceStatusResult result = client . getNamespaceStatus (
new GetNamespaceStatusRequest ()
. withNamespaceName ( "namespace1" )
);
String status = result . getStatus ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.GetNamespaceStatusRequest ;
using Gs2.Gs2Grade.Result.GetNamespaceStatusResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . GetNamespaceStatusResult > asyncResult = null ;
yield return client . GetNamespaceStatus (
new Gs2 . Gs2Grade . Request . GetNamespaceStatusRequest ()
. WithNamespaceName ( "namespace1" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var status = result . Status ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . getNamespaceStatus (
new Gs2Grade . GetNamespaceStatusRequest ()
. withNamespaceName ( "namespace1" )
);
const status = result . getStatus ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . get_namespace_status (
grade . GetNamespaceStatusRequest ()
. with_namespace_name ( self . hash1 )
)
status = result . status
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.get_namespace_status ({
namespaceName = "namespace1" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
status = result.status ;
client = gs2 ( 'grade' )
api_result_handler = client.get_namespace_status_async ({
namespaceName = "namespace1" ,
})
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . GetNamespace (
& grade . GetNamespaceRequest {
NamespaceName : pointy . String ( "namespace1" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\GetNamespaceRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getNamespace (
( new GetNamespaceRequest ())
-> withNamespaceName ( self :: namespace1 )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.GetNamespaceRequest ;
import io.gs2.grade.result.GetNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
GetNamespaceResult result = client . getNamespace (
new GetNamespaceRequest ()
. withNamespaceName ( "namespace1" )
);
Namespace item = result . getItem ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.GetNamespaceRequest ;
using Gs2.Gs2Grade.Result.GetNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . GetNamespaceResult > asyncResult = null ;
yield return client . GetNamespace (
new Gs2 . Gs2Grade . Request . GetNamespaceRequest ()
. WithNamespaceName ( "namespace1" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . getNamespace (
new Gs2Grade . GetNamespaceRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . get_namespace (
grade . GetNamespaceRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.get_namespace ({
namespaceName = "namespace1" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'grade' )
api_result_handler = client.get_namespace_async ({
namespaceName = "namespace1" ,
})
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 トランザクション設定 changeGradeScript ScriptSetting グレード変化したときに実行するスクリプト 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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . UpdateNamespace (
& grade . UpdateNamespaceRequest {
NamespaceName : pointy . String ( "namespace1" ),
Description : pointy . String ( "description1" ),
TransactionSetting : nil ,
ChangeGradeScript : & grade . ScriptSetting {
TriggerScriptId : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002" ),
DoneTriggerScriptId : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003" ),
},
LogSetting : & grade . LogSetting {
LoggingNamespaceId : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ),
},
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\UpdateNamespaceRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateNamespace (
( new UpdateNamespaceRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withDescription ( "description1" )
-> withTransactionSetting ( null )
-> withChangeGradeScript (( new \Gs2\Grade\Model\ScriptSetting ())
-> withTriggerScriptId ( "grn:gs2:ap-northeast-1:YourOwnerId:script: \n amespace1:script:script-1002" )
-> withDoneTriggerScriptId ( "grn:gs2:ap-northeast-1:YourOwnerId:script: \n amespace1:script:script-1003" ))
-> withLogSetting (( new \Gs2\Grade\Model\LogSetting ())
-> withLoggingNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:log: \n amespace1" ))
);
$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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.UpdateNamespaceRequest ;
import io.gs2.grade.result.UpdateNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
UpdateNamespaceResult result = client . updateNamespace (
new UpdateNamespaceRequest ()
. withNamespaceName ( "namespace1" )
. withDescription ( "description1" )
. withTransactionSetting ( null )
. withChangeGradeScript ( new io . gs2 . grade . model . ScriptSetting ()
. withTriggerScriptId ( "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002" )
. withDoneTriggerScriptId ( "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003" ))
. withLogSetting ( new io . gs2 . grade . model . LogSetting ()
. withLoggingNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ))
);
Namespace item = result . getItem ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.UpdateNamespaceRequest ;
using Gs2.Gs2Grade.Result.UpdateNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . UpdateNamespaceResult > asyncResult = null ;
yield return client . UpdateNamespace (
new Gs2 . Gs2Grade . Request . UpdateNamespaceRequest ()
. WithNamespaceName ( "namespace1" )
. WithDescription ( "description1" )
. WithTransactionSetting ( null )
. WithChangeGradeScript ( new Gs2 . Gs2Grade . Model . ScriptSetting ()
. WithTriggerScriptId ( "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002" )
. WithDoneTriggerScriptId ( "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003" ))
. WithLogSetting ( new Gs2 . Gs2Grade . Model . LogSetting ()
. WithLoggingNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" )),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . updateNamespace (
new Gs2Grade . UpdateNamespaceRequest ()
. withNamespaceName ( "namespace1" )
. withDescription ( "description1" )
. withTransactionSetting ( null )
. withChangeGradeScript ( new Gs2Grade . model . ScriptSetting ()
. withTriggerScriptId ( "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002" )
. withDoneTriggerScriptId ( "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003" ))
. withLogSetting ( new Gs2Grade . model . LogSetting ()
. withLoggingNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ))
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . update_namespace (
grade . UpdateNamespaceRequest ()
. with_namespace_name ( self . hash1 )
. with_description ( 'description1' )
. with_transaction_setting ( None )
. with_change_grade_script (
grade . ScriptSetting ()
. with_trigger_script_id ( 'grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002' )
. with_done_trigger_script_id ( 'grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003' ))
. with_log_setting (
grade . LogSetting ()
. with_logging_namespace_id ( 'grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1' ))
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.update_namespace ({
namespaceName = "namespace1" ,
description = "description1" ,
transactionSetting = nil ,
changeGradeScript = {
triggerScriptId = "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002" ,
doneTriggerScriptId = "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003" ,
},
logSetting = {
loggingNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ,
},
})
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 ( 'grade' )
api_result_handler = client.update_namespace_async ({
namespaceName = "namespace1" ,
description = "description1" ,
transactionSetting = nil ,
changeGradeScript = {
triggerScriptId = "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002" ,
doneTriggerScriptId = "grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003" ,
},
logSetting = {
loggingNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ,
},
})
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . DeleteNamespace (
& grade . DeleteNamespaceRequest {
NamespaceName : pointy . String ( "namespace1" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\DeleteNamespaceRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> deleteNamespace (
( new DeleteNamespaceRequest ())
-> withNamespaceName ( self :: namespace1 )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.DeleteNamespaceRequest ;
import io.gs2.grade.result.DeleteNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
DeleteNamespaceResult result = client . deleteNamespace (
new DeleteNamespaceRequest ()
. withNamespaceName ( "namespace1" )
);
Namespace item = result . getItem ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.DeleteNamespaceRequest ;
using Gs2.Gs2Grade.Result.DeleteNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . DeleteNamespaceResult > asyncResult = null ;
yield return client . DeleteNamespace (
new Gs2 . Gs2Grade . Request . DeleteNamespaceRequest ()
. WithNamespaceName ( "namespace1" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . deleteNamespace (
new Gs2Grade . DeleteNamespaceRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . delete_namespace (
grade . DeleteNamespaceRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.delete_namespace ({
namespaceName = "namespace1" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'grade' )
api_result_handler = client.delete_namespace_async ({
namespaceName = "namespace1" ,
})
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . DumpUserDataByUserId (
& grade . 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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.DumpUserDataByUserIdRequest ;
import io.gs2.grade.result.DumpUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.DumpUserDataByUserIdRequest ;
using Gs2.Gs2Grade.Result.DumpUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . DumpUserDataByUserIdResult > asyncResult = null ;
yield return client . DumpUserDataByUserId (
new Gs2 . Gs2Grade . 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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . dumpUserDataByUserId (
new Gs2Grade . DumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . dump_user_data_by_user_id (
grade . DumpUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
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 ( 'grade' )
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . CheckDumpUserDataByUserId (
& grade . 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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.CheckDumpUserDataByUserIdRequest ;
import io.gs2.grade.result.CheckDumpUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.CheckDumpUserDataByUserIdRequest ;
using Gs2.Gs2Grade.Result.CheckDumpUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . CheckDumpUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckDumpUserDataByUserId (
new Gs2 . Gs2Grade . 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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . checkDumpUserDataByUserId (
new Gs2Grade . CheckDumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
const url = result . getUrl ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . check_dump_user_data_by_user_id (
grade . CheckDumpUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
url = result . url
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
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 ( 'grade' )
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . CleanUserDataByUserId (
& grade . 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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.CleanUserDataByUserIdRequest ;
import io.gs2.grade.result.CleanUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.CleanUserDataByUserIdRequest ;
using Gs2.Gs2Grade.Result.CleanUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . CleanUserDataByUserIdResult > asyncResult = null ;
yield return client . CleanUserDataByUserId (
new Gs2 . Gs2Grade . 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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . cleanUserDataByUserId (
new Gs2Grade . CleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . clean_user_data_by_user_id (
grade . CleanUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
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 ( 'grade' )
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . CheckCleanUserDataByUserId (
& grade . 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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.CheckCleanUserDataByUserIdRequest ;
import io.gs2.grade.result.CheckCleanUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.CheckCleanUserDataByUserIdRequest ;
using Gs2.Gs2Grade.Result.CheckCleanUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . CheckCleanUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckCleanUserDataByUserId (
new Gs2 . Gs2Grade . 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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . checkCleanUserDataByUserId (
new Gs2Grade . CheckCleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . check_clean_user_data_by_user_id (
grade . CheckCleanUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
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 ( 'grade' )
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . PrepareImportUserDataByUserId (
& grade . 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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.PrepareImportUserDataByUserIdRequest ;
import io.gs2.grade.result.PrepareImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.PrepareImportUserDataByUserIdRequest ;
using Gs2.Gs2Grade.Result.PrepareImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . PrepareImportUserDataByUserIdResult > asyncResult = null ;
yield return client . PrepareImportUserDataByUserId (
new Gs2 . Gs2Grade . 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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . prepareImportUserDataByUserId (
new Gs2Grade . 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 grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . prepare_import_user_data_by_user_id (
grade . 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 ( 'grade' )
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 ( 'grade' )
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . ImportUserDataByUserId (
& grade . 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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.ImportUserDataByUserIdRequest ;
import io.gs2.grade.result.ImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.ImportUserDataByUserIdRequest ;
using Gs2.Gs2Grade.Result.ImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . ImportUserDataByUserIdResult > asyncResult = null ;
yield return client . ImportUserDataByUserId (
new Gs2 . Gs2Grade . 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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . importUserDataByUserId (
new Gs2Grade . ImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withUploadToken ( "upload-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . import_user_data_by_user_id (
grade . 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 ( 'grade' )
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 ( 'grade' )
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . CheckImportUserDataByUserId (
& grade . 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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.CheckImportUserDataByUserIdRequest ;
import io.gs2.grade.result.CheckImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.CheckImportUserDataByUserIdRequest ;
using Gs2.Gs2Grade.Result.CheckImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . CheckImportUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckImportUserDataByUserId (
new Gs2 . Gs2Grade . 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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . checkImportUserDataByUserId (
new Gs2Grade . 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 grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . check_import_user_data_by_user_id (
grade . 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 ( 'grade' )
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 ( 'grade' )
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 ;
describeGradeModelMasters グレードモデルマスターの一覧を取得
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . DescribeGradeModelMasters (
& grade . DescribeGradeModelMastersRequest {
NamespaceName : pointy . String ( "namespace1" ),
PageToken : nil ,
Limit : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
nextPageToken := result . NextPageToken
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\DescribeGradeModelMastersRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeGradeModelMasters (
( new DescribeGradeModelMastersRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withPageToken ( null )
-> withLimit ( null )
);
$items = $result -> getItems ();
$nextPageToken = $result -> getNextPageToken ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.DescribeGradeModelMastersRequest ;
import io.gs2.grade.result.DescribeGradeModelMastersResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
DescribeGradeModelMastersResult result = client . describeGradeModelMasters (
new DescribeGradeModelMastersRequest ()
. withNamespaceName ( "namespace1" )
. withPageToken ( null )
. withLimit ( null )
);
List < GradeModelMaster > 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.DescribeGradeModelMastersRequest ;
using Gs2.Gs2Grade.Result.DescribeGradeModelMastersResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . DescribeGradeModelMastersResult > asyncResult = null ;
yield return client . DescribeGradeModelMasters (
new Gs2 . Gs2Grade . Request . DescribeGradeModelMastersRequest ()
. WithNamespaceName ( "namespace1" )
. WithPageToken ( null )
. WithLimit ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var items = result . Items ;
var nextPageToken = result . NextPageToken ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . describeGradeModelMasters (
new Gs2Grade . DescribeGradeModelMastersRequest ()
. withNamespaceName ( "namespace1" )
. withPageToken ( null )
. withLimit ( null )
);
const items = result . getItems ();
const nextPageToken = result . getNextPageToken ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . describe_grade_model_masters (
grade . DescribeGradeModelMastersRequest ()
. with_namespace_name ( self . hash1 )
. with_page_token ( None )
. with_limit ( None )
)
items = result . items
next_page_token = result . next_page_token
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.describe_grade_model_masters ({
namespaceName = "namespace1" ,
pageToken = nil ,
limit = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
client = gs2 ( 'grade' )
api_result_handler = client.describe_grade_model_masters_async ({
namespaceName = "namespace1" ,
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 ;
createGradeModelMaster グレードモデルマスターを新規作成
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 name string ✓ ~ 128文字 グレードモデル名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ defaultGrades List<DefaultGradeModel> ~ 100 items デフォルトグレードモデルリスト experienceModelId string ✓ ~ 1024文字 グレードとランクキャップを連動させる経験値モデルGRN gradeEntries List<GradeEntryModel> ~ 100 items グレードエントリリスト acquireActionRates List<AcquireActionRate> ~ 100 items 報酬加算テーブルリスト
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . CreateGradeModelMaster (
& grade . CreateGradeModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
Name : pointy . String ( "grade-model-0001" ),
Description : nil ,
Metadata : nil ,
DefaultGrades : [] grade . DefaultGradeModel {
grade . DefaultGradeModel {
PropertyIdRegex : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*" ),
DefaultGradeValue : pointy . Int64 ( 2 ),
},
},
ExperienceModelId : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001" ),
GradeEntries : [] grade . GradeEntryModel {
grade . GradeEntryModel {
Metadata : pointy . String ( "GRADE_ENTRY_METADATA" ),
RankCapValue : pointy . Int64 ( 50 ),
PropertyIdRegex : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*" ),
GradeUpPropertyIdRegex : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*" ),
},
},
AcquireActionRates : [] grade . AcquireActionRate {
grade . AcquireActionRate {
Name : pointy . String ( "rate-0001" ),
Rates : [] * float64 {
pointy . Float64 ( 1.0 ),
pointy . Float64 ( 1.5 ),
pointy . Float64 ( 2.0 ),
},
},
grade . AcquireActionRate {
Name : pointy . String ( "rate-0002" ),
Rates : [] * float64 {
pointy . Float64 ( 10.0 ),
pointy . Float64 ( 15.5 ),
pointy . Float64 ( 20.0 ),
},
},
},
}
)
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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\CreateGradeModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> createGradeModelMaster (
( new CreateGradeModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withName ( "grade-model-0001" )
-> withDescription ( null )
-> withMetadata ( null )
-> withDefaultGrades ([
( new \Gs2\Grade\Model\DefaultGradeModel ())
-> withPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*" )
-> withDefaultGradeValue ( 2 ),
])
-> withExperienceModelId ( "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001" )
-> withGradeEntries ([
( new \Gs2\Grade\Model\GradeEntryModel ())
-> withMetadata ( "GRADE_ENTRY_METADATA" )
-> withRankCapValue ( 50 )
-> withPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*" )
-> withGradeUpPropertyIdRegex ( 'grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*' ),
])
-> withAcquireActionRates ([
( new \Gs2\Grade\Model\AcquireActionRate ())
-> withName ( "rate-0001" )
-> withRates ([
1.0 ,
1.5 ,
2.0 ,
]),
( new \Gs2\Grade\Model\AcquireActionRate ())
-> withName ( "rate-0002" )
-> withRates ([
10.0 ,
15.5 ,
20.0 ,
]),
])
);
$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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.CreateGradeModelMasterRequest ;
import io.gs2.grade.result.CreateGradeModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
CreateGradeModelMasterResult result = client . createGradeModelMaster (
new CreateGradeModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withName ( "grade-model-0001" )
. withDescription ( null )
. withMetadata ( null )
. withDefaultGrades ( Arrays . asList (
new io . gs2 . grade . model . DefaultGradeModel ()
. withPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*" )
. withDefaultGradeValue ( 2L )
))
. withExperienceModelId ( "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001" )
. withGradeEntries ( Arrays . asList (
new io . gs2 . grade . model . GradeEntryModel ()
. withMetadata ( "GRADE_ENTRY_METADATA" )
. withRankCapValue ( 50L )
. withPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*" )
. withGradeUpPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*" )
))
. withAcquireActionRates ( Arrays . asList (
new io . gs2 . grade . model . AcquireActionRate ()
. withName ( "rate-0001" )
. withRates ( Arrays . asList (
1 . 0 ,
1 . 5 ,
2 . 0
)),
new io . gs2 . grade . model . AcquireActionRate ()
. withName ( "rate-0002" )
. withRates ( Arrays . asList (
10 . 0 ,
15 . 5 ,
20 . 0
))
))
);
GradeModelMaster 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.CreateGradeModelMasterRequest ;
using Gs2.Gs2Grade.Result.CreateGradeModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . CreateGradeModelMasterResult > asyncResult = null ;
yield return client . CreateGradeModelMaster (
new Gs2 . Gs2Grade . Request . CreateGradeModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithName ( "grade-model-0001" )
. WithDescription ( null )
. WithMetadata ( null )
. WithDefaultGrades ( new Gs2 . Gs2Grade . Model . DefaultGradeModel [] {
new Gs2 . Gs2Grade . Model . DefaultGradeModel ()
. WithPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*" )
. WithDefaultGradeValue ( 2L ),
})
. WithExperienceModelId ( "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001" )
. WithGradeEntries ( new Gs2 . Gs2Grade . Model . GradeEntryModel [] {
new Gs2 . Gs2Grade . Model . GradeEntryModel ()
. WithMetadata ( "GRADE_ENTRY_METADATA" )
. WithRankCapValue ( 50L )
. WithPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*" )
. WithGradeUpPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*" ),
})
. WithAcquireActionRates ( new Gs2 . Gs2Grade . Model . AcquireActionRate [] {
new Gs2 . Gs2Grade . Model . AcquireActionRate ()
. WithName ( "rate-0001" )
. WithRates ( new double [] {
1.0 ,
1.5 ,
2.0 ,
}),
new Gs2 . Gs2Grade . Model . AcquireActionRate ()
. WithName ( "rate-0002" )
. WithRates ( new double [] {
10.0 ,
15.5 ,
20.0 ,
}),
}),
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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . createGradeModelMaster (
new Gs2Grade . CreateGradeModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withName ( "grade-model-0001" )
. withDescription ( null )
. withMetadata ( null )
. withDefaultGrades ([
new Gs2Grade . model . DefaultGradeModel ()
. withPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*" )
. withDefaultGradeValue ( 2 ),
])
. withExperienceModelId ( "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001" )
. withGradeEntries ([
new Gs2Grade . model . GradeEntryModel ()
. withMetadata ( "GRADE_ENTRY_METADATA" )
. withRankCapValue ( 50 )
. withPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*" )
. withGradeUpPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*" ),
])
. withAcquireActionRates ([
new Gs2Grade . model . AcquireActionRate ()
. withName ( "rate-0001" )
. withRates ([
1.0 ,
1.5 ,
2.0 ,
]),
new Gs2Grade . model . AcquireActionRate ()
. withName ( "rate-0002" )
. withRates ([
10.0 ,
15.5 ,
20.0 ,
]),
])
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . create_grade_model_master (
grade . CreateGradeModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_name ( 'grade-model-0001' )
. with_description ( None )
. with_metadata ( None )
. with_default_grades ([
grade . DefaultGradeModel ()
. with_property_id_regex ( 'grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*' )
. with_default_grade_value ( 2 ),
])
. with_experience_model_id ( 'grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001' )
. with_grade_entries ([
grade . GradeEntryModel ()
. with_metadata ( 'GRADE_ENTRY_METADATA' )
. with_rank_cap_value ( 50 )
. with_property_id_regex ( 'grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*' )
. with_grade_up_property_id_regex ( 'grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*' ),
])
. with_acquire_action_rates ([
grade . AcquireActionRate ()
. with_name ( 'rate-0001' )
. with_rates ([
1.0 ,
1.5 ,
2.0 ,
]),
grade . AcquireActionRate ()
. with_name ( 'rate-0002' )
. with_rates ([
10.0 ,
15.5 ,
20.0 ,
]),
])
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.create_grade_model_master ({
namespaceName = "namespace1" ,
name = "grade-model-0001" ,
description = nil ,
metadata = nil ,
defaultGrades = {
{
propertyIdRegex = "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*" ,
defaultGradeValue = 2 ,
}
},
experienceModelId = "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001" ,
gradeEntries = {
{
metadata = "GRADE_ENTRY_METADATA" ,
rankCapValue = 50 ,
propertyIdRegex = "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*" ,
gradeUpPropertyIdRegex = "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*" ,
}
},
acquireActionRates = {
{
name = "rate-0001" ,
rates = {
1.0 ,
1.5 ,
2.0
},
},
{
name = "rate-0002" ,
rates = {
10.0 ,
15.5 ,
20.0
},
}
},
})
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 ( 'grade' )
api_result_handler = client.create_grade_model_master_async ({
namespaceName = "namespace1" ,
name = "grade-model-0001" ,
description = nil ,
metadata = nil ,
defaultGrades = {
{
propertyIdRegex = "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*" ,
defaultGradeValue = 2 ,
}
},
experienceModelId = "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001" ,
gradeEntries = {
{
metadata = "GRADE_ENTRY_METADATA" ,
rankCapValue = 50 ,
propertyIdRegex = "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*" ,
gradeUpPropertyIdRegex = "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*" ,
}
},
acquireActionRates = {
{
name = "rate-0001" ,
rates = {
1.0 ,
1.5 ,
2.0
},
},
{
name = "rate-0002" ,
rates = {
10.0 ,
15.5 ,
20.0
},
}
},
})
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 ;
getGradeModelMaster グレードモデルマスターを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 gradeName 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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . GetGradeModelMaster (
& grade . GetGradeModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
GradeName : pointy . String ( "grade-model-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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\GetGradeModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getGradeModelMaster (
( new GetGradeModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withGradeName ( "grade-model-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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.GetGradeModelMasterRequest ;
import io.gs2.grade.result.GetGradeModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
GetGradeModelMasterResult result = client . getGradeModelMaster (
new GetGradeModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withGradeName ( "grade-model-0001" )
);
GradeModelMaster 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.GetGradeModelMasterRequest ;
using Gs2.Gs2Grade.Result.GetGradeModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . GetGradeModelMasterResult > asyncResult = null ;
yield return client . GetGradeModelMaster (
new Gs2 . Gs2Grade . Request . GetGradeModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithGradeName ( "grade-model-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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . getGradeModelMaster (
new Gs2Grade . GetGradeModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withGradeName ( "grade-model-0001" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . get_grade_model_master (
grade . GetGradeModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_grade_name ( 'grade-model-0001' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.get_grade_model_master ({
namespaceName = "namespace1" ,
gradeName = "grade-model-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 ( 'grade' )
api_result_handler = client.get_grade_model_master_async ({
namespaceName = "namespace1" ,
gradeName = "grade-model-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 ;
updateGradeModelMaster グレードモデルマスターを更新
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 gradeName string ✓ ~ 128文字 グレードモデル名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ defaultGrades List<DefaultGradeModel> ~ 100 items デフォルトグレードモデルリスト experienceModelId string ✓ ~ 1024文字 グレードとランクキャップを連動させる経験値モデルGRN gradeEntries List<GradeEntryModel> ~ 100 items グレードエントリリスト acquireActionRates List<AcquireActionRate> ~ 100 items 報酬加算テーブルリスト
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . UpdateGradeModelMaster (
& grade . UpdateGradeModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
GradeName : pointy . String ( "grade-model-0001" ),
Description : nil ,
Metadata : nil ,
DefaultGrades : [] grade . DefaultGradeModel {
grade . DefaultGradeModel {
PropertyIdRegex : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*" ),
DefaultGradeValue : pointy . Int64 ( 3 ),
},
},
ExperienceModelId : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001" ),
GradeEntries : [] grade . GradeEntryModel {
grade . GradeEntryModel {
Metadata : pointy . String ( "GRADE_ENTRY_METADATA1" ),
RankCapValue : pointy . Int64 ( 60 ),
PropertyIdRegex : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*" ),
GradeUpPropertyIdRegex : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*" ),
},
},
AcquireActionRates : [] grade . AcquireActionRate {
grade . AcquireActionRate {
Name : pointy . String ( "rate-0001" ),
Mode : pointy . String ( "big" ),
BigRates : [] * string {
pointy . String ( "100000000000000" ),
pointy . String ( "10000000000000000000000000000" ),
pointy . String ( "1000000000000000000000000000000000000000000" ),
},
},
grade . AcquireActionRate {
Name : pointy . String ( "rate-0002" ),
Mode : pointy . String ( "big" ),
BigRates : [] * string {
pointy . String ( "100000000000000" ),
pointy . String ( "10000000000000000000000000000" ),
pointy . String ( "1000000000000000000000000000000000000000000" ),
},
},
},
}
)
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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\UpdateGradeModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateGradeModelMaster (
( new UpdateGradeModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withGradeName ( "grade-model-0001" )
-> withDescription ( null )
-> withMetadata ( null )
-> withDefaultGrades ([
( new \Gs2\Grade\Model\DefaultGradeModel ())
-> withPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*" )
-> withDefaultGradeValue ( 3 ),
])
-> withExperienceModelId ( "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001" )
-> withGradeEntries ([
( new \Gs2\Grade\Model\GradeEntryModel ())
-> withMetadata ( "GRADE_ENTRY_METADATA1" )
-> withRankCapValue ( 60 )
-> withPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*" )
-> withGradeUpPropertyIdRegex ( 'grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*' ),
])
-> withAcquireActionRates ([
( new \Gs2\Grade\Model\AcquireActionRate ())
-> withName ( "rate-0001" )
-> withMode ( "big" )
-> withBigRates ([
"100000000000000" ,
"10000000000000000000000000000" ,
"1000000000000000000000000000000000000000000" ,
]),
( new \Gs2\Grade\Model\AcquireActionRate ())
-> withName ( "rate-0002" )
-> withMode ( "big" )
-> withBigRates ([
"100000000000000" ,
"10000000000000000000000000000" ,
"1000000000000000000000000000000000000000000" ,
]),
])
);
$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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.UpdateGradeModelMasterRequest ;
import io.gs2.grade.result.UpdateGradeModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
UpdateGradeModelMasterResult result = client . updateGradeModelMaster (
new UpdateGradeModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withGradeName ( "grade-model-0001" )
. withDescription ( null )
. withMetadata ( null )
. withDefaultGrades ( Arrays . asList (
new io . gs2 . grade . model . DefaultGradeModel ()
. withPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*" )
. withDefaultGradeValue ( 3L )
))
. withExperienceModelId ( "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001" )
. withGradeEntries ( Arrays . asList (
new io . gs2 . grade . model . GradeEntryModel ()
. withMetadata ( "GRADE_ENTRY_METADATA1" )
. withRankCapValue ( 60L )
. withPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*" )
. withGradeUpPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*" )
))
. withAcquireActionRates ( Arrays . asList (
new io . gs2 . grade . model . AcquireActionRate ()
. withName ( "rate-0001" )
. withMode ( "big" )
. withBigRates ( Arrays . asList (
"100000000000000" ,
"10000000000000000000000000000" ,
"1000000000000000000000000000000000000000000"
)),
new io . gs2 . grade . model . AcquireActionRate ()
. withName ( "rate-0002" )
. withMode ( "big" )
. withBigRates ( Arrays . asList (
"100000000000000" ,
"10000000000000000000000000000" ,
"1000000000000000000000000000000000000000000"
))
))
);
GradeModelMaster 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.UpdateGradeModelMasterRequest ;
using Gs2.Gs2Grade.Result.UpdateGradeModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . UpdateGradeModelMasterResult > asyncResult = null ;
yield return client . UpdateGradeModelMaster (
new Gs2 . Gs2Grade . Request . UpdateGradeModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithGradeName ( "grade-model-0001" )
. WithDescription ( null )
. WithMetadata ( null )
. WithDefaultGrades ( new Gs2 . Gs2Grade . Model . DefaultGradeModel [] {
new Gs2 . Gs2Grade . Model . DefaultGradeModel ()
. WithPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*" )
. WithDefaultGradeValue ( 3L ),
})
. WithExperienceModelId ( "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001" )
. WithGradeEntries ( new Gs2 . Gs2Grade . Model . GradeEntryModel [] {
new Gs2 . Gs2Grade . Model . GradeEntryModel ()
. WithMetadata ( "GRADE_ENTRY_METADATA1" )
. WithRankCapValue ( 60L )
. WithPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*" )
. WithGradeUpPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*" ),
})
. WithAcquireActionRates ( new Gs2 . Gs2Grade . Model . AcquireActionRate [] {
new Gs2 . Gs2Grade . Model . AcquireActionRate ()
. WithName ( "rate-0001" )
. WithMode ( "big" )
. WithBigRates ( new string [] {
"100000000000000" ,
"10000000000000000000000000000" ,
"1000000000000000000000000000000000000000000" ,
}),
new Gs2 . Gs2Grade . Model . AcquireActionRate ()
. WithName ( "rate-0002" )
. WithMode ( "big" )
. WithBigRates ( new string [] {
"100000000000000" ,
"10000000000000000000000000000" ,
"1000000000000000000000000000000000000000000" ,
}),
}),
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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . updateGradeModelMaster (
new Gs2Grade . UpdateGradeModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withGradeName ( "grade-model-0001" )
. withDescription ( null )
. withMetadata ( null )
. withDefaultGrades ([
new Gs2Grade . model . DefaultGradeModel ()
. withPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*" )
. withDefaultGradeValue ( 3 ),
])
. withExperienceModelId ( "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001" )
. withGradeEntries ([
new Gs2Grade . model . GradeEntryModel ()
. withMetadata ( "GRADE_ENTRY_METADATA1" )
. withRankCapValue ( 60 )
. withPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*" )
. withGradeUpPropertyIdRegex ( "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*" ),
])
. withAcquireActionRates ([
new Gs2Grade . model . AcquireActionRate ()
. withName ( "rate-0001" )
. withMode ( "big" )
. withBigRates ([
"100000000000000" ,
"10000000000000000000000000000" ,
"1000000000000000000000000000000000000000000" ,
]),
new Gs2Grade . model . AcquireActionRate ()
. withName ( "rate-0002" )
. withMode ( "big" )
. withBigRates ([
"100000000000000" ,
"10000000000000000000000000000" ,
"1000000000000000000000000000000000000000000" ,
]),
])
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . update_grade_model_master (
grade . UpdateGradeModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_grade_name ( 'grade-model-0001' )
. with_description ( None )
. with_metadata ( None )
. with_default_grades ([
grade . DefaultGradeModel ()
. with_property_id_regex ( 'grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*' )
. with_default_grade_value ( 3 ),
])
. with_experience_model_id ( 'grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001' )
. with_grade_entries ([
grade . GradeEntryModel ()
. with_metadata ( 'GRADE_ENTRY_METADATA1' )
. with_rank_cap_value ( 60 )
. with_property_id_regex ( 'grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*' )
. with_grade_up_property_id_regex ( 'grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*' ),
])
. with_acquire_action_rates ([
grade . AcquireActionRate ()
. with_name ( 'rate-0001' )
. with_mode ( 'big' )
. with_big_rates ([
'100000000000000' ,
'10000000000000000000000000000' ,
'1000000000000000000000000000000000000000000' ,
]),
grade . AcquireActionRate ()
. with_name ( 'rate-0002' )
. with_mode ( 'big' )
. with_big_rates ([
'100000000000000' ,
'10000000000000000000000000000' ,
'1000000000000000000000000000000000000000000' ,
]),
])
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.update_grade_model_master ({
namespaceName = "namespace1" ,
gradeName = "grade-model-0001" ,
description = nil ,
metadata = nil ,
defaultGrades = {
{
propertyIdRegex = "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*" ,
defaultGradeValue = 3 ,
}
},
experienceModelId = "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001" ,
gradeEntries = {
{
metadata = "GRADE_ENTRY_METADATA1" ,
rankCapValue = 60 ,
propertyIdRegex = "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*" ,
gradeUpPropertyIdRegex = "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*" ,
}
},
acquireActionRates = {
{
name = "rate-0001" ,
mode = "big" ,
bigRates = {
"100000000000000" ,
"10000000000000000000000000000" ,
"1000000000000000000000000000000000000000000"
},
},
{
name = "rate-0002" ,
mode = "big" ,
bigRates = {
"100000000000000" ,
"10000000000000000000000000000" ,
"1000000000000000000000000000000000000000000"
},
}
},
})
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 ( 'grade' )
api_result_handler = client.update_grade_model_master_async ({
namespaceName = "namespace1" ,
gradeName = "grade-model-0001" ,
description = nil ,
metadata = nil ,
defaultGrades = {
{
propertyIdRegex = "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:ssr-.*" ,
defaultGradeValue = 3 ,
}
},
experienceModelId = "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001" ,
gradeEntries = {
{
metadata = "GRADE_ENTRY_METADATA1" ,
rankCapValue = 60 ,
propertyIdRegex = "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:(.*):.*" ,
gradeUpPropertyIdRegex = "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0002:item:$1:.*" ,
}
},
acquireActionRates = {
{
name = "rate-0001" ,
mode = "big" ,
bigRates = {
"100000000000000" ,
"10000000000000000000000000000" ,
"1000000000000000000000000000000000000000000"
},
},
{
name = "rate-0002" ,
mode = "big" ,
bigRates = {
"100000000000000" ,
"10000000000000000000000000000" ,
"1000000000000000000000000000000000000000000"
},
}
},
})
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 ;
deleteGradeModelMaster グレードモデルマスターを削除
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 gradeName 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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . DeleteGradeModelMaster (
& grade . DeleteGradeModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
GradeName : pointy . String ( "grade-model-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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\DeleteGradeModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> deleteGradeModelMaster (
( new DeleteGradeModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withGradeName ( "grade-model-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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.DeleteGradeModelMasterRequest ;
import io.gs2.grade.result.DeleteGradeModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
DeleteGradeModelMasterResult result = client . deleteGradeModelMaster (
new DeleteGradeModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withGradeName ( "grade-model-0001" )
);
GradeModelMaster 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.DeleteGradeModelMasterRequest ;
using Gs2.Gs2Grade.Result.DeleteGradeModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . DeleteGradeModelMasterResult > asyncResult = null ;
yield return client . DeleteGradeModelMaster (
new Gs2 . Gs2Grade . Request . DeleteGradeModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithGradeName ( "grade-model-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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . deleteGradeModelMaster (
new Gs2Grade . DeleteGradeModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withGradeName ( "grade-model-0001" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . delete_grade_model_master (
grade . DeleteGradeModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_grade_name ( 'grade-model-0001' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.delete_grade_model_master ({
namespaceName = "namespace1" ,
gradeName = "grade-model-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 ( 'grade' )
api_result_handler = client.delete_grade_model_master_async ({
namespaceName = "namespace1" ,
gradeName = "grade-model-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 ;
describeGradeModels グレードモデルの一覧を取得
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . DescribeGradeModels (
& grade . DescribeGradeModelsRequest {
NamespaceName : pointy . String ( "namespace2" ),
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\DescribeGradeModelsRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeGradeModels (
( new DescribeGradeModelsRequest ())
-> withNamespaceName ( self :: namespace2 )
);
$items = $result -> getItems ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.DescribeGradeModelsRequest ;
import io.gs2.grade.result.DescribeGradeModelsResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
DescribeGradeModelsResult result = client . describeGradeModels (
new DescribeGradeModelsRequest ()
. withNamespaceName ( "namespace2" )
);
List < GradeModel > items = result . getItems ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.DescribeGradeModelsRequest ;
using Gs2.Gs2Grade.Result.DescribeGradeModelsResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . DescribeGradeModelsResult > asyncResult = null ;
yield return client . DescribeGradeModels (
new Gs2 . Gs2Grade . Request . DescribeGradeModelsRequest ()
. WithNamespaceName ( "namespace2" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var items = result . Items ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . describeGradeModels (
new Gs2Grade . DescribeGradeModelsRequest ()
. withNamespaceName ( "namespace2" )
);
const items = result . getItems ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . describe_grade_models (
grade . DescribeGradeModelsRequest ()
. with_namespace_name ( self . hash2 )
)
items = result . items
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.describe_grade_models ({
namespaceName = "namespace2" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
client = gs2 ( 'grade' )
api_result_handler = client.describe_grade_models_async ({
namespaceName = "namespace2" ,
})
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 ;
getGradeModel グレードモデルを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 gradeName 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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . GetGradeModel (
& grade . GetGradeModelRequest {
NamespaceName : pointy . String ( "namespace2" ),
GradeName : pointy . String ( "grade-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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\GetGradeModelRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getGradeModel (
( new GetGradeModelRequest ())
-> withNamespaceName ( self :: namespace2 )
-> withGradeName ( "grade-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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.GetGradeModelRequest ;
import io.gs2.grade.result.GetGradeModelResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
GetGradeModelResult result = client . getGradeModel (
new GetGradeModelRequest ()
. withNamespaceName ( "namespace2" )
. withGradeName ( "grade-0001" )
);
GradeModel 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.GetGradeModelRequest ;
using Gs2.Gs2Grade.Result.GetGradeModelResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . GetGradeModelResult > asyncResult = null ;
yield return client . GetGradeModel (
new Gs2 . Gs2Grade . Request . GetGradeModelRequest ()
. WithNamespaceName ( "namespace2" )
. WithGradeName ( "grade-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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . getGradeModel (
new Gs2Grade . GetGradeModelRequest ()
. withNamespaceName ( "namespace2" )
. withGradeName ( "grade-0001" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . get_grade_model (
grade . GetGradeModelRequest ()
. with_namespace_name ( self . hash2 )
. with_grade_name ( 'grade-0001' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.get_grade_model ({
namespaceName = "namespace2" ,
gradeName = "grade-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 ( 'grade' )
api_result_handler = client.get_grade_model_async ({
namespaceName = "namespace2" ,
gradeName = "grade-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 ;
describeStatuses ステータスの一覧を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 gradeName string ~ 128文字 グレードモデル名 accessToken string ✓ ~ 128文字 ユーザーID pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン limit int ✓ 30 1 ~ 1000 データの取得件数
Result 型 説明 items List<Status> ステータスのリスト nextPageToken string リストの続きを取得するためのページトークン
実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . DescribeStatuses (
& grade . DescribeStatusesRequest {
NamespaceName : pointy . String ( "namespace1" ),
GradeName : pointy . String ( "grade-0001" ),
AccessToken : pointy . String ( "accessToken-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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\DescribeStatusesRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeStatuses (
( new DescribeStatusesRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withGradeName ( "grade-0001" )
-> withAccessToken ( self :: $accessToken0001 )
-> 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.DescribeStatusesRequest ;
import io.gs2.grade.result.DescribeStatusesResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
DescribeStatusesResult result = client . describeStatuses (
new DescribeStatusesRequest ()
. withNamespaceName ( "namespace1" )
. withGradeName ( "grade-0001" )
. withAccessToken ( "accessToken-0001" )
. withPageToken ( null )
. withLimit ( null )
);
List < Status > 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.DescribeStatusesRequest ;
using Gs2.Gs2Grade.Result.DescribeStatusesResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . DescribeStatusesResult > asyncResult = null ;
yield return client . DescribeStatuses (
new Gs2 . Gs2Grade . Request . DescribeStatusesRequest ()
. WithNamespaceName ( "namespace1" )
. WithGradeName ( "grade-0001" )
. WithAccessToken ( "accessToken-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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . describeStatuses (
new Gs2Grade . DescribeStatusesRequest ()
. withNamespaceName ( "namespace1" )
. withGradeName ( "grade-0001" )
. withAccessToken ( "accessToken-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 grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . describe_statuses (
grade . DescribeStatusesRequest ()
. with_namespace_name ( self . hash1 )
. with_grade_name ( 'grade-0001' )
. with_access_token ( self . access_token_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 ( 'grade' )
api_result = client.describe_statuses ({
namespaceName = "namespace1" ,
gradeName = "grade-0001" ,
accessToken = "accessToken-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 ( 'grade' )
api_result_handler = client.describe_statuses_async ({
namespaceName = "namespace1" ,
gradeName = "grade-0001" ,
accessToken = "accessToken-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 ;
describeStatusesByUserId ユーザーIDを指定してステータスの一覧を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 gradeName string ~ 128文字 グレードモデル名 userId string ✓ ~ 128文字 ユーザーID pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン limit int ✓ 30 1 ~ 1000 データの取得件数 timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 型 説明 items List<Status> ステータスのリスト nextPageToken string リストの続きを取得するためのページトークン
実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . DescribeStatusesByUserId (
& grade . DescribeStatusesByUserIdRequest {
NamespaceName : pointy . String ( "namespace1" ),
GradeName : pointy . String ( "grade-0001" ),
UserId : pointy . String ( "user-0001" ),
PageToken : nil ,
Limit : nil ,
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
nextPageToken := result . NextPageToken
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\DescribeStatusesByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeStatusesByUserId (
( new DescribeStatusesByUserIdRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withGradeName ( "grade-0001" )
-> withUserId ( "user-0001" )
-> withPageToken ( null )
-> withLimit ( null )
-> withTimeOffsetToken ( null )
);
$items = $result -> getItems ();
$nextPageToken = $result -> getNextPageToken ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.DescribeStatusesByUserIdRequest ;
import io.gs2.grade.result.DescribeStatusesByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
DescribeStatusesByUserIdResult result = client . describeStatusesByUserId (
new DescribeStatusesByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withGradeName ( "grade-0001" )
. withUserId ( "user-0001" )
. withPageToken ( null )
. withLimit ( null )
. withTimeOffsetToken ( null )
);
List < Status > 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.DescribeStatusesByUserIdRequest ;
using Gs2.Gs2Grade.Result.DescribeStatusesByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . DescribeStatusesByUserIdResult > asyncResult = null ;
yield return client . DescribeStatusesByUserId (
new Gs2 . Gs2Grade . Request . DescribeStatusesByUserIdRequest ()
. WithNamespaceName ( "namespace1" )
. WithGradeName ( "grade-0001" )
. WithUserId ( "user-0001" )
. WithPageToken ( null )
. WithLimit ( null )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var items = result . Items ;
var nextPageToken = result . NextPageToken ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . describeStatusesByUserId (
new Gs2Grade . DescribeStatusesByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withGradeName ( "grade-0001" )
. withUserId ( "user-0001" )
. withPageToken ( null )
. withLimit ( null )
. withTimeOffsetToken ( null )
);
const items = result . getItems ();
const nextPageToken = result . getNextPageToken ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . describe_statuses_by_user_id (
grade . DescribeStatusesByUserIdRequest ()
. with_namespace_name ( self . hash1 )
. with_grade_name ( 'grade-0001' )
. with_user_id ( 'user-0001' )
. with_page_token ( None )
. with_limit ( None )
. with_time_offset_token ( None )
)
items = result . items
next_page_token = result . next_page_token
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.describe_statuses_by_user_id ({
namespaceName = "namespace1" ,
gradeName = "grade-0001" ,
userId = "user-0001" ,
pageToken = nil ,
limit = nil ,
timeOffsetToken = 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 ( 'grade' )
api_result_handler = client.describe_statuses_by_user_id_async ({
namespaceName = "namespace1" ,
gradeName = "grade-0001" ,
userId = "user-0001" ,
pageToken = nil ,
limit = nil ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
getStatus ステータスを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 accessToken string ✓ ~ 128文字 ユーザーID gradeName string ✓ ~ 128文字 グレードモデルの名前 propertyId string ✓ ~ 1024文字 プロパティID
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . GetStatus (
& grade . GetStatusRequest {
NamespaceName : pointy . String ( "namespace1" ),
AccessToken : pointy . String ( "accessToken-0001" ),
GradeName : pointy . String ( "grade-0001" ),
PropertyId : pointy . String ( "property-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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\GetStatusRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getStatus (
( new GetStatusRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withAccessToken ( self :: $accessToken0001 )
-> withGradeName ( "grade-0001" )
-> withPropertyId ( "property-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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.GetStatusRequest ;
import io.gs2.grade.result.GetStatusResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
GetStatusResult result = client . getStatus (
new GetStatusRequest ()
. withNamespaceName ( "namespace1" )
. withAccessToken ( "accessToken-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
);
Status 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.GetStatusRequest ;
using Gs2.Gs2Grade.Result.GetStatusResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . GetStatusResult > asyncResult = null ;
yield return client . GetStatus (
new Gs2 . Gs2Grade . Request . GetStatusRequest ()
. WithNamespaceName ( "namespace1" )
. WithAccessToken ( "accessToken-0001" )
. WithGradeName ( "grade-0001" )
. WithPropertyId ( "property-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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . getStatus (
new Gs2Grade . GetStatusRequest ()
. withNamespaceName ( "namespace1" )
. withAccessToken ( "accessToken-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . get_status (
grade . GetStatusRequest ()
. with_namespace_name ( self . hash1 )
. with_access_token ( self . access_token_0001 )
. with_grade_name ( 'grade-0001' )
. with_property_id ( 'property-0001' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.get_status ({
namespaceName = "namespace1" ,
accessToken = "accessToken-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-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 ( 'grade' )
api_result_handler = client.get_status_async ({
namespaceName = "namespace1" ,
accessToken = "accessToken-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-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 ;
getStatusByUserId ユーザーIDを指定してステータスを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 userId string ✓ ~ 128文字 ユーザーID gradeName string ✓ ~ 128文字 グレードモデルの名前 propertyId string ✓ ~ 1024文字 プロパティ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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . GetStatusByUserId (
& grade . GetStatusByUserIdRequest {
NamespaceName : pointy . String ( "namespace1" ),
UserId : pointy . String ( "user-0001" ),
GradeName : pointy . String ( "grade-0001" ),
PropertyId : pointy . String ( "property-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\GetStatusByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getStatusByUserId (
( new GetStatusByUserIdRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withUserId ( "user-0001" )
-> withGradeName ( "grade-0001" )
-> withPropertyId ( "property-0001" )
-> withTimeOffsetToken ( null )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.GetStatusByUserIdRequest ;
import io.gs2.grade.result.GetStatusByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
GetStatusByUserIdResult result = client . getStatusByUserId (
new GetStatusByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withTimeOffsetToken ( null )
);
Status 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.GetStatusByUserIdRequest ;
using Gs2.Gs2Grade.Result.GetStatusByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . GetStatusByUserIdResult > asyncResult = null ;
yield return client . GetStatusByUserId (
new Gs2 . Gs2Grade . Request . GetStatusByUserIdRequest ()
. WithNamespaceName ( "namespace1" )
. WithUserId ( "user-0001" )
. WithGradeName ( "grade-0001" )
. WithPropertyId ( "property-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . getStatusByUserId (
new Gs2Grade . GetStatusByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . get_status_by_user_id (
grade . GetStatusByUserIdRequest ()
. with_namespace_name ( self . hash1 )
. with_user_id ( 'user-0001' )
. with_grade_name ( 'grade-0001' )
. with_property_id ( 'property-0001' )
. with_time_offset_token ( None )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.get_status_by_user_id ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'grade' )
api_result_handler = client.get_status_by_user_id_async ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
addGradeByUserId ユーザーIDを指定してグレードを加算
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 userId string ✓ ~ 128文字 ユーザーID gradeName string ✓ ~ 128文字 グレードモデルの名前 propertyId string ✓ ~ 1024文字 プロパティID gradeValue long ✓ 0 ~ 9223372036854775805 獲得グレード timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 型 説明 item Status 加算後のステータス experienceNamespaceName string GS2-Experience ネームスペース名 experienceStatus Status ランクキャップ更新後の GS2-Experience ステータス
実装例
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . AddGradeByUserId (
& grade . AddGradeByUserIdRequest {
NamespaceName : pointy . String ( "namespace1" ),
UserId : pointy . String ( "user-0001" ),
GradeName : pointy . String ( "grade-0001" ),
PropertyId : pointy . String ( "property-0001" ),
GradeValue : pointy . Int64 ( 10 ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
experienceNamespaceName := result . ExperienceNamespaceName
experienceStatus := result . ExperienceStatus
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\AddGradeByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> addGradeByUserId (
( new AddGradeByUserIdRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withUserId ( "user-0001" )
-> withGradeName ( "grade-0001" )
-> withPropertyId ( "property-0001" )
-> withGradeValue ( 10 )
-> withTimeOffsetToken ( null )
);
$item = $result -> getItem ();
$experienceNamespaceName = $result -> getExperienceNamespaceName ();
$experienceStatus = $result -> getExperienceStatus ();
} 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.AddGradeByUserIdRequest ;
import io.gs2.grade.result.AddGradeByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
AddGradeByUserIdResult result = client . addGradeByUserId (
new AddGradeByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withGradeValue ( 10L )
. withTimeOffsetToken ( null )
);
Status item = result . getItem ();
String experienceNamespaceName = result . getExperienceNamespaceName ();
Status experienceStatus = result . getExperienceStatus ();
} 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.AddGradeByUserIdRequest ;
using Gs2.Gs2Grade.Result.AddGradeByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . AddGradeByUserIdResult > asyncResult = null ;
yield return client . AddGradeByUserId (
new Gs2 . Gs2Grade . Request . AddGradeByUserIdRequest ()
. WithNamespaceName ( "namespace1" )
. WithUserId ( "user-0001" )
. WithGradeName ( "grade-0001" )
. WithPropertyId ( "property-0001" )
. WithGradeValue ( 10L )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
var experienceNamespaceName = result . ExperienceNamespaceName ;
var experienceStatus = result . ExperienceStatus ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . addGradeByUserId (
new Gs2Grade . AddGradeByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withGradeValue ( 10 )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
const experienceNamespaceName = result . getExperienceNamespaceName ();
const experienceStatus = result . getExperienceStatus ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . add_grade_by_user_id (
grade . AddGradeByUserIdRequest ()
. with_namespace_name ( self . hash1 )
. with_user_id ( 'user-0001' )
. with_grade_name ( 'grade-0001' )
. with_property_id ( 'property-0001' )
. with_grade_value ( 10 )
. with_time_offset_token ( None )
)
item = result . item
experience_namespace_name = result . experience_namespace_name
experience_status = result . experience_status
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.add_grade_by_user_id ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
gradeValue = 10 ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
client = gs2 ( 'grade' )
api_result_handler = client.add_grade_by_user_id_async ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
gradeValue = 10 ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
subGrade グレードを減算
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 accessToken string ✓ ~ 128文字 ユーザーID gradeName string ✓ ~ 128文字 グレードモデルの名前 propertyId string ✓ ~ 1024文字 プロパティID gradeValue long ✓ 0 ~ 9223372036854775805 失うグレード
Result 型 説明 item Status 減算後のステータス experienceNamespaceName string GS2-Experience ネームスペース名 experienceStatus Status ランクキャップ更新後の GS2-Experience ステータス
実装例
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . SubGrade (
& grade . SubGradeRequest {
NamespaceName : pointy . String ( "namespace1" ),
AccessToken : pointy . String ( "accessToken-0001" ),
GradeName : pointy . String ( "grade-0001" ),
PropertyId : pointy . String ( "property-0001" ),
GradeValue : pointy . Int64 ( 10 ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
experienceNamespaceName := result . ExperienceNamespaceName
experienceStatus := result . ExperienceStatus
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\SubGradeRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> subGrade (
( new SubGradeRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withAccessToken ( self :: $accessToken0001 )
-> withGradeName ( "grade-0001" )
-> withPropertyId ( "property-0001" )
-> withGradeValue ( 10 )
);
$item = $result -> getItem ();
$experienceNamespaceName = $result -> getExperienceNamespaceName ();
$experienceStatus = $result -> getExperienceStatus ();
} 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.SubGradeRequest ;
import io.gs2.grade.result.SubGradeResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
SubGradeResult result = client . subGrade (
new SubGradeRequest ()
. withNamespaceName ( "namespace1" )
. withAccessToken ( "accessToken-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withGradeValue ( 10L )
);
Status item = result . getItem ();
String experienceNamespaceName = result . getExperienceNamespaceName ();
Status experienceStatus = result . getExperienceStatus ();
} 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.SubGradeRequest ;
using Gs2.Gs2Grade.Result.SubGradeResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . SubGradeResult > asyncResult = null ;
yield return client . SubGrade (
new Gs2 . Gs2Grade . Request . SubGradeRequest ()
. WithNamespaceName ( "namespace1" )
. WithAccessToken ( "accessToken-0001" )
. WithGradeName ( "grade-0001" )
. WithPropertyId ( "property-0001" )
. WithGradeValue ( 10L ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
var experienceNamespaceName = result . ExperienceNamespaceName ;
var experienceStatus = result . ExperienceStatus ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . subGrade (
new Gs2Grade . SubGradeRequest ()
. withNamespaceName ( "namespace1" )
. withAccessToken ( "accessToken-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withGradeValue ( 10 )
);
const item = result . getItem ();
const experienceNamespaceName = result . getExperienceNamespaceName ();
const experienceStatus = result . getExperienceStatus ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . sub_grade (
grade . SubGradeRequest ()
. with_namespace_name ( self . hash1 )
. with_access_token ( self . access_token_0001 )
. with_grade_name ( 'grade-0001' )
. with_property_id ( 'property-0001' )
. with_grade_value ( 10 )
)
item = result . item
experience_namespace_name = result . experience_namespace_name
experience_status = result . experience_status
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.sub_grade ({
namespaceName = "namespace1" ,
accessToken = "accessToken-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
gradeValue = 10 ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
client = gs2 ( 'grade' )
api_result_handler = client.sub_grade_async ({
namespaceName = "namespace1" ,
accessToken = "accessToken-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
gradeValue = 10 ,
})
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 ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
subGradeByUserId ユーザーIDを指定してグレードを減算
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 userId string ✓ ~ 128文字 ユーザーID gradeName string ✓ ~ 128文字 グレードモデルの名前 propertyId string ✓ ~ 1024文字 プロパティID gradeValue long ✓ 0 ~ 9223372036854775805 失うグレード timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 型 説明 item Status 減算後のステータス experienceNamespaceName string GS2-Experience ネームスペース名 experienceStatus Status ランクキャップ更新後の GS2-Experience ステータス
実装例
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . SubGradeByUserId (
& grade . SubGradeByUserIdRequest {
NamespaceName : pointy . String ( "namespace1" ),
UserId : pointy . String ( "user-0001" ),
GradeName : pointy . String ( "grade-0001" ),
PropertyId : pointy . String ( "property-0001" ),
GradeValue : pointy . Int64 ( 10 ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
experienceNamespaceName := result . ExperienceNamespaceName
experienceStatus := result . ExperienceStatus
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\SubGradeByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> subGradeByUserId (
( new SubGradeByUserIdRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withUserId ( "user-0001" )
-> withGradeName ( "grade-0001" )
-> withPropertyId ( "property-0001" )
-> withGradeValue ( 10 )
-> withTimeOffsetToken ( null )
);
$item = $result -> getItem ();
$experienceNamespaceName = $result -> getExperienceNamespaceName ();
$experienceStatus = $result -> getExperienceStatus ();
} 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.SubGradeByUserIdRequest ;
import io.gs2.grade.result.SubGradeByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
SubGradeByUserIdResult result = client . subGradeByUserId (
new SubGradeByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withGradeValue ( 10L )
. withTimeOffsetToken ( null )
);
Status item = result . getItem ();
String experienceNamespaceName = result . getExperienceNamespaceName ();
Status experienceStatus = result . getExperienceStatus ();
} 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.SubGradeByUserIdRequest ;
using Gs2.Gs2Grade.Result.SubGradeByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . SubGradeByUserIdResult > asyncResult = null ;
yield return client . SubGradeByUserId (
new Gs2 . Gs2Grade . Request . SubGradeByUserIdRequest ()
. WithNamespaceName ( "namespace1" )
. WithUserId ( "user-0001" )
. WithGradeName ( "grade-0001" )
. WithPropertyId ( "property-0001" )
. WithGradeValue ( 10L )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
var experienceNamespaceName = result . ExperienceNamespaceName ;
var experienceStatus = result . ExperienceStatus ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . subGradeByUserId (
new Gs2Grade . SubGradeByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withGradeValue ( 10 )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
const experienceNamespaceName = result . getExperienceNamespaceName ();
const experienceStatus = result . getExperienceStatus ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . sub_grade_by_user_id (
grade . SubGradeByUserIdRequest ()
. with_namespace_name ( self . hash1 )
. with_user_id ( 'user-0001' )
. with_grade_name ( 'grade-0001' )
. with_property_id ( 'property-0001' )
. with_grade_value ( 10 )
. with_time_offset_token ( None )
)
item = result . item
experience_namespace_name = result . experience_namespace_name
experience_status = result . experience_status
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.sub_grade_by_user_id ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
gradeValue = 10 ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
client = gs2 ( 'grade' )
api_result_handler = client.sub_grade_by_user_id_async ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
gradeValue = 10 ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
setGradeByUserId 累計獲得グレードを設定
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 userId string ✓ ~ 128文字 ユーザーID gradeName string ✓ ~ 128文字 グレードモデルの名前 propertyId string ✓ ~ 1024文字 プロパティID gradeValue long ✓ 1 1 ~ 9223372036854775805 現在のグレード timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 型 説明 item Status 更新後のステータス old Status 更新前のステータス experienceNamespaceName string GS2-Experience ネームスペース名 experienceStatus Status ランクキャップ更新後の GS2-Experience ステータス
実装例
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . SetGradeByUserId (
& grade . SetGradeByUserIdRequest {
NamespaceName : pointy . String ( "namespace1" ),
UserId : pointy . String ( "user-0001" ),
GradeName : pointy . String ( "grade-0001" ),
PropertyId : pointy . String ( "property-0001" ),
GradeValue : pointy . Int64 ( 100 ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
old := result . Old
experienceNamespaceName := result . ExperienceNamespaceName
experienceStatus := result . ExperienceStatus
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\SetGradeByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> setGradeByUserId (
( new SetGradeByUserIdRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withUserId ( "user-0001" )
-> withGradeName ( "grade-0001" )
-> withPropertyId ( "property-0001" )
-> withGradeValue ( 100 )
-> withTimeOffsetToken ( null )
);
$item = $result -> getItem ();
$old = $result -> getOld ();
$experienceNamespaceName = $result -> getExperienceNamespaceName ();
$experienceStatus = $result -> getExperienceStatus ();
} 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.SetGradeByUserIdRequest ;
import io.gs2.grade.result.SetGradeByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
SetGradeByUserIdResult result = client . setGradeByUserId (
new SetGradeByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withGradeValue ( 100L )
. withTimeOffsetToken ( null )
);
Status item = result . getItem ();
Status old = result . getOld ();
String experienceNamespaceName = result . getExperienceNamespaceName ();
Status experienceStatus = result . getExperienceStatus ();
} 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.SetGradeByUserIdRequest ;
using Gs2.Gs2Grade.Result.SetGradeByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . SetGradeByUserIdResult > asyncResult = null ;
yield return client . SetGradeByUserId (
new Gs2 . Gs2Grade . Request . SetGradeByUserIdRequest ()
. WithNamespaceName ( "namespace1" )
. WithUserId ( "user-0001" )
. WithGradeName ( "grade-0001" )
. WithPropertyId ( "property-0001" )
. WithGradeValue ( 100L )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
var old = result . Old ;
var experienceNamespaceName = result . ExperienceNamespaceName ;
var experienceStatus = result . ExperienceStatus ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . setGradeByUserId (
new Gs2Grade . SetGradeByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withGradeValue ( 100 )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
const old = result . getOld ();
const experienceNamespaceName = result . getExperienceNamespaceName ();
const experienceStatus = result . getExperienceStatus ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . set_grade_by_user_id (
grade . SetGradeByUserIdRequest ()
. with_namespace_name ( self . hash1 )
. with_user_id ( 'user-0001' )
. with_grade_name ( 'grade-0001' )
. with_property_id ( 'property-0001' )
. with_grade_value ( 100 )
. with_time_offset_token ( None )
)
item = result . item
old = result . old
experience_namespace_name = result . experience_namespace_name
experience_status = result . experience_status
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.set_grade_by_user_id ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
gradeValue = 100 ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
old = result.old ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
client = gs2 ( 'grade' )
api_result_handler = client.set_grade_by_user_id_async ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
gradeValue = 100 ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
old = result.old ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
applyRankCap GS2-Experience にランクキャップを適用
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 accessToken string ✓ ~ 128文字 ユーザーID gradeName string ✓ ~ 128文字 グレードモデルの名前 propertyId string ✓ ~ 1024文字 プロパティID
Result 型 説明 item Status ステータス experienceNamespaceName string GS2-Experience ネームスペース名 experienceStatus Status ランクキャップ更新後の GS2-Experience ステータス
実装例
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . ApplyRankCap (
& grade . ApplyRankCapRequest {
NamespaceName : pointy . String ( "namespace1" ),
AccessToken : pointy . String ( "accessToken-0001" ),
GradeName : pointy . String ( "grade-0001" ),
PropertyId : pointy . String ( "property-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
experienceNamespaceName := result . ExperienceNamespaceName
experienceStatus := result . ExperienceStatus
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\ApplyRankCapRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> applyRankCap (
( new ApplyRankCapRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withAccessToken ( self :: $accessToken0001 )
-> withGradeName ( "grade-0001" )
-> withPropertyId ( "property-0001" )
);
$item = $result -> getItem ();
$experienceNamespaceName = $result -> getExperienceNamespaceName ();
$experienceStatus = $result -> getExperienceStatus ();
} 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.ApplyRankCapRequest ;
import io.gs2.grade.result.ApplyRankCapResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
ApplyRankCapResult result = client . applyRankCap (
new ApplyRankCapRequest ()
. withNamespaceName ( "namespace1" )
. withAccessToken ( "accessToken-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
);
Status item = result . getItem ();
String experienceNamespaceName = result . getExperienceNamespaceName ();
Status experienceStatus = result . getExperienceStatus ();
} 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.ApplyRankCapRequest ;
using Gs2.Gs2Grade.Result.ApplyRankCapResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . ApplyRankCapResult > asyncResult = null ;
yield return client . ApplyRankCap (
new Gs2 . Gs2Grade . Request . ApplyRankCapRequest ()
. WithNamespaceName ( "namespace1" )
. WithAccessToken ( "accessToken-0001" )
. WithGradeName ( "grade-0001" )
. WithPropertyId ( "property-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
var experienceNamespaceName = result . ExperienceNamespaceName ;
var experienceStatus = result . ExperienceStatus ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . applyRankCap (
new Gs2Grade . ApplyRankCapRequest ()
. withNamespaceName ( "namespace1" )
. withAccessToken ( "accessToken-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
);
const item = result . getItem ();
const experienceNamespaceName = result . getExperienceNamespaceName ();
const experienceStatus = result . getExperienceStatus ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . apply_rank_cap (
grade . ApplyRankCapRequest ()
. with_namespace_name ( self . hash1 )
. with_access_token ( self . access_token_0001 )
. with_grade_name ( 'grade-0001' )
. with_property_id ( 'property-0001' )
)
item = result . item
experience_namespace_name = result . experience_namespace_name
experience_status = result . experience_status
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.apply_rank_cap ({
namespaceName = "namespace1" ,
accessToken = "accessToken-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
client = gs2 ( 'grade' )
api_result_handler = client.apply_rank_cap_async ({
namespaceName = "namespace1" ,
accessToken = "accessToken-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-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 ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
applyRankCapByUserId ユーザーIDを指定して GS2-Experience にランクキャップを適用
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 userId string ✓ ~ 128文字 ユーザーID gradeName string ✓ ~ 128文字 グレードモデルの名前 propertyId string ✓ ~ 1024文字 プロパティID timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 型 説明 item Status ステータス experienceNamespaceName string GS2-Experience ネームスペース名 experienceStatus Status ランクキャップ更新後の GS2-Experience ステータス
実装例
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . ApplyRankCapByUserId (
& grade . ApplyRankCapByUserIdRequest {
NamespaceName : pointy . String ( "namespace1" ),
UserId : pointy . String ( "user-0001" ),
GradeName : pointy . String ( "grade-0001" ),
PropertyId : pointy . String ( "property-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
experienceNamespaceName := result . ExperienceNamespaceName
experienceStatus := result . ExperienceStatus
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\ApplyRankCapByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> applyRankCapByUserId (
( new ApplyRankCapByUserIdRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withUserId ( "user-0001" )
-> withGradeName ( "grade-0001" )
-> withPropertyId ( "property-0001" )
-> withTimeOffsetToken ( null )
);
$item = $result -> getItem ();
$experienceNamespaceName = $result -> getExperienceNamespaceName ();
$experienceStatus = $result -> getExperienceStatus ();
} 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.ApplyRankCapByUserIdRequest ;
import io.gs2.grade.result.ApplyRankCapByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
ApplyRankCapByUserIdResult result = client . applyRankCapByUserId (
new ApplyRankCapByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withTimeOffsetToken ( null )
);
Status item = result . getItem ();
String experienceNamespaceName = result . getExperienceNamespaceName ();
Status experienceStatus = result . getExperienceStatus ();
} 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.ApplyRankCapByUserIdRequest ;
using Gs2.Gs2Grade.Result.ApplyRankCapByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . ApplyRankCapByUserIdResult > asyncResult = null ;
yield return client . ApplyRankCapByUserId (
new Gs2 . Gs2Grade . Request . ApplyRankCapByUserIdRequest ()
. WithNamespaceName ( "namespace1" )
. WithUserId ( "user-0001" )
. WithGradeName ( "grade-0001" )
. WithPropertyId ( "property-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
var experienceNamespaceName = result . ExperienceNamespaceName ;
var experienceStatus = result . ExperienceStatus ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . applyRankCapByUserId (
new Gs2Grade . ApplyRankCapByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
const experienceNamespaceName = result . getExperienceNamespaceName ();
const experienceStatus = result . getExperienceStatus ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . apply_rank_cap_by_user_id (
grade . ApplyRankCapByUserIdRequest ()
. with_namespace_name ( self . hash1 )
. with_user_id ( 'user-0001' )
. with_grade_name ( 'grade-0001' )
. with_property_id ( 'property-0001' )
. with_time_offset_token ( None )
)
item = result . item
experience_namespace_name = result . experience_namespace_name
experience_status = result . experience_status
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.apply_rank_cap_by_user_id ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
client = gs2 ( 'grade' )
api_result_handler = client.apply_rank_cap_by_user_id_async ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
deleteStatusByUserId ステータスを削除
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 userId string ✓ ~ 128文字 ユーザーID gradeName string ✓ ~ 128文字 グレードモデルの名前 propertyId string ✓ ~ 1024文字 プロパティ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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . DeleteStatusByUserId (
& grade . DeleteStatusByUserIdRequest {
NamespaceName : pointy . String ( "namespace1" ),
UserId : pointy . String ( "user-0001" ),
GradeName : pointy . String ( "grade-0001" ),
PropertyId : pointy . String ( "property-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\DeleteStatusByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> deleteStatusByUserId (
( new DeleteStatusByUserIdRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withUserId ( "user-0001" )
-> withGradeName ( "grade-0001" )
-> withPropertyId ( "property-0001" )
-> withTimeOffsetToken ( null )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.DeleteStatusByUserIdRequest ;
import io.gs2.grade.result.DeleteStatusByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
DeleteStatusByUserIdResult result = client . deleteStatusByUserId (
new DeleteStatusByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withTimeOffsetToken ( null )
);
Status 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.DeleteStatusByUserIdRequest ;
using Gs2.Gs2Grade.Result.DeleteStatusByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . DeleteStatusByUserIdResult > asyncResult = null ;
yield return client . DeleteStatusByUserId (
new Gs2 . Gs2Grade . Request . DeleteStatusByUserIdRequest ()
. WithNamespaceName ( "namespace1" )
. WithUserId ( "user-0001" )
. WithGradeName ( "grade-0001" )
. WithPropertyId ( "property-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . deleteStatusByUserId (
new Gs2Grade . DeleteStatusByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . delete_status_by_user_id (
grade . DeleteStatusByUserIdRequest ()
. with_namespace_name ( self . hash1 )
. with_user_id ( 'user-0001' )
. with_grade_name ( 'grade-0001' )
. with_property_id ( 'property-0001' )
. with_time_offset_token ( None )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.delete_status_by_user_id ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'grade' )
api_result_handler = client.delete_status_by_user_id_async ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
verifyGrade グレードを検証
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 accessToken string ✓ ~ 128文字 ユーザーID gradeName string ✓ ~ 128文字 グレードモデルの名前 verifyType enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } ✓ ~ 128文字 検証の種類 propertyId string ✓ ~ 1024文字 プロパティID gradeValue long ✓ 1 1 ~ 9223372036854775805 現在のグレード multiplyValueSpecifyingQuantity bool ✓ false 数量指定した際に、検証に使用する値も乗算するか
verifyType に指定する列挙型の定義 定義 説明 less グレードが指定値未満であること lessEqual グレードが指定値以下であること greater グレードが指定値超過であること greaterEqual グレードが指定値以上であること equal グレードが指定値と一致すること notEqual グレードが指定値と一致しないこと
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . VerifyGrade (
& grade . VerifyGradeRequest {
NamespaceName : pointy . String ( "namespace1" ),
AccessToken : pointy . String ( "accessToken-0001" ),
GradeName : pointy . String ( "grade-0001" ),
VerifyType : pointy . String ( "less" ),
PropertyId : pointy . String ( "property-0001" ),
GradeValue : pointy . Int64 ( 2 ),
MultiplyValueSpecifyingQuantity : 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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\VerifyGradeRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> verifyGrade (
( new VerifyGradeRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withAccessToken ( self :: $accessToken0001 )
-> withGradeName ( "grade-0001" )
-> withVerifyType ( "less" )
-> withPropertyId ( "property-0001" )
-> withGradeValue ( 2 )
-> withMultiplyValueSpecifyingQuantity ( 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.VerifyGradeRequest ;
import io.gs2.grade.result.VerifyGradeResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
VerifyGradeResult result = client . verifyGrade (
new VerifyGradeRequest ()
. withNamespaceName ( "namespace1" )
. withAccessToken ( "accessToken-0001" )
. withGradeName ( "grade-0001" )
. withVerifyType ( "less" )
. withPropertyId ( "property-0001" )
. withGradeValue ( 2L )
. withMultiplyValueSpecifyingQuantity ( 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.VerifyGradeRequest ;
using Gs2.Gs2Grade.Result.VerifyGradeResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . VerifyGradeResult > asyncResult = null ;
yield return client . VerifyGrade (
new Gs2 . Gs2Grade . Request . VerifyGradeRequest ()
. WithNamespaceName ( "namespace1" )
. WithAccessToken ( "accessToken-0001" )
. WithGradeName ( "grade-0001" )
. WithVerifyType ( "less" )
. WithPropertyId ( "property-0001" )
. WithGradeValue ( 2L )
. WithMultiplyValueSpecifyingQuantity ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . verifyGrade (
new Gs2Grade . VerifyGradeRequest ()
. withNamespaceName ( "namespace1" )
. withAccessToken ( "accessToken-0001" )
. withGradeName ( "grade-0001" )
. withVerifyType ( "less" )
. withPropertyId ( "property-0001" )
. withGradeValue ( 2 )
. withMultiplyValueSpecifyingQuantity ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . verify_grade (
grade . VerifyGradeRequest ()
. with_namespace_name ( self . hash1 )
. with_access_token ( self . access_token_0001 )
. with_grade_name ( 'grade-0001' )
. with_verify_type ( 'less' )
. with_property_id ( 'property-0001' )
. with_grade_value ( 2 )
. with_multiply_value_specifying_quantity ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.verify_grade ({
namespaceName = "namespace1" ,
accessToken = "accessToken-0001" ,
gradeName = "grade-0001" ,
verifyType = "less" ,
propertyId = "property-0001" ,
gradeValue = 2 ,
multiplyValueSpecifyingQuantity = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
client = gs2 ( 'grade' )
api_result_handler = client.verify_grade_async ({
namespaceName = "namespace1" ,
accessToken = "accessToken-0001" ,
gradeName = "grade-0001" ,
verifyType = "less" ,
propertyId = "property-0001" ,
gradeValue = 2 ,
multiplyValueSpecifyingQuantity = 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
verifyGradeByUserId ユーザーIDを指定してグレードを検証
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 userId string ✓ ~ 128文字 ユーザーID gradeName string ✓ ~ 128文字 グレードモデルの名前 verifyType enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } ✓ ~ 128文字 検証の種類 propertyId string ✓ ~ 1024文字 プロパティID gradeValue long ✓ 1 1 ~ 9223372036854775805 現在のグレード multiplyValueSpecifyingQuantity bool ✓ false 数量指定した際に、検証に使用する値も乗算するか timeOffsetToken string ~ 1024文字 タイムオフセットトークン
verifyType に指定する列挙型の定義 定義 説明 less グレードが指定値未満であること lessEqual グレードが指定値以下であること greater グレードが指定値超過であること greaterEqual グレードが指定値以上であること equal グレードが指定値と一致すること notEqual グレードが指定値と一致しないこと
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . VerifyGradeByUserId (
& grade . VerifyGradeByUserIdRequest {
NamespaceName : pointy . String ( "namespace1" ),
UserId : pointy . String ( "user-0001" ),
GradeName : pointy . String ( "grade-0001" ),
VerifyType : pointy . String ( "less" ),
PropertyId : pointy . String ( "property-0001" ),
GradeValue : pointy . Int64 ( 2 ),
MultiplyValueSpecifyingQuantity : nil ,
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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\VerifyGradeByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> verifyGradeByUserId (
( new VerifyGradeByUserIdRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withUserId ( "user-0001" )
-> withGradeName ( "grade-0001" )
-> withVerifyType ( "less" )
-> withPropertyId ( "property-0001" )
-> withGradeValue ( 2 )
-> withMultiplyValueSpecifyingQuantity ( null )
-> 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.VerifyGradeByUserIdRequest ;
import io.gs2.grade.result.VerifyGradeByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
VerifyGradeByUserIdResult result = client . verifyGradeByUserId (
new VerifyGradeByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withVerifyType ( "less" )
. withPropertyId ( "property-0001" )
. withGradeValue ( 2L )
. withMultiplyValueSpecifyingQuantity ( null )
. 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.VerifyGradeByUserIdRequest ;
using Gs2.Gs2Grade.Result.VerifyGradeByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . VerifyGradeByUserIdResult > asyncResult = null ;
yield return client . VerifyGradeByUserId (
new Gs2 . Gs2Grade . Request . VerifyGradeByUserIdRequest ()
. WithNamespaceName ( "namespace1" )
. WithUserId ( "user-0001" )
. WithGradeName ( "grade-0001" )
. WithVerifyType ( "less" )
. WithPropertyId ( "property-0001" )
. WithGradeValue ( 2L )
. WithMultiplyValueSpecifyingQuantity ( null )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . verifyGradeByUserId (
new Gs2Grade . VerifyGradeByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withVerifyType ( "less" )
. withPropertyId ( "property-0001" )
. withGradeValue ( 2 )
. withMultiplyValueSpecifyingQuantity ( null )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . verify_grade_by_user_id (
grade . VerifyGradeByUserIdRequest ()
. with_namespace_name ( self . hash1 )
. with_user_id ( 'user-0001' )
. with_grade_name ( 'grade-0001' )
. with_verify_type ( 'less' )
. with_property_id ( 'property-0001' )
. with_grade_value ( 2 )
. with_multiply_value_specifying_quantity ( None )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.verify_grade_by_user_id ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
verifyType = "less" ,
propertyId = "property-0001" ,
gradeValue = 2 ,
multiplyValueSpecifyingQuantity = nil ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
client = gs2 ( 'grade' )
api_result_handler = client.verify_grade_by_user_id_async ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
verifyType = "less" ,
propertyId = "property-0001" ,
gradeValue = 2 ,
multiplyValueSpecifyingQuantity = nil ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
verifyGradeUpMaterial グレードアップに使用する素材を検証
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 accessToken string ✓ ~ 128文字 ユーザーID gradeName string ✓ ~ 128文字 グレードモデルの名前 verifyType enum { “match”, “notMatch” } ✓ ~ 128文字 検証の種類 propertyId string ✓ ~ 1024文字 プロパティID materialPropertyId string ✓ ~ 1024文字 プロパティID
verifyType に指定する列挙型の定義 定義 説明 match 条件に一致していること notMatch 条件に一致していないこと
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . VerifyGradeUpMaterial (
& grade . VerifyGradeUpMaterialRequest {
NamespaceName : pointy . String ( "namespace1" ),
AccessToken : pointy . String ( "accessToken-0001" ),
GradeName : pointy . String ( "grade-0001" ),
VerifyType : pointy . String ( "match" ),
PropertyId : pointy . String ( "property-0001" ),
MaterialPropertyId : pointy . String ( "property-0002" ),
}
)
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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\VerifyGradeUpMaterialRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> verifyGradeUpMaterial (
( new VerifyGradeUpMaterialRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withAccessToken ( self :: $accessToken0001 )
-> withGradeName ( "grade-0001" )
-> withVerifyType ( "match" )
-> withPropertyId ( "property-0001" )
-> withMaterialPropertyId ( "property-0002" )
);
} 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.VerifyGradeUpMaterialRequest ;
import io.gs2.grade.result.VerifyGradeUpMaterialResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
VerifyGradeUpMaterialResult result = client . verifyGradeUpMaterial (
new VerifyGradeUpMaterialRequest ()
. withNamespaceName ( "namespace1" )
. withAccessToken ( "accessToken-0001" )
. withGradeName ( "grade-0001" )
. withVerifyType ( "match" )
. withPropertyId ( "property-0001" )
. withMaterialPropertyId ( "property-0002" )
);
} 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.VerifyGradeUpMaterialRequest ;
using Gs2.Gs2Grade.Result.VerifyGradeUpMaterialResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . VerifyGradeUpMaterialResult > asyncResult = null ;
yield return client . VerifyGradeUpMaterial (
new Gs2 . Gs2Grade . Request . VerifyGradeUpMaterialRequest ()
. WithNamespaceName ( "namespace1" )
. WithAccessToken ( "accessToken-0001" )
. WithGradeName ( "grade-0001" )
. WithVerifyType ( "match" )
. WithPropertyId ( "property-0001" )
. WithMaterialPropertyId ( "property-0002" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . verifyGradeUpMaterial (
new Gs2Grade . VerifyGradeUpMaterialRequest ()
. withNamespaceName ( "namespace1" )
. withAccessToken ( "accessToken-0001" )
. withGradeName ( "grade-0001" )
. withVerifyType ( "match" )
. withPropertyId ( "property-0001" )
. withMaterialPropertyId ( "property-0002" )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . verify_grade_up_material (
grade . VerifyGradeUpMaterialRequest ()
. with_namespace_name ( self . hash1 )
. with_access_token ( self . access_token_0001 )
. with_grade_name ( 'grade-0001' )
. with_verify_type ( 'match' )
. with_property_id ( 'property-0001' )
. with_material_property_id ( 'property-0002' )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.verify_grade_up_material ({
namespaceName = "namespace1" ,
accessToken = "accessToken-0001" ,
gradeName = "grade-0001" ,
verifyType = "match" ,
propertyId = "property-0001" ,
materialPropertyId = "property-0002" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
client = gs2 ( 'grade' )
api_result_handler = client.verify_grade_up_material_async ({
namespaceName = "namespace1" ,
accessToken = "accessToken-0001" ,
gradeName = "grade-0001" ,
verifyType = "match" ,
propertyId = "property-0001" ,
materialPropertyId = "property-0002" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
verifyGradeUpMaterialByUserId ユーザーIDを指定してグレードアップに使用する素材を検証
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 userId string ✓ ~ 128文字 ユーザーID gradeName string ✓ ~ 128文字 グレードモデルの名前 verifyType enum { “match”, “notMatch” } ✓ ~ 128文字 検証の種類 propertyId string ✓ ~ 1024文字 プロパティID materialPropertyId string ✓ ~ 1024文字 プロパティID timeOffsetToken string ~ 1024文字 タイムオフセットトークン
verifyType に指定する列挙型の定義 定義 説明 match 条件に一致していること notMatch 条件に一致していないこと
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . VerifyGradeUpMaterialByUserId (
& grade . VerifyGradeUpMaterialByUserIdRequest {
NamespaceName : pointy . String ( "namespace1" ),
UserId : pointy . String ( "user-0001" ),
GradeName : pointy . String ( "grade-0001" ),
VerifyType : pointy . String ( "match" ),
PropertyId : pointy . String ( "property-0001" ),
MaterialPropertyId : pointy . String ( "property-0002" ),
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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\VerifyGradeUpMaterialByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> verifyGradeUpMaterialByUserId (
( new VerifyGradeUpMaterialByUserIdRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withUserId ( "user-0001" )
-> withGradeName ( "grade-0001" )
-> withVerifyType ( "match" )
-> withPropertyId ( "property-0001" )
-> withMaterialPropertyId ( "property-0002" )
-> 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.VerifyGradeUpMaterialByUserIdRequest ;
import io.gs2.grade.result.VerifyGradeUpMaterialByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
VerifyGradeUpMaterialByUserIdResult result = client . verifyGradeUpMaterialByUserId (
new VerifyGradeUpMaterialByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withVerifyType ( "match" )
. withPropertyId ( "property-0001" )
. withMaterialPropertyId ( "property-0002" )
. 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.VerifyGradeUpMaterialByUserIdRequest ;
using Gs2.Gs2Grade.Result.VerifyGradeUpMaterialByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . VerifyGradeUpMaterialByUserIdResult > asyncResult = null ;
yield return client . VerifyGradeUpMaterialByUserId (
new Gs2 . Gs2Grade . Request . VerifyGradeUpMaterialByUserIdRequest ()
. WithNamespaceName ( "namespace1" )
. WithUserId ( "user-0001" )
. WithGradeName ( "grade-0001" )
. WithVerifyType ( "match" )
. WithPropertyId ( "property-0001" )
. WithMaterialPropertyId ( "property-0002" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . verifyGradeUpMaterialByUserId (
new Gs2Grade . VerifyGradeUpMaterialByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withVerifyType ( "match" )
. withPropertyId ( "property-0001" )
. withMaterialPropertyId ( "property-0002" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . verify_grade_up_material_by_user_id (
grade . VerifyGradeUpMaterialByUserIdRequest ()
. with_namespace_name ( self . hash1 )
. with_user_id ( 'user-0001' )
. with_grade_name ( 'grade-0001' )
. with_verify_type ( 'match' )
. with_property_id ( 'property-0001' )
. with_material_property_id ( 'property-0002' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.verify_grade_up_material_by_user_id ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
verifyType = "match" ,
propertyId = "property-0001" ,
materialPropertyId = "property-0002" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
client = gs2 ( 'grade' )
api_result_handler = client.verify_grade_up_material_by_user_id_async ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
verifyType = "match" ,
propertyId = "property-0001" ,
materialPropertyId = "property-0002" ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
addGradeByStampSheet 入手アクションとしてグレードの加算を実行
Request 型 有効化条件 必須 デフォルト 値の制限 説明 stampSheet string ✓ ~ 5242880文字 トランザクション keyId string ✓ ~ 1024文字 暗号鍵GRN
Result 型 説明 item Status 加算後のステータス experienceNamespaceName string GS2-Experience ネームスペース名 experienceStatus Status ランクキャップ更新後の GS2-Experience ステータス
実装例
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . AddGradeByStampSheet (
& grade . AddGradeByStampSheetRequest {
StampSheet : pointy . String ( "stampSheet" ),
KeyId : pointy . String ( "key-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
experienceNamespaceName := result . ExperienceNamespaceName
experienceStatus := result . ExperienceStatus
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\AddGradeByStampSheetRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> addGradeByStampSheet (
( new AddGradeByStampSheetRequest ())
-> withStampSheet ( self :: stampSheet )
-> withKeyId ( self :: key - 0001 )
);
$item = $result -> getItem ();
$experienceNamespaceName = $result -> getExperienceNamespaceName ();
$experienceStatus = $result -> getExperienceStatus ();
} 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.AddGradeByStampSheetRequest ;
import io.gs2.grade.result.AddGradeByStampSheetResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
AddGradeByStampSheetResult result = client . addGradeByStampSheet (
new AddGradeByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
Status item = result . getItem ();
String experienceNamespaceName = result . getExperienceNamespaceName ();
Status experienceStatus = result . getExperienceStatus ();
} 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.AddGradeByStampSheetRequest ;
using Gs2.Gs2Grade.Result.AddGradeByStampSheetResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . AddGradeByStampSheetResult > asyncResult = null ;
yield return client . AddGradeByStampSheet (
new Gs2 . Gs2Grade . Request . AddGradeByStampSheetRequest ()
. WithStampSheet ( "stampSheet" )
. WithKeyId ( "key-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
var experienceNamespaceName = result . ExperienceNamespaceName ;
var experienceStatus = result . ExperienceStatus ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . addGradeByStampSheet (
new Gs2Grade . AddGradeByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
const item = result . getItem ();
const experienceNamespaceName = result . getExperienceNamespaceName ();
const experienceStatus = result . getExperienceStatus ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . add_grade_by_stamp_sheet (
grade . AddGradeByStampSheetRequest ()
. with_stamp_sheet ( self . stamp_sheet )
. with_key_id ( self . key1 . key_id )
)
item = result . item
experience_namespace_name = result . experience_namespace_name
experience_status = result . experience_status
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.add_grade_by_stamp_sheet ({
stampSheet = "stampSheet" ,
keyId = "key-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
client = gs2 ( 'grade' )
api_result_handler = client.add_grade_by_stamp_sheet_async ({
stampSheet = "stampSheet" ,
keyId = "key-0001" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
applyRankCapByStampSheet 入手アクションとして GS2-Experience にランクキャップの適用を実行
Request 型 有効化条件 必須 デフォルト 値の制限 説明 stampSheet string ✓ ~ 5242880文字 トランザクション keyId string ✓ ~ 1024文字 暗号鍵GRN
Result 型 説明 item Status 加算後のステータス experienceNamespaceName string GS2-Experience ネームスペース名 experienceStatus Status ランクキャップ更新後の GS2-Experience ステータス
実装例
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . ApplyRankCapByStampSheet (
& grade . ApplyRankCapByStampSheetRequest {
StampSheet : pointy . String ( "stampSheet" ),
KeyId : pointy . String ( "key-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
experienceNamespaceName := result . ExperienceNamespaceName
experienceStatus := result . ExperienceStatus
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\ApplyRankCapByStampSheetRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> applyRankCapByStampSheet (
( new ApplyRankCapByStampSheetRequest ())
-> withStampSheet ( self :: stampSheet )
-> withKeyId ( self :: key - 0001 )
);
$item = $result -> getItem ();
$experienceNamespaceName = $result -> getExperienceNamespaceName ();
$experienceStatus = $result -> getExperienceStatus ();
} 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.ApplyRankCapByStampSheetRequest ;
import io.gs2.grade.result.ApplyRankCapByStampSheetResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
ApplyRankCapByStampSheetResult result = client . applyRankCapByStampSheet (
new ApplyRankCapByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
Status item = result . getItem ();
String experienceNamespaceName = result . getExperienceNamespaceName ();
Status experienceStatus = result . getExperienceStatus ();
} 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.ApplyRankCapByStampSheetRequest ;
using Gs2.Gs2Grade.Result.ApplyRankCapByStampSheetResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . ApplyRankCapByStampSheetResult > asyncResult = null ;
yield return client . ApplyRankCapByStampSheet (
new Gs2 . Gs2Grade . Request . ApplyRankCapByStampSheetRequest ()
. WithStampSheet ( "stampSheet" )
. WithKeyId ( "key-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
var experienceNamespaceName = result . ExperienceNamespaceName ;
var experienceStatus = result . ExperienceStatus ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . applyRankCapByStampSheet (
new Gs2Grade . ApplyRankCapByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
const item = result . getItem ();
const experienceNamespaceName = result . getExperienceNamespaceName ();
const experienceStatus = result . getExperienceStatus ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . apply_rank_cap_by_stamp_sheet (
grade . ApplyRankCapByStampSheetRequest ()
. with_stamp_sheet ( self . stamp_sheet )
. with_key_id ( self . key1 . key_id )
)
item = result . item
experience_namespace_name = result . experience_namespace_name
experience_status = result . experience_status
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.apply_rank_cap_by_stamp_sheet ({
stampSheet = "stampSheet" ,
keyId = "key-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
client = gs2 ( 'grade' )
api_result_handler = client.apply_rank_cap_by_stamp_sheet_async ({
stampSheet = "stampSheet" ,
keyId = "key-0001" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
subGradeByStampTask 消費アクションとしてグレードの減算を実行
Request 型 有効化条件 必須 デフォルト 値の制限 説明 stampTask string ✓ ~ 5242880文字 消費アクション keyId string ✓ ~ 1024文字 暗号鍵GRN
Result 型 説明 item Status 減算後のステータス newContextStack string 消費アクションの実行結果を記録したコンテキスト experienceNamespaceName string GS2-Experience ネームスペース名 experienceStatus Status ランクキャップ更新後の GS2-Experience ステータス
実装例
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . SubGradeByStampTask (
& grade . SubGradeByStampTaskRequest {
StampTask : pointy . String ( "stampTask" ),
KeyId : pointy . String ( "key-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
newContextStack := result . NewContextStack
experienceNamespaceName := result . ExperienceNamespaceName
experienceStatus := result . ExperienceStatus
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\SubGradeByStampTaskRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> subGradeByStampTask (
( new SubGradeByStampTaskRequest ())
-> withStampTask ( self :: stampTask )
-> withKeyId ( self :: key - 0001 )
);
$item = $result -> getItem ();
$newContextStack = $result -> getNewContextStack ();
$experienceNamespaceName = $result -> getExperienceNamespaceName ();
$experienceStatus = $result -> getExperienceStatus ();
} 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.SubGradeByStampTaskRequest ;
import io.gs2.grade.result.SubGradeByStampTaskResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
SubGradeByStampTaskResult result = client . subGradeByStampTask (
new SubGradeByStampTaskRequest ()
. withStampTask ( "stampTask" )
. withKeyId ( "key-0001" )
);
Status item = result . getItem ();
String newContextStack = result . getNewContextStack ();
String experienceNamespaceName = result . getExperienceNamespaceName ();
Status experienceStatus = result . getExperienceStatus ();
} 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.SubGradeByStampTaskRequest ;
using Gs2.Gs2Grade.Result.SubGradeByStampTaskResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . SubGradeByStampTaskResult > asyncResult = null ;
yield return client . SubGradeByStampTask (
new Gs2 . Gs2Grade . Request . SubGradeByStampTaskRequest ()
. WithStampTask ( "stampTask" )
. WithKeyId ( "key-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
var newContextStack = result . NewContextStack ;
var experienceNamespaceName = result . ExperienceNamespaceName ;
var experienceStatus = result . ExperienceStatus ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . subGradeByStampTask (
new Gs2Grade . SubGradeByStampTaskRequest ()
. withStampTask ( "stampTask" )
. withKeyId ( "key-0001" )
);
const item = result . getItem ();
const newContextStack = result . getNewContextStack ();
const experienceNamespaceName = result . getExperienceNamespaceName ();
const experienceStatus = result . getExperienceStatus ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . sub_grade_by_stamp_task (
grade . SubGradeByStampTaskRequest ()
. with_stamp_task ( self . stamp_task )
. with_key_id ( self . key1 . key_id )
)
item = result . item
new_context_stack = result . new_context_stack
experience_namespace_name = result . experience_namespace_name
experience_status = result . experience_status
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.sub_grade_by_stamp_task ({
stampTask = "stampTask" ,
keyId = "key-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
newContextStack = result.newContextStack ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
client = gs2 ( 'grade' )
api_result_handler = client.sub_grade_by_stamp_task_async ({
stampTask = "stampTask" ,
keyId = "key-0001" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
newContextStack = result.newContextStack ;
experienceNamespaceName = result.experienceNamespaceName ;
experienceStatus = result.experienceStatus ;
multiplyAcquireActionsByUserId ユーザーIDを指定してグレードの対象プロパティのグレードに応じてリソースを加算
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 userId string ✓ ~ 128文字 ユーザーID gradeName string ✓ ~ 128文字 グレードモデルの名前 propertyId string ✓ ~ 1024文字 プロパティID rateName string ✓ ~ 128文字 報酬加算テーブル名 acquireActions List<AcquireAction> [] ~ 100 items 入手アクションリスト timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 型 説明 items List<AcquireAction> 報酬 transactionId string 発行されたトランザクションID stampSheet string スタンプシート stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN autoRunStampSheet bool? トランザクションの自動実行が有効か atomicCommit bool? トランザクションをアトミックにコミットするか transaction string 発行されたトランザクション transactionResult TransactionResult トランザクション実行結果
実装例
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . MultiplyAcquireActionsByUserId (
& grade . MultiplyAcquireActionsByUserIdRequest {
NamespaceName : pointy . String ( "namespace1" ),
UserId : pointy . String ( "user-0001" ),
GradeName : pointy . String ( "grade-0001" ),
PropertyId : pointy . String ( "property-0001" ),
RateName : pointy . String ( "rate-0001" ),
AcquireActions : [] grade . AcquireAction {
grade . AcquireAction {
Action : pointy . String ( "Gs2Grade:AddRankCapByUserId" ),
Request : pointy . String ( "{\"namespaceName\": \"namespace-0001\", \"gradeName\": \"character\", \"propertyId\": \"property-0001\", \"userId\": \"#{userId}\", \"rankCapValue\": 1}" ),
},
},
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
transactionId := result . TransactionId
stampSheet := result . StampSheet
stampSheetEncryptionKeyId := result . StampSheetEncryptionKeyId
autoRunStampSheet := result . AutoRunStampSheet
atomicCommit := result . AtomicCommit
transaction := result . Transaction
transactionResult := result . TransactionResult
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\MultiplyAcquireActionsByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> multiplyAcquireActionsByUserId (
( new MultiplyAcquireActionsByUserIdRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withUserId ( "user-0001" )
-> withGradeName ( "grade-0001" )
-> withPropertyId ( "property-0001" )
-> withRateName ( "rate-0001" )
-> withAcquireActions ([
( new AcquireAction ())
-> withAction ( "Gs2Grade:AddRankCapByUserId" )
-> withRequest ( "{ \" namespaceName \" : \" namespace-0001 \" , \" gradeName \" : \" character \" , \" propertyId \" : \" property-0001 \" , \" userId \" : \" #{userId} \" , \" rankCapValue \" : 1}" ),
])
-> withTimeOffsetToken ( null )
);
$items = $result -> getItems ();
$transactionId = $result -> getTransactionId ();
$stampSheet = $result -> getStampSheet ();
$stampSheetEncryptionKeyId = $result -> getStampSheetEncryptionKeyId ();
$autoRunStampSheet = $result -> getAutoRunStampSheet ();
$atomicCommit = $result -> getAtomicCommit ();
$transaction = $result -> getTransaction ();
$transactionResult = $result -> getTransactionResult ();
} 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.MultiplyAcquireActionsByUserIdRequest ;
import io.gs2.grade.result.MultiplyAcquireActionsByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
MultiplyAcquireActionsByUserIdResult result = client . multiplyAcquireActionsByUserId (
new MultiplyAcquireActionsByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withRateName ( "rate-0001" )
. withAcquireActions ( Arrays . asList (
new AcquireAction ()
. withAction ( "Gs2Grade:AddRankCapByUserId" )
. withRequest ( "{\"namespaceName\": \"namespace-0001\", \"gradeName\": \"character\", \"propertyId\": \"property-0001\", \"userId\": \"#{userId}\", \"rankCapValue\": 1}" )
))
. withTimeOffsetToken ( null )
);
List < AcquireAction > items = result . getItems ();
String transactionId = result . getTransactionId ();
String stampSheet = result . getStampSheet ();
String stampSheetEncryptionKeyId = result . getStampSheetEncryptionKeyId ();
boolean autoRunStampSheet = result . getAutoRunStampSheet ();
boolean atomicCommit = result . getAtomicCommit ();
String transaction = result . getTransaction ();
TransactionResult transactionResult = result . getTransactionResult ();
} 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.MultiplyAcquireActionsByUserIdRequest ;
using Gs2.Gs2Grade.Result.MultiplyAcquireActionsByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . MultiplyAcquireActionsByUserIdResult > asyncResult = null ;
yield return client . MultiplyAcquireActionsByUserId (
new Gs2 . Gs2Grade . Request . MultiplyAcquireActionsByUserIdRequest ()
. WithNamespaceName ( "namespace1" )
. WithUserId ( "user-0001" )
. WithGradeName ( "grade-0001" )
. WithPropertyId ( "property-0001" )
. WithRateName ( "rate-0001" )
. WithAcquireActions ( new Gs2 . Core . Model . AcquireAction [] {
new Gs2 . Core . Model . AcquireAction ()
. WithAction ( "Gs2Grade:AddRankCapByUserId" )
. WithRequest ( "{\"namespaceName\": \"namespace-0001\", \"gradeName\": \"character\", \"propertyId\": \"property-0001\", \"userId\": \"#{userId}\", \"rankCapValue\": 1}" ),
})
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var items = result . Items ;
var transactionId = result . TransactionId ;
var stampSheet = result . StampSheet ;
var stampSheetEncryptionKeyId = result . StampSheetEncryptionKeyId ;
var autoRunStampSheet = result . AutoRunStampSheet ;
var atomicCommit = result . AtomicCommit ;
var transaction = result . Transaction ;
var transactionResult = result . TransactionResult ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . multiplyAcquireActionsByUserId (
new Gs2Grade . MultiplyAcquireActionsByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withGradeName ( "grade-0001" )
. withPropertyId ( "property-0001" )
. withRateName ( "rate-0001" )
. withAcquireActions ([
new Gs2Grade . model . AcquireAction ()
. withAction ( "Gs2Grade:AddRankCapByUserId" )
. withRequest ( "{\"namespaceName\": \"namespace-0001\", \"gradeName\": \"character\", \"propertyId\": \"property-0001\", \"userId\": \"#{userId}\", \"rankCapValue\": 1}" ),
])
. withTimeOffsetToken ( null )
);
const items = result . getItems ();
const transactionId = result . getTransactionId ();
const stampSheet = result . getStampSheet ();
const stampSheetEncryptionKeyId = result . getStampSheetEncryptionKeyId ();
const autoRunStampSheet = result . getAutoRunStampSheet ();
const atomicCommit = result . getAtomicCommit ();
const transaction = result . getTransaction ();
const transactionResult = result . getTransactionResult ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . multiply_acquire_actions_by_user_id (
grade . MultiplyAcquireActionsByUserIdRequest ()
. with_namespace_name ( self . hash1 )
. with_user_id ( 'user-0001' )
. with_grade_name ( 'grade-0001' )
. with_property_id ( 'property-0001' )
. with_rate_name ( 'rate-0001' )
. with_acquire_actions ([
grade . AcquireAction ()
. with_action ( 'Gs2Grade:AddRankCapByUserId' )
. with_request ( '{"namespaceName": "namespace-0001", "gradeName": "character", "propertyId": "property-0001", "userId": "# {userId} ", "rankCapValue": 1}' ),
])
. with_time_offset_token ( None )
)
items = result . items
transaction_id = result . transaction_id
stamp_sheet = result . stamp_sheet
stamp_sheet_encryption_key_id = result . stamp_sheet_encryption_key_id
auto_run_stamp_sheet = result . auto_run_stamp_sheet
atomic_commit = result . atomic_commit
transaction = result . transaction
transaction_result = result . transaction_result
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.multiply_acquire_actions_by_user_id ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
rateName = "rate-0001" ,
acquireActions = {
{
action = "Gs2Grade:AddRankCapByUserId" ,
request = "{ \" namespaceName \" : \" namespace-0001 \" , \" gradeName \" : \" character \" , \" propertyId \" : \" property-0001 \" , \" userId \" : \" #{userId} \" , \" rankCapValue \" : 1}" ,
}
},
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
client = gs2 ( 'grade' )
api_result_handler = client.multiply_acquire_actions_by_user_id_async ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
gradeName = "grade-0001" ,
propertyId = "property-0001" ,
rateName = "rate-0001" ,
acquireActions = {
{
action = "Gs2Grade:AddRankCapByUserId" ,
request = "{ \" namespaceName \" : \" namespace-0001 \" , \" gradeName \" : \" character \" , \" propertyId \" : \" property-0001 \" , \" userId \" : \" #{userId} \" , \" rankCapValue \" : 1}" ,
}
},
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
items = result.items ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
multiplyAcquireActionsByStampSheet 入手アクションとしてグレードの対象プロパティのグレードに応じてリソースの加算を実行
Request 型 有効化条件 必須 デフォルト 値の制限 説明 stampSheet string ✓ ~ 5242880文字 トランザクション keyId string ✓ ~ 1024文字 暗号鍵GRN
Result 型 説明 items List<AcquireAction> 報酬 transactionId string 発行されたトランザクションID stampSheet string スタンプシート stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN autoRunStampSheet bool? トランザクションの自動実行が有効か atomicCommit bool? トランザクションをアトミックにコミットするか transaction string 発行されたトランザクション transactionResult TransactionResult トランザクション実行結果
実装例
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . MultiplyAcquireActionsByStampSheet (
& grade . MultiplyAcquireActionsByStampSheetRequest {
StampSheet : pointy . String ( "stampSheet" ),
KeyId : pointy . String ( "key-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
transactionId := result . TransactionId
stampSheet := result . StampSheet
stampSheetEncryptionKeyId := result . StampSheetEncryptionKeyId
autoRunStampSheet := result . AutoRunStampSheet
atomicCommit := result . AtomicCommit
transaction := result . Transaction
transactionResult := result . TransactionResult
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\MultiplyAcquireActionsByStampSheetRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> multiplyAcquireActionsByStampSheet (
( new MultiplyAcquireActionsByStampSheetRequest ())
-> withStampSheet ( self :: stampSheet )
-> withKeyId ( self :: key - 0001 )
);
$items = $result -> getItems ();
$transactionId = $result -> getTransactionId ();
$stampSheet = $result -> getStampSheet ();
$stampSheetEncryptionKeyId = $result -> getStampSheetEncryptionKeyId ();
$autoRunStampSheet = $result -> getAutoRunStampSheet ();
$atomicCommit = $result -> getAtomicCommit ();
$transaction = $result -> getTransaction ();
$transactionResult = $result -> getTransactionResult ();
} 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.MultiplyAcquireActionsByStampSheetRequest ;
import io.gs2.grade.result.MultiplyAcquireActionsByStampSheetResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
MultiplyAcquireActionsByStampSheetResult result = client . multiplyAcquireActionsByStampSheet (
new MultiplyAcquireActionsByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
List < AcquireAction > items = result . getItems ();
String transactionId = result . getTransactionId ();
String stampSheet = result . getStampSheet ();
String stampSheetEncryptionKeyId = result . getStampSheetEncryptionKeyId ();
boolean autoRunStampSheet = result . getAutoRunStampSheet ();
boolean atomicCommit = result . getAtomicCommit ();
String transaction = result . getTransaction ();
TransactionResult transactionResult = result . getTransactionResult ();
} 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.MultiplyAcquireActionsByStampSheetRequest ;
using Gs2.Gs2Grade.Result.MultiplyAcquireActionsByStampSheetResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . MultiplyAcquireActionsByStampSheetResult > asyncResult = null ;
yield return client . MultiplyAcquireActionsByStampSheet (
new Gs2 . Gs2Grade . Request . MultiplyAcquireActionsByStampSheetRequest ()
. WithStampSheet ( "stampSheet" )
. WithKeyId ( "key-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var items = result . Items ;
var transactionId = result . TransactionId ;
var stampSheet = result . StampSheet ;
var stampSheetEncryptionKeyId = result . StampSheetEncryptionKeyId ;
var autoRunStampSheet = result . AutoRunStampSheet ;
var atomicCommit = result . AtomicCommit ;
var transaction = result . Transaction ;
var transactionResult = result . TransactionResult ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . multiplyAcquireActionsByStampSheet (
new Gs2Grade . MultiplyAcquireActionsByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
const items = result . getItems ();
const transactionId = result . getTransactionId ();
const stampSheet = result . getStampSheet ();
const stampSheetEncryptionKeyId = result . getStampSheetEncryptionKeyId ();
const autoRunStampSheet = result . getAutoRunStampSheet ();
const atomicCommit = result . getAtomicCommit ();
const transaction = result . getTransaction ();
const transactionResult = result . getTransactionResult ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . multiply_acquire_actions_by_stamp_sheet (
grade . MultiplyAcquireActionsByStampSheetRequest ()
. with_stamp_sheet ( self . stamp_sheet )
. with_key_id ( self . key1 . key_id )
)
items = result . items
transaction_id = result . transaction_id
stamp_sheet = result . stamp_sheet
stamp_sheet_encryption_key_id = result . stamp_sheet_encryption_key_id
auto_run_stamp_sheet = result . auto_run_stamp_sheet
atomic_commit = result . atomic_commit
transaction = result . transaction
transaction_result = result . transaction_result
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.multiply_acquire_actions_by_stamp_sheet ({
stampSheet = "stampSheet" ,
keyId = "key-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
client = gs2 ( 'grade' )
api_result_handler = client.multiply_acquire_actions_by_stamp_sheet_async ({
stampSheet = "stampSheet" ,
keyId = "key-0001" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
verifyGradeByStampTask 検証アクションとしてグレードの検証を実行
Request 型 有効化条件 必須 デフォルト 値の制限 説明 stampTask string ✓ ~ 5242880文字 検証アクション keyId string ✓ ~ 1024文字 暗号鍵GRN
Result 型 説明 newContextStack string 検証アクションの実行結果を記録したコンテキスト
実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . VerifyGradeByStampTask (
& grade . VerifyGradeByStampTaskRequest {
StampTask : pointy . String ( "stampTask" ),
KeyId : pointy . String ( "key-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
newContextStack := result . NewContextStack
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\VerifyGradeByStampTaskRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> verifyGradeByStampTask (
( new VerifyGradeByStampTaskRequest ())
-> withStampTask ( self :: stampTask )
-> withKeyId ( self :: key - 0001 )
);
$newContextStack = $result -> getNewContextStack ();
} 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.VerifyGradeByStampTaskRequest ;
import io.gs2.grade.result.VerifyGradeByStampTaskResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
VerifyGradeByStampTaskResult result = client . verifyGradeByStampTask (
new VerifyGradeByStampTaskRequest ()
. withStampTask ( "stampTask" )
. withKeyId ( "key-0001" )
);
String newContextStack = result . getNewContextStack ();
} 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.VerifyGradeByStampTaskRequest ;
using Gs2.Gs2Grade.Result.VerifyGradeByStampTaskResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . VerifyGradeByStampTaskResult > asyncResult = null ;
yield return client . VerifyGradeByStampTask (
new Gs2 . Gs2Grade . Request . VerifyGradeByStampTaskRequest ()
. WithStampTask ( "stampTask" )
. WithKeyId ( "key-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var newContextStack = result . NewContextStack ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . verifyGradeByStampTask (
new Gs2Grade . VerifyGradeByStampTaskRequest ()
. withStampTask ( "stampTask" )
. withKeyId ( "key-0001" )
);
const newContextStack = result . getNewContextStack ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . verify_grade_by_stamp_task (
grade . VerifyGradeByStampTaskRequest ()
. with_stamp_task ( self . stamp_task )
. with_key_id ( self . key1 . key_id )
)
new_context_stack = result . new_context_stack
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.verify_grade_by_stamp_task ({
stampTask = "stampTask" ,
keyId = "key-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
newContextStack = result.newContextStack ;
client = gs2 ( 'grade' )
api_result_handler = client.verify_grade_by_stamp_task_async ({
stampTask = "stampTask" ,
keyId = "key-0001" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
newContextStack = result.newContextStack ;
verifyGradeUpMaterialByStampTask 検証アクションとしてグレードアップに使用する素材の検証を実行
Request 型 有効化条件 必須 デフォルト 値の制限 説明 stampTask string ✓ ~ 5242880文字 検証アクション keyId string ✓ ~ 1024文字 暗号鍵GRN
Result 型 説明 newContextStack string 検証アクションの実行結果を記録したコンテキスト
実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . VerifyGradeUpMaterialByStampTask (
& grade . VerifyGradeUpMaterialByStampTaskRequest {
StampTask : pointy . String ( "stampTask" ),
KeyId : pointy . String ( "key-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
newContextStack := result . NewContextStack
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\VerifyGradeUpMaterialByStampTaskRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> verifyGradeUpMaterialByStampTask (
( new VerifyGradeUpMaterialByStampTaskRequest ())
-> withStampTask ( self :: stampTask )
-> withKeyId ( self :: key - 0001 )
);
$newContextStack = $result -> getNewContextStack ();
} 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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.VerifyGradeUpMaterialByStampTaskRequest ;
import io.gs2.grade.result.VerifyGradeUpMaterialByStampTaskResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
VerifyGradeUpMaterialByStampTaskResult result = client . verifyGradeUpMaterialByStampTask (
new VerifyGradeUpMaterialByStampTaskRequest ()
. withStampTask ( "stampTask" )
. withKeyId ( "key-0001" )
);
String newContextStack = result . getNewContextStack ();
} 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.VerifyGradeUpMaterialByStampTaskRequest ;
using Gs2.Gs2Grade.Result.VerifyGradeUpMaterialByStampTaskResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . VerifyGradeUpMaterialByStampTaskResult > asyncResult = null ;
yield return client . VerifyGradeUpMaterialByStampTask (
new Gs2 . Gs2Grade . Request . VerifyGradeUpMaterialByStampTaskRequest ()
. WithStampTask ( "stampTask" )
. WithKeyId ( "key-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var newContextStack = result . NewContextStack ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . verifyGradeUpMaterialByStampTask (
new Gs2Grade . VerifyGradeUpMaterialByStampTaskRequest ()
. withStampTask ( "stampTask" )
. withKeyId ( "key-0001" )
);
const newContextStack = result . getNewContextStack ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . verify_grade_up_material_by_stamp_task (
grade . VerifyGradeUpMaterialByStampTaskRequest ()
. with_stamp_task ( self . stamp_task )
. with_key_id ( self . key1 . key_id )
)
new_context_stack = result . new_context_stack
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.verify_grade_up_material_by_stamp_task ({
stampTask = "stampTask" ,
keyId = "key-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
newContextStack = result.newContextStack ;
client = gs2 ( 'grade' )
api_result_handler = client.verify_grade_up_material_by_stamp_task_async ({
stampTask = "stampTask" ,
keyId = "key-0001" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
newContextStack = result.newContextStack ;
exportMaster 現在有効なグレード設定のマスターデータをエクスポート
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . ExportMaster (
& grade . ExportMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\ExportMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> exportMaster (
( new ExportMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.ExportMasterRequest ;
import io.gs2.grade.result.ExportMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
ExportMasterResult result = client . exportMaster (
new ExportMasterRequest ()
. withNamespaceName ( "namespace1" )
);
CurrentGradeMaster 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.ExportMasterRequest ;
using Gs2.Gs2Grade.Result.ExportMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . ExportMasterResult > asyncResult = null ;
yield return client . ExportMaster (
new Gs2 . Gs2Grade . Request . ExportMasterRequest ()
. WithNamespaceName ( "namespace1" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . exportMaster (
new Gs2Grade . ExportMasterRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . export_master (
grade . ExportMasterRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.export_master ({
namespaceName = "namespace1" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'grade' )
api_result_handler = client.export_master_async ({
namespaceName = "namespace1" ,
})
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 ;
getCurrentGradeMaster 現在有効なグレード設定を取得
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/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . GetCurrentGradeMaster (
& grade . GetCurrentGradeMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\GetCurrentGradeMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getCurrentGradeMaster (
( new GetCurrentGradeMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.GetCurrentGradeMasterRequest ;
import io.gs2.grade.result.GetCurrentGradeMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
GetCurrentGradeMasterResult result = client . getCurrentGradeMaster (
new GetCurrentGradeMasterRequest ()
. withNamespaceName ( "namespace1" )
);
CurrentGradeMaster 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.GetCurrentGradeMasterRequest ;
using Gs2.Gs2Grade.Result.GetCurrentGradeMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . GetCurrentGradeMasterResult > asyncResult = null ;
yield return client . GetCurrentGradeMaster (
new Gs2 . Gs2Grade . Request . GetCurrentGradeMasterRequest ()
. WithNamespaceName ( "namespace1" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . getCurrentGradeMaster (
new Gs2Grade . GetCurrentGradeMasterRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . get_current_grade_master (
grade . GetCurrentGradeMasterRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.get_current_grade_master ({
namespaceName = "namespace1" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'grade' )
api_result_handler = client.get_current_grade_master_async ({
namespaceName = "namespace1" ,
})
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 ;
updateCurrentGradeMaster 現在有効なグレード設定を更新
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 settings string ✓ ~ 5242880文字 マスターデータ
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . UpdateCurrentGradeMaster (
& grade . UpdateCurrentGradeMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
Settings : pointy . String ( "{\"version\": \"2023-12-25\", \"gradeModels\": [{\"name\": \"grade-0001\", \"metadata\": \"GRADE_0001\", \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\", \"defaultGrades\": [{\"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:r-.*\", \"defaultGradeValue\": 2}, {\"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:sr-.*\", \"defaultGradeValue\": 3}, {\"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*\", \"defaultGradeValue\": 4}], \"gradeEntries\": [{\"rankCapValue\": 50, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}, {\"rankCapValue\": 60, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}, {\"rankCapValue\": 70, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}, {\"rankCapValue\": 80, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}]}]}" ),
}
)
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\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\UpdateCurrentGradeMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateCurrentGradeMaster (
( new UpdateCurrentGradeMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withSettings ( '{"version": "2023-12-25", "gradeModels": [{"name": "grade-0001", "metadata": "GRADE_0001", "experienceModelId": "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001", "defaultGrades": [{"propertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:r-.*", "defaultGradeValue": 2}, {"propertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:sr-.*", "defaultGradeValue": 3}, {"propertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*", "defaultGradeValue": 4}], "gradeEntries": [{"rankCapValue": 50, "propertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*", "gradeUpPropertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*"}, {"rankCapValue": 60, "propertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*", "gradeUpPropertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*"}, {"rankCapValue": 70, "propertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*", "gradeUpPropertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*"}, {"rankCapValue": 80, "propertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*", "gradeUpPropertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*"}]}]}' )
);
$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.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.UpdateCurrentGradeMasterRequest ;
import io.gs2.grade.result.UpdateCurrentGradeMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
UpdateCurrentGradeMasterResult result = client . updateCurrentGradeMaster (
new UpdateCurrentGradeMasterRequest ()
. withNamespaceName ( "namespace1" )
. withSettings ( "{\"version\": \"2023-12-25\", \"gradeModels\": [{\"name\": \"grade-0001\", \"metadata\": \"GRADE_0001\", \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\", \"defaultGrades\": [{\"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:r-.*\", \"defaultGradeValue\": 2}, {\"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:sr-.*\", \"defaultGradeValue\": 3}, {\"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*\", \"defaultGradeValue\": 4}], \"gradeEntries\": [{\"rankCapValue\": 50, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}, {\"rankCapValue\": 60, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}, {\"rankCapValue\": 70, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}, {\"rankCapValue\": 80, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}]}]}" )
);
CurrentGradeMaster 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.UpdateCurrentGradeMasterRequest ;
using Gs2.Gs2Grade.Result.UpdateCurrentGradeMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . UpdateCurrentGradeMasterResult > asyncResult = null ;
yield return client . UpdateCurrentGradeMaster (
new Gs2 . Gs2Grade . Request . UpdateCurrentGradeMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithSettings ( "{\"version\": \"2023-12-25\", \"gradeModels\": [{\"name\": \"grade-0001\", \"metadata\": \"GRADE_0001\", \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\", \"defaultGrades\": [{\"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:r-.*\", \"defaultGradeValue\": 2}, {\"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:sr-.*\", \"defaultGradeValue\": 3}, {\"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*\", \"defaultGradeValue\": 4}], \"gradeEntries\": [{\"rankCapValue\": 50, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}, {\"rankCapValue\": 60, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}, {\"rankCapValue\": 70, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}, {\"rankCapValue\": 80, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}]}]}" ),
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 Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . updateCurrentGradeMaster (
new Gs2Grade . UpdateCurrentGradeMasterRequest ()
. withNamespaceName ( "namespace1" )
. withSettings ( "{\"version\": \"2023-12-25\", \"gradeModels\": [{\"name\": \"grade-0001\", \"metadata\": \"GRADE_0001\", \"experienceModelId\": \"grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001\", \"defaultGrades\": [{\"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:r-.*\", \"defaultGradeValue\": 2}, {\"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:sr-.*\", \"defaultGradeValue\": 3}, {\"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*\", \"defaultGradeValue\": 4}], \"gradeEntries\": [{\"rankCapValue\": 50, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}, {\"rankCapValue\": 60, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}, {\"rankCapValue\": 70, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}, {\"rankCapValue\": 80, \"propertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*\", \"gradeUpPropertyIdRegex\": \"grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*\"}]}]}" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . update_current_grade_master (
grade . UpdateCurrentGradeMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_settings ( '{"version": "2023-12-25", "gradeModels": [{"name": "grade-0001", "metadata": "GRADE_0001", "experienceModelId": "grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001", "defaultGrades": [{"propertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:r-.*", "defaultGradeValue": 2}, {"propertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:sr-.*", "defaultGradeValue": 3}, {"propertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.*", "defaultGradeValue": 4}], "gradeEntries": [{"rankCapValue": 50, "propertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*", "gradeUpPropertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*"}, {"rankCapValue": 60, "propertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*", "gradeUpPropertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*"}, {"rankCapValue": 70, "propertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*", "gradeUpPropertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*"}, {"rankCapValue": 80, "propertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.*", "gradeUpPropertyIdRegex": "grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.*"}]}]}' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.update_current_grade_master ({
namespaceName = "namespace1" ,
settings = "{ \" version \" : \" 2023-12-25 \" , \" gradeModels \" : [{ \" name \" : \" grade-0001 \" , \" metadata \" : \" GRADE_0001 \" , \" experienceModelId \" : \" grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001 \" , \" defaultGrades \" : [{ \" propertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:r-.* \" , \" defaultGradeValue \" : 2}, { \" propertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:sr-.* \" , \" defaultGradeValue \" : 3}, { \" propertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.* \" , \" defaultGradeValue \" : 4}], \" gradeEntries \" : [{ \" rankCapValue \" : 50, \" propertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.* \" , \" gradeUpPropertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.* \" }, { \" rankCapValue \" : 60, \" propertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.* \" , \" gradeUpPropertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.* \" }, { \" rankCapValue \" : 70, \" propertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.* \" , \" gradeUpPropertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.* \" }, { \" rankCapValue \" : 80, \" propertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.* \" , \" gradeUpPropertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.* \" }]}]}" ,
})
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 ( 'grade' )
api_result_handler = client.update_current_grade_master_async ({
namespaceName = "namespace1" ,
settings = "{ \" version \" : \" 2023-12-25 \" , \" gradeModels \" : [{ \" name \" : \" grade-0001 \" , \" metadata \" : \" GRADE_0001 \" , \" experienceModelId \" : \" grn:gs2:ap-northeast-1:YourOwnerId:experience:namespace-0001:model:experience-0001 \" , \" defaultGrades \" : [{ \" propertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:r-.* \" , \" defaultGradeValue \" : 2}, { \" propertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:sr-.* \" , \" defaultGradeValue \" : 3}, { \" propertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:ssr-.* \" , \" defaultGradeValue \" : 4}], \" gradeEntries \" : [{ \" rankCapValue \" : 50, \" propertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.* \" , \" gradeUpPropertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.* \" }, { \" rankCapValue \" : 60, \" propertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.* \" , \" gradeUpPropertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.* \" }, { \" rankCapValue \" : 70, \" propertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.* \" , \" gradeUpPropertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.* \" }, { \" rankCapValue \" : 80, \" propertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:(.*):.* \" , \" gradeUpPropertyIdRegex \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inventory:namespace-0001:inventory:inventory-0001:item:$1:.* \" }]}]}" ,
})
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 ;
updateCurrentGradeMasterFromGitHub 現在有効なグレード設定を更新
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 checkoutSetting GitHubCheckoutSetting ✓ GitHubからマスターデータをチェックアウトしてくる設定
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/grade"
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 := grade . Gs2GradeRestClient {
Session : & session ,
}
result , err := client . UpdateCurrentGradeMasterFromGitHub (
& grade . UpdateCurrentGradeMasterFromGitHubRequest {
NamespaceName : pointy . String ( "namespace1" ),
CheckoutSetting : & grade . GitHubCheckoutSetting {
ApiKeyId : pointy . String ( "$gitHubApiKey1.apiKeyId" ),
RepositoryName : pointy . String ( "gs2io/master-data" ),
SourcePath : pointy . String ( "path/to/file.json" ),
ReferenceType : pointy . String ( "branch" ),
BranchName : pointy . String ( "develop" ),
},
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Grade\Gs2GradeRestClient ;
use Gs2\Grade\Request\UpdateCurrentGradeMasterFromGitHubRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateCurrentGradeMasterFromGitHub (
( new UpdateCurrentGradeMasterFromGitHubRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withCheckoutSetting (( new GitHubCheckoutSetting ())
-> withApiKeyId ( self :: $gitHubApiKey1 . apiKeyId )
-> withRepositoryName ( "gs2io/master-data" )
-> withSourcePath ( "path/to/file.json" )
-> withReferenceType ( "branch" )
-> withBranchName ( "develop" )
)
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.grade.rest.Gs2GradeRestClient ;
import io.gs2.grade.request.UpdateCurrentGradeMasterFromGitHubRequest ;
import io.gs2.grade.result.UpdateCurrentGradeMasterFromGitHubResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2GradeRestClient client = new Gs2GradeRestClient ( session );
try {
UpdateCurrentGradeMasterFromGitHubResult result = client . updateCurrentGradeMasterFromGitHub (
new UpdateCurrentGradeMasterFromGitHubRequest ()
. withNamespaceName ( "namespace1" )
. withCheckoutSetting ( new GitHubCheckoutSetting ()
. withApiKeyId ( "$gitHubApiKey1.apiKeyId" )
. withRepositoryName ( "gs2io/master-data" )
. withSourcePath ( "path/to/file.json" )
. withReferenceType ( "branch" )
. withBranchName ( "develop" )
)
);
CurrentGradeMaster 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.Gs2Grade.Gs2GradeRestClient ;
using Gs2.Gs2Grade.Request.UpdateCurrentGradeMasterFromGitHubRequest ;
using Gs2.Gs2Grade.Result.UpdateCurrentGradeMasterFromGitHubResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2GradeRestClient ( session );
AsyncResult < Gs2 . Gs2Grade . Result . UpdateCurrentGradeMasterFromGitHubResult > asyncResult = null ;
yield return client . UpdateCurrentGradeMasterFromGitHub (
new Gs2 . Gs2Grade . Request . UpdateCurrentGradeMasterFromGitHubRequest ()
. WithNamespaceName ( "namespace1" )
. WithCheckoutSetting ( new Gs2 . Gs2Grade . Model . GitHubCheckoutSetting ()
. WithApiKeyId ( "$gitHubApiKey1.apiKeyId" )
. WithRepositoryName ( "gs2io/master-data" )
. WithSourcePath ( "path/to/file.json" )
. WithReferenceType ( "branch" )
. WithBranchName ( "develop" )
),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Grade from '@/gs2/grade' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Grade . Gs2GradeRestClient ( session );
try {
const result = await client . updateCurrentGradeMasterFromGitHub (
new Gs2Grade . UpdateCurrentGradeMasterFromGitHubRequest ()
. withNamespaceName ( "namespace1" )
. withCheckoutSetting ( new Gs2Grade . model . GitHubCheckoutSetting ()
. withApiKeyId ( "$gitHubApiKey1.apiKeyId" )
. withRepositoryName ( "gs2io/master-data" )
. withSourcePath ( "path/to/file.json" )
. withReferenceType ( "branch" )
. withBranchName ( "develop" )
)
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import grade
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = grade . Gs2GradeRestClient ( session )
try :
result = client . update_current_grade_master_from_git_hub (
grade . UpdateCurrentGradeMasterFromGitHubRequest ()
. with_namespace_name ( self . hash1 )
. with_checkout_setting ( grade . GitHubCheckoutSetting ()
. with_api_key_id ( self . git_hub_api_key1 . api_key_id )
. with_repository_name ( 'gs2io/master-data' )
. with_source_path ( 'path/to/file.json' )
. with_reference_type ( 'branch' )
. with_branch_name ( 'develop' )
)
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'grade' )
api_result = client.update_current_grade_master_from_git_hub ({
namespaceName = "namespace1" ,
checkoutSetting = {
api_key_id = "$gitHubApiKey1.apiKeyId" ,
repository_name = "gs2io/master-data" ,
source_path = "path/to/file.json" ,
reference_type = "branch" ,
branch_name = "develop" ,
},
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'grade' )
api_result_handler = client.update_current_grade_master_from_git_hub_async ({
namespaceName = "namespace1" ,
checkoutSetting = {
api_key_id = "$gitHubApiKey1.apiKeyId" ,
repository_name = "gs2io/master-data" ,
source_path = "path/to/file.json" ,
reference_type = "branch" ,
branch_name = "develop" ,
},
})
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 ;