GS2-Enhance SDK API リファレンス モデル Namespace ネームスペース
ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。 GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
型 有効化条件 必須 デフォルト 値の制限 説明 namespaceId string ✓ ~ 1024文字 ネームスペースGRN name string ✓ ~ 128文字 ネームスペース名 description string ~ 1024文字 説明文 transactionSetting TransactionSetting ✓ トランザクション設定 enhanceScript ScriptSetting 強化時に実行するスクリプト logSetting LogSetting ログの出力設定 createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒) updatedAt long ✓ 現在時刻 最終更新日時 (UNIX時間 単位:ミリ秒) revision long 0 ~ 9223372036854775805 リビジョン
RateModel 強化レートモデル
強化レートは強化に使用する素材と強化対象を定義したデータです。
素材データ、強化対象データは共に GS2-Inventory で管理されている必要があります。 強化で得られる経験値は GS2-Inventory のメタデータにJSON形式で記録します。 ここではメタデータのどの階層に経験値の値が格納されているかを記載する必要があります。
強化時に一定の確率で 大成功
といった形で入手できる経験値量に補正値をかけることができます。 その抽選確率もこのエンティティで定義します。
型 有効化条件 必須 デフォルト 値の制限 説明 rateModelId string ✓ ~ 1024文字 強化レートモデルGRN name string ✓ ~ 128文字 強化レート名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ targetInventoryModelId string ✓ ~ 1024文字 強化対象に使用できるインベントリ acquireExperienceSuffix string ✓ ~ 1024文字 GS2-Experience で入手した経験値を格納する プロパティID に付与するサフィックス materialInventoryModelId string ✓ ~ 1024文字 強化の素材となるアイテムセット(有効期限ごとのアイテム所持数量)のGRN acquireExperienceHierarchy List<string> ~ 10 items ItemModelのメタデータに格納する、入手経験値を定義するJSONデータの階層構造の定義 experienceModelId string ✓ ~ 1024文字 経験値モデルGRN bonusRates List<BonusRate> ~ 1000 items 経験値獲得量ボーナス
RateModelMaster 強化レートマスター
強化レートは強化に使用する素材と強化対象を定義したデータです。
素材データ、強化対象データは共に GS2-Inventory で管理されている必要があります。 強化で得られる経験値は GS2-Inventory のメタデータにJSON形式で記録します。 ここではメタデータのどの階層に経験値の値が格納されているかを記載する必要があります。
強化時に一定の確率で 大成功
といった形で入手できる経験値量に補正値をかけることができます。 その抽選確率もこのエンティティで定義します。
型 有効化条件 必須 デフォルト 値の制限 説明 rateModelId string ✓ ~ 1024文字 強化レートマスターGRN name string ✓ ~ 128文字 強化レート名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ targetInventoryModelId string ✓ ~ 1024文字 強化対象に使用できるインベントリモデルGRN acquireExperienceSuffix string ✓ ~ 1024文字 GS2-Experience で入手した経験値を格納する プロパティID に付与するサフィックス materialInventoryModelId string ✓ ~ 1024文字 素材に使用できるインベントリモデルGRN acquireExperienceHierarchy List<string> ~ 10 items ItemModelのメタデータに格納する、入手経験値を定義するJSONデータの階層構造の定義 experienceModelId string ✓ ~ 1024文字 強化の結果を得られる経験値 bonusRates List<BonusRate> ~ 1000 items 経験値獲得量ボーナス createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒) updatedAt long ✓ 現在時刻 最終更新日時 (UNIX時間 単位:ミリ秒) revision long 0 ~ 9223372036854775805 リビジョン
UnleashRateModel 限界突破レート
限界突破レートは限界突破の対象と GS2-Grade 限界突破モデルを定義したデータです。 限界突破の対象データは GS2-Inventory で管理されている必要があります。
型 有効化条件 必須 デフォルト 値の制限 説明 unleashRateModelId string ✓ ~ 1024文字 限界突破レートモデルGRN name string ✓ ~ 128文字 強化レート名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ targetInventoryModelId string ✓ ~ 1024文字 限界突破対象に使用できるインベントリ gradeModelId string ✓ ~ 1024文字 グレードモデル gradeEntries List<UnleashRateEntryModel> ✓ 1 ~ 1000 items グレードエントリリスト
UnleashRateModelMaster 限界突破レートモデルマスター
限界突破レートは限界突破の対象と GS2-Grade 限界突破モデルを定義したデータです。 限界突破の対象データは GS2-Inventory で管理されている必要があります。
型 有効化条件 必須 デフォルト 値の制限 説明 unleashRateModelId string ✓ ~ 1024文字 限界突破レートマスターGRN name string ✓ ~ 128文字 限界突破レート名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ targetInventoryModelId string ✓ ~ 1024文字 限界突破対象に使用できるインベントリ gradeModelId string ✓ ~ 1024文字 グレードモデル gradeEntries List<UnleashRateEntryModel> ✓ 1 ~ 1000 items グレードエントリリスト createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒) updatedAt long ✓ 現在時刻 最終更新日時 (UNIX時間 単位:ミリ秒) revision long 0 ~ 9223372036854775805 リビジョン
Progress 強化進行状況
強化の開始時に作成され、終了時に削除されます。
強化の途中でアプリを終了した際にはこのデータが残った状態となり エンティティが保持する進行中の強化情報からゲームをリジュームすることが可能です。
型 有効化条件 必須 デフォルト 値の制限 説明 progressId string ✓ ~ 1024文字 実行GRN userId string ✓ ~ 128文字 ユーザーID rateName string ✓ ~ 128文字 レートモデル名 name string ✓ UUID ~ 36文字 進行ID propertyId string ✓ ~ 1024文字 強化対象のプロパティID experienceValue long ✓ ~ 9223372036854775805 入手できる経験値 rate float ✓ ~ 100.0 経験値倍率 createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒) updatedAt long ✓ 現在時刻 最終更新日時 (UNIX時間 単位:ミリ秒) revision long 0 ~ 9223372036854775805 リビジョン
CurrentRateMaster 現在有効な強化レートマスター
GS2ではマスターデータの管理にJSON形式のファイルを使用します。 ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
型 有効化条件 必須 デフォルト 値の制限 説明 namespaceId string ✓ ~ 1024文字 現在有効な強化レート設定GRN settings string ✓ ~ 5242880文字 マスターデータ
BonusRate 経験値獲得量ボーナス
型 有効化条件 必須 デフォルト 値の制限 説明 rate float ✓ 1.0 ~ 10000 経験値ボーナスの倍率(1.0=ボーナスなし) weight int ✓ 1 ~ 2147483645 抽選重み
Material 強化素材
型 有効化条件 必須 デフォルト 値の制限 説明 materialItemSetId string ✓ ~ 1024文字 強化の素材となるアイテムセット(有効期限ごとのアイテム所持数量)のGRN count int ✓ 1 ~ 2147483645 消費数量
UnleashRateEntryModel 限界突破レートエントリモデル
型 有効化条件 必須 デフォルト 値の制限 説明 gradeValue long ✓ 1 ~ 1000 対象グレード needCount int ✓ 1 ~ 1000 同種のアイテムを何個消費するか
Config コンフィグ設定
トランザクションの変数に適用する設定値
型 有効化条件 必須 デフォルト 値の制限 説明 key string ✓ ~ 64文字 名前 value string ~ 51200文字 値
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DescribeNamespaces (
& enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DescribeNamespacesRequest ;
import io.gs2.enhance.result.DescribeNamespacesResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DescribeNamespacesRequest ;
using Gs2.Gs2Enhance.Result.DescribeNamespacesResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DescribeNamespacesResult > asyncResult = null ;
yield return client . DescribeNamespaces (
new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . describeNamespaces (
new Gs2Enhance . 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 enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . describe_namespaces (
enhance . 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 ( 'enhance' )
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 ( 'enhance' )
api_result_handler = client.describe_namespaces_async ({
pageToken = nil ,
limit = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
createNamespace ネームスペースを新規作成
Request 型 有効化条件 必須 デフォルト 値の制限 説明 name string ✓ ~ 128文字 ネームスペース名 description string ~ 1024文字 説明文 transactionSetting TransactionSetting ✓ トランザクション設定 enhanceScript ScriptSetting 強化時に実行するスクリプト logSetting LogSetting ログの出力設定 enableDirectEnhance bool ✓ true DirectEnhance を利用できるようにするか queueNamespaceId string ~ 1024文字 トランザクションの実行に使用する GS2-JobQueue のネームスペース keyId string ~ 1024文字 スタンプシートの発行に使用する GS2-Key のネームスペース
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . CreateNamespace (
& enhance . CreateNamespaceRequest {
Name : pointy . String ( "namespace1" ),
Description : nil ,
TransactionSetting : & enhance . TransactionSetting {
EnableAutoRun : pointy . Bool ( false ),
QueueNamespaceId : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001" ),
KeyId : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001" ),
},
EnhanceScript : nil ,
LogSetting : & enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\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 (( new \Gs2\Enhance\Model\TransactionSetting ())
-> withEnableAutoRun ( False )
-> withQueueNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001" )
-> withKeyId ( "grn:gs2:ap-northeast-1:YourOwnerId:key: \n amespace1:key:key-0001" ))
-> withEnhanceScript ( null )
-> withLogSetting (( new \Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.CreateNamespaceRequest ;
import io.gs2.enhance.result.CreateNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
CreateNamespaceResult result = client . createNamespace (
new CreateNamespaceRequest ()
. withName ( "namespace1" )
. withDescription ( null )
. withTransactionSetting ( new io . gs2 . enhance . model . TransactionSetting ()
. withEnableAutoRun ( false )
. withQueueNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001" )
. withKeyId ( "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001" ))
. withEnhanceScript ( null )
. withLogSetting ( new io . gs2 . enhance . 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.CreateNamespaceRequest ;
using Gs2.Gs2Enhance.Result.CreateNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . CreateNamespaceResult > asyncResult = null ;
yield return client . CreateNamespace (
new Gs2 . Gs2Enhance . Request . CreateNamespaceRequest ()
. WithName ( "namespace1" )
. WithDescription ( null )
. WithTransactionSetting ( new Gs2 . Gs2Enhance . Model . TransactionSetting ()
. WithEnableAutoRun ( false )
. WithQueueNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001" )
. WithKeyId ( "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001" ))
. WithEnhanceScript ( null )
. WithLogSetting ( new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . createNamespace (
new Gs2Enhance . CreateNamespaceRequest ()
. withName ( "namespace1" )
. withDescription ( null )
. withTransactionSetting ( new Gs2Enhance . model . TransactionSetting ()
. withEnableAutoRun ( false )
. withQueueNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001" )
. withKeyId ( "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001" ))
. withEnhanceScript ( null )
. withLogSetting ( new Gs2Enhance . 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 enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . create_namespace (
enhance . CreateNamespaceRequest ()
. with_name ( self . hash1 )
. with_description ( None )
. with_transaction_setting (
enhance . TransactionSetting ()
. with_enable_auto_run ( False )
. with_queue_namespace_id ( 'grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001' )
. with_key_id ( 'grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001' ))
. with_enhance_script ( None )
. with_log_setting (
enhance . 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 ( 'enhance' )
api_result = client.create_namespace ({
name = "namespace1" ,
description = nil ,
transactionSetting = {
enableAutoRun = false ,
queueNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001" ,
keyId = "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001" ,
},
enhanceScript = 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 ( 'enhance' )
api_result_handler = client.create_namespace_async ({
name = "namespace1" ,
description = nil ,
transactionSetting = {
enableAutoRun = false ,
queueNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001" ,
keyId = "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001" ,
},
enhanceScript = 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . GetNamespaceStatus (
& enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.GetNamespaceStatusRequest ;
import io.gs2.enhance.result.GetNamespaceStatusResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.GetNamespaceStatusRequest ;
using Gs2.Gs2Enhance.Result.GetNamespaceStatusResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . GetNamespaceStatusResult > asyncResult = null ;
yield return client . GetNamespaceStatus (
new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . getNamespaceStatus (
new Gs2Enhance . GetNamespaceStatusRequest ()
. withNamespaceName ( "namespace1" )
);
const status = result . getStatus ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . get_namespace_status (
enhance . GetNamespaceStatusRequest ()
. with_namespace_name ( self . hash1 )
)
status = result . status
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
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 ( 'enhance' )
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . GetNamespace (
& enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.GetNamespaceRequest ;
import io.gs2.enhance.result.GetNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.GetNamespaceRequest ;
using Gs2.Gs2Enhance.Result.GetNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . GetNamespaceResult > asyncResult = null ;
yield return client . GetNamespace (
new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . getNamespace (
new Gs2Enhance . GetNamespaceRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . get_namespace (
enhance . GetNamespaceRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
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 ( 'enhance' )
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 ✓ トランザクション設定 enhanceScript ScriptSetting 強化時に実行するスクリプト logSetting LogSetting ログの出力設定 enableDirectEnhance bool ✓ true DirectEnhance を利用できるようにするか queueNamespaceId string ~ 1024文字 トランザクションの実行に使用する GS2-JobQueue のネームスペース keyId string ~ 1024文字 スタンプシートの発行に使用する GS2-Key のネームスペース
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . UpdateNamespace (
& enhance . UpdateNamespaceRequest {
NamespaceName : pointy . String ( "namespace1" ),
Description : pointy . String ( "description1" ),
TransactionSetting : & enhance . TransactionSetting {
EnableAutoRun : pointy . Bool ( false ),
QueueNamespaceId : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002" ),
KeyId : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002" ),
},
EnhanceScript : nil ,
LogSetting : & enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\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 (( new \Gs2\Enhance\Model\TransactionSetting ())
-> withEnableAutoRun ( False )
-> withQueueNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002" )
-> withKeyId ( "grn:gs2:ap-northeast-1:YourOwnerId:key: \n amespace1:key:key-0002" ))
-> withEnhanceScript ( null )
-> withLogSetting (( new \Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.UpdateNamespaceRequest ;
import io.gs2.enhance.result.UpdateNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
UpdateNamespaceResult result = client . updateNamespace (
new UpdateNamespaceRequest ()
. withNamespaceName ( "namespace1" )
. withDescription ( "description1" )
. withTransactionSetting ( new io . gs2 . enhance . model . TransactionSetting ()
. withEnableAutoRun ( false )
. withQueueNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002" )
. withKeyId ( "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002" ))
. withEnhanceScript ( null )
. withLogSetting ( new io . gs2 . enhance . 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.UpdateNamespaceRequest ;
using Gs2.Gs2Enhance.Result.UpdateNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . UpdateNamespaceResult > asyncResult = null ;
yield return client . UpdateNamespace (
new Gs2 . Gs2Enhance . Request . UpdateNamespaceRequest ()
. WithNamespaceName ( "namespace1" )
. WithDescription ( "description1" )
. WithTransactionSetting ( new Gs2 . Gs2Enhance . Model . TransactionSetting ()
. WithEnableAutoRun ( false )
. WithQueueNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002" )
. WithKeyId ( "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002" ))
. WithEnhanceScript ( null )
. WithLogSetting ( new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . updateNamespace (
new Gs2Enhance . UpdateNamespaceRequest ()
. withNamespaceName ( "namespace1" )
. withDescription ( "description1" )
. withTransactionSetting ( new Gs2Enhance . model . TransactionSetting ()
. withEnableAutoRun ( false )
. withQueueNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002" )
. withKeyId ( "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002" ))
. withEnhanceScript ( null )
. withLogSetting ( new Gs2Enhance . 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 enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . update_namespace (
enhance . UpdateNamespaceRequest ()
. with_namespace_name ( self . hash1 )
. with_description ( 'description1' )
. with_transaction_setting (
enhance . TransactionSetting ()
. with_enable_auto_run ( False )
. with_queue_namespace_id ( 'grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002' )
. with_key_id ( 'grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002' ))
. with_enhance_script ( None )
. with_log_setting (
enhance . 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 ( 'enhance' )
api_result = client.update_namespace ({
namespaceName = "namespace1" ,
description = "description1" ,
transactionSetting = {
enableAutoRun = false ,
queueNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002" ,
keyId = "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002" ,
},
enhanceScript = 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 ( 'enhance' )
api_result_handler = client.update_namespace_async ({
namespaceName = "namespace1" ,
description = "description1" ,
transactionSetting = {
enableAutoRun = false ,
queueNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002" ,
keyId = "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002" ,
},
enhanceScript = 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 ;
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DeleteNamespace (
& enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DeleteNamespaceRequest ;
import io.gs2.enhance.result.DeleteNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DeleteNamespaceRequest ;
using Gs2.Gs2Enhance.Result.DeleteNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DeleteNamespaceResult > asyncResult = null ;
yield return client . DeleteNamespace (
new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . deleteNamespace (
new Gs2Enhance . DeleteNamespaceRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . delete_namespace (
enhance . DeleteNamespaceRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
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 ( 'enhance' )
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DumpUserDataByUserId (
& enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DumpUserDataByUserIdRequest ;
import io.gs2.enhance.result.DumpUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DumpUserDataByUserIdRequest ;
using Gs2.Gs2Enhance.Result.DumpUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DumpUserDataByUserIdResult > asyncResult = null ;
yield return client . DumpUserDataByUserId (
new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . dumpUserDataByUserId (
new Gs2Enhance . DumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . dump_user_data_by_user_id (
enhance . DumpUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
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 ( 'enhance' )
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . CheckDumpUserDataByUserId (
& enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.CheckDumpUserDataByUserIdRequest ;
import io.gs2.enhance.result.CheckDumpUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.CheckDumpUserDataByUserIdRequest ;
using Gs2.Gs2Enhance.Result.CheckDumpUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . CheckDumpUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckDumpUserDataByUserId (
new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . checkDumpUserDataByUserId (
new Gs2Enhance . CheckDumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
const url = result . getUrl ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . check_dump_user_data_by_user_id (
enhance . CheckDumpUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
url = result . url
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
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 ( 'enhance' )
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . CleanUserDataByUserId (
& enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.CleanUserDataByUserIdRequest ;
import io.gs2.enhance.result.CleanUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.CleanUserDataByUserIdRequest ;
using Gs2.Gs2Enhance.Result.CleanUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . CleanUserDataByUserIdResult > asyncResult = null ;
yield return client . CleanUserDataByUserId (
new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . cleanUserDataByUserId (
new Gs2Enhance . CleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . clean_user_data_by_user_id (
enhance . CleanUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
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 ( 'enhance' )
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . CheckCleanUserDataByUserId (
& enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.CheckCleanUserDataByUserIdRequest ;
import io.gs2.enhance.result.CheckCleanUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.CheckCleanUserDataByUserIdRequest ;
using Gs2.Gs2Enhance.Result.CheckCleanUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . CheckCleanUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckCleanUserDataByUserId (
new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . checkCleanUserDataByUserId (
new Gs2Enhance . CheckCleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . check_clean_user_data_by_user_id (
enhance . CheckCleanUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
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 ( 'enhance' )
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . PrepareImportUserDataByUserId (
& enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.PrepareImportUserDataByUserIdRequest ;
import io.gs2.enhance.result.PrepareImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.PrepareImportUserDataByUserIdRequest ;
using Gs2.Gs2Enhance.Result.PrepareImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . PrepareImportUserDataByUserIdResult > asyncResult = null ;
yield return client . PrepareImportUserDataByUserId (
new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . prepareImportUserDataByUserId (
new Gs2Enhance . 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 enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . prepare_import_user_data_by_user_id (
enhance . 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 ( 'enhance' )
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 ( 'enhance' )
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . ImportUserDataByUserId (
& enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.ImportUserDataByUserIdRequest ;
import io.gs2.enhance.result.ImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.ImportUserDataByUserIdRequest ;
using Gs2.Gs2Enhance.Result.ImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . ImportUserDataByUserIdResult > asyncResult = null ;
yield return client . ImportUserDataByUserId (
new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . importUserDataByUserId (
new Gs2Enhance . ImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withUploadToken ( "upload-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . import_user_data_by_user_id (
enhance . 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 ( 'enhance' )
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 ( 'enhance' )
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . CheckImportUserDataByUserId (
& enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.CheckImportUserDataByUserIdRequest ;
import io.gs2.enhance.result.CheckImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.CheckImportUserDataByUserIdRequest ;
using Gs2.Gs2Enhance.Result.CheckImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . CheckImportUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckImportUserDataByUserId (
new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . checkImportUserDataByUserId (
new Gs2Enhance . 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 enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . check_import_user_data_by_user_id (
enhance . 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 ( 'enhance' )
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 ( 'enhance' )
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 ;
describeRateModels 強化レートモデルの一覧を取得
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DescribeRateModels (
& enhance . DescribeRateModelsRequest {
NamespaceName : pointy . String ( "namespace1" ),
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\DescribeRateModelsRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeRateModels (
( new DescribeRateModelsRequest ())
-> withNamespaceName ( self :: namespace1 )
);
$items = $result -> getItems ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DescribeRateModelsRequest ;
import io.gs2.enhance.result.DescribeRateModelsResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
DescribeRateModelsResult result = client . describeRateModels (
new DescribeRateModelsRequest ()
. withNamespaceName ( "namespace1" )
);
List < RateModel > 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DescribeRateModelsRequest ;
using Gs2.Gs2Enhance.Result.DescribeRateModelsResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DescribeRateModelsResult > asyncResult = null ;
yield return client . DescribeRateModels (
new Gs2 . Gs2Enhance . Request . DescribeRateModelsRequest ()
. WithNamespaceName ( "namespace1" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var items = result . Items ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . describeRateModels (
new Gs2Enhance . DescribeRateModelsRequest ()
. withNamespaceName ( "namespace1" )
);
const items = result . getItems ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . describe_rate_models (
enhance . DescribeRateModelsRequest ()
. with_namespace_name ( self . hash1 )
)
items = result . items
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.describe_rate_models ({
namespaceName = "namespace1" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
client = gs2 ( 'enhance' )
api_result_handler = client.describe_rate_models_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
items = result.items ;
getRateModel 強化レートモデルを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 rateName 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . GetRateModel (
& enhance . GetRateModelRequest {
NamespaceName : pointy . String ( "namespace1" ),
RateName : pointy . String ( "character-level" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\GetRateModelRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getRateModel (
( new GetRateModelRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withRateName ( "character-level" )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.GetRateModelRequest ;
import io.gs2.enhance.result.GetRateModelResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
GetRateModelResult result = client . getRateModel (
new GetRateModelRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
);
RateModel 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.GetRateModelRequest ;
using Gs2.Gs2Enhance.Result.GetRateModelResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . GetRateModelResult > asyncResult = null ;
yield return client . GetRateModel (
new Gs2 . Gs2Enhance . Request . GetRateModelRequest ()
. WithNamespaceName ( "namespace1" )
. WithRateName ( "character-level" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . getRateModel (
new Gs2Enhance . GetRateModelRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . get_rate_model (
enhance . GetRateModelRequest ()
. with_namespace_name ( self . hash1 )
. with_rate_name ( 'character-level' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.get_rate_model ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
})
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 ( 'enhance' )
api_result_handler = client.get_rate_model_async ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
})
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 ;
describeRateModelMasters 強化レートマスターの一覧を取得
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DescribeRateModelMasters (
& enhance . DescribeRateModelMastersRequest {
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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\DescribeRateModelMastersRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeRateModelMasters (
( new DescribeRateModelMastersRequest ())
-> 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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DescribeRateModelMastersRequest ;
import io.gs2.enhance.result.DescribeRateModelMastersResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
DescribeRateModelMastersResult result = client . describeRateModelMasters (
new DescribeRateModelMastersRequest ()
. withNamespaceName ( "namespace1" )
. withPageToken ( null )
. withLimit ( null )
);
List < RateModelMaster > 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DescribeRateModelMastersRequest ;
using Gs2.Gs2Enhance.Result.DescribeRateModelMastersResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DescribeRateModelMastersResult > asyncResult = null ;
yield return client . DescribeRateModelMasters (
new Gs2 . Gs2Enhance . Request . DescribeRateModelMastersRequest ()
. 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . describeRateModelMasters (
new Gs2Enhance . DescribeRateModelMastersRequest ()
. 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 enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . describe_rate_model_masters (
enhance . DescribeRateModelMastersRequest ()
. 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 ( 'enhance' )
api_result = client.describe_rate_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 ( 'enhance' )
api_result_handler = client.describe_rate_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 ;
createRateModelMaster 強化レートマスターを新規作成
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 name string ✓ ~ 128文字 強化レート名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ targetInventoryModelId string ✓ ~ 1024文字 強化対象に使用できるインベントリモデルGRN acquireExperienceSuffix string ✓ ~ 1024文字 GS2-Experience で入手した経験値を格納する プロパティID に付与するサフィックス materialInventoryModelId string ✓ ~ 1024文字 素材に使用できるインベントリモデルGRN acquireExperienceHierarchy List<string> ~ 10 items ItemModelのメタデータに格納する、入手経験値を定義するJSONデータの階層構造の定義 experienceModelId string ✓ ~ 1024文字 強化の結果を得られる経験値 bonusRates List<BonusRate> ~ 1000 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . CreateRateModelMaster (
& enhance . CreateRateModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
Name : pointy . String ( "character-level" ),
Description : nil ,
Metadata : pointy . String ( "CHARACTER_LEVEL" ),
TargetInventoryModelId : pointy . String ( "grn:inventory:character" ),
AcquireExperienceSuffix : pointy . String ( ":level" ),
MaterialInventoryModelId : pointy . String ( "grn:inventory:material" ),
AcquireExperienceHierarchy : [] * string {
pointy . String ( "experience" ),
},
ExperienceModelId : pointy . String ( "grn:experience:level" ),
BonusRates : [] enhance . BonusRate {
enhance . BonusRate {
Rate : pointy . Float32 ( 1.0 ),
Weight : pointy . Int32 ( 90 ),
},
enhance . BonusRate {
Rate : pointy . Float32 ( 1.5 ),
Weight : pointy . Int32 ( 9 ),
},
enhance . BonusRate {
Rate : pointy . Float32 ( 2.0 ),
Weight : pointy . Int32 ( 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\CreateRateModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> createRateModelMaster (
( new CreateRateModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withName ( "character-level" )
-> withDescription ( null )
-> withMetadata ( "CHARACTER_LEVEL" )
-> withTargetInventoryModelId ( "grn:inventory:character" )
-> withAcquireExperienceSuffix ( ":level" )
-> withMaterialInventoryModelId ( "grn:inventory:material" )
-> withAcquireExperienceHierarchy ([
"experience" ,
])
-> withExperienceModelId ( "grn:experience:level" )
-> withBonusRates ([
( new \Gs2\Enhance\Model\BonusRate ())
-> withRate ( 1.0 )
-> withWeight ( 90 ),
( new \Gs2\Enhance\Model\BonusRate ())
-> withRate ( 1.5 )
-> withWeight ( 9 ),
( new \Gs2\Enhance\Model\BonusRate ())
-> withRate ( 2.0 )
-> withWeight ( 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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.CreateRateModelMasterRequest ;
import io.gs2.enhance.result.CreateRateModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
CreateRateModelMasterResult result = client . createRateModelMaster (
new CreateRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withName ( "character-level" )
. withDescription ( null )
. withMetadata ( "CHARACTER_LEVEL" )
. withTargetInventoryModelId ( "grn:inventory:character" )
. withAcquireExperienceSuffix ( ":level" )
. withMaterialInventoryModelId ( "grn:inventory:material" )
. withAcquireExperienceHierarchy ( Arrays . asList (
"experience"
))
. withExperienceModelId ( "grn:experience:level" )
. withBonusRates ( Arrays . asList (
new io . gs2 . enhance . model . BonusRate ()
. withRate ( 1 . 0f )
. withWeight ( 90 ),
new io . gs2 . enhance . model . BonusRate ()
. withRate ( 1 . 5f )
. withWeight ( 9 ),
new io . gs2 . enhance . model . BonusRate ()
. withRate ( 2 . 0f )
. withWeight ( 1 )
))
);
RateModelMaster 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.CreateRateModelMasterRequest ;
using Gs2.Gs2Enhance.Result.CreateRateModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . CreateRateModelMasterResult > asyncResult = null ;
yield return client . CreateRateModelMaster (
new Gs2 . Gs2Enhance . Request . CreateRateModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithName ( "character-level" )
. WithDescription ( null )
. WithMetadata ( "CHARACTER_LEVEL" )
. WithTargetInventoryModelId ( "grn:inventory:character" )
. WithAcquireExperienceSuffix ( ":level" )
. WithMaterialInventoryModelId ( "grn:inventory:material" )
. WithAcquireExperienceHierarchy ( new string [] {
"experience" ,
})
. WithExperienceModelId ( "grn:experience:level" )
. WithBonusRates ( new Gs2 . Gs2Enhance . Model . BonusRate [] {
new Gs2 . Gs2Enhance . Model . BonusRate ()
. WithRate ( 1.0f )
. WithWeight ( 90 ),
new Gs2 . Gs2Enhance . Model . BonusRate ()
. WithRate ( 1.5f )
. WithWeight ( 9 ),
new Gs2 . Gs2Enhance . Model . BonusRate ()
. WithRate ( 2.0f )
. WithWeight ( 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . createRateModelMaster (
new Gs2Enhance . CreateRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withName ( "character-level" )
. withDescription ( null )
. withMetadata ( "CHARACTER_LEVEL" )
. withTargetInventoryModelId ( "grn:inventory:character" )
. withAcquireExperienceSuffix ( ":level" )
. withMaterialInventoryModelId ( "grn:inventory:material" )
. withAcquireExperienceHierarchy ([
"experience" ,
])
. withExperienceModelId ( "grn:experience:level" )
. withBonusRates ([
new Gs2Enhance . model . BonusRate ()
. withRate ( 1.0 )
. withWeight ( 90 ),
new Gs2Enhance . model . BonusRate ()
. withRate ( 1.5 )
. withWeight ( 9 ),
new Gs2Enhance . model . BonusRate ()
. withRate ( 2.0 )
. withWeight ( 1 ),
])
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . create_rate_model_master (
enhance . CreateRateModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_name ( 'character-level' )
. with_description ( None )
. with_metadata ( 'CHARACTER_LEVEL' )
. with_target_inventory_model_id ( 'grn:inventory:character' )
. with_acquire_experience_suffix ( ':level' )
. with_material_inventory_model_id ( 'grn:inventory:material' )
. with_acquire_experience_hierarchy ([
'experience' ,
])
. with_experience_model_id ( 'grn:experience:level' )
. with_bonus_rates ([
enhance . BonusRate ()
. with_rate ( 1.0 )
. with_weight ( 90 ),
enhance . BonusRate ()
. with_rate ( 1.5 )
. with_weight ( 9 ),
enhance . BonusRate ()
. with_rate ( 2.0 )
. with_weight ( 1 ),
])
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.create_rate_model_master ({
namespaceName = "namespace1" ,
name = "character-level" ,
description = nil ,
metadata = "CHARACTER_LEVEL" ,
targetInventoryModelId = "grn:inventory:character" ,
acquireExperienceSuffix = ":level" ,
materialInventoryModelId = "grn:inventory:material" ,
acquireExperienceHierarchy = {
"experience"
},
experienceModelId = "grn:experience:level" ,
bonusRates = {
{
rate = 1.0 ,
weight = 90 ,
},
{
rate = 1.5 ,
weight = 9 ,
},
{
rate = 2.0 ,
weight = 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 ( 'enhance' )
api_result_handler = client.create_rate_model_master_async ({
namespaceName = "namespace1" ,
name = "character-level" ,
description = nil ,
metadata = "CHARACTER_LEVEL" ,
targetInventoryModelId = "grn:inventory:character" ,
acquireExperienceSuffix = ":level" ,
materialInventoryModelId = "grn:inventory:material" ,
acquireExperienceHierarchy = {
"experience"
},
experienceModelId = "grn:experience:level" ,
bonusRates = {
{
rate = 1.0 ,
weight = 90 ,
},
{
rate = 1.5 ,
weight = 9 ,
},
{
rate = 2.0 ,
weight = 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 ;
getRateModelMaster 強化レートマスターを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 rateName 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . GetRateModelMaster (
& enhance . GetRateModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
RateName : pointy . String ( "character-level" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\GetRateModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getRateModelMaster (
( new GetRateModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withRateName ( "character-level" )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.GetRateModelMasterRequest ;
import io.gs2.enhance.result.GetRateModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
GetRateModelMasterResult result = client . getRateModelMaster (
new GetRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
);
RateModelMaster 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.GetRateModelMasterRequest ;
using Gs2.Gs2Enhance.Result.GetRateModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . GetRateModelMasterResult > asyncResult = null ;
yield return client . GetRateModelMaster (
new Gs2 . Gs2Enhance . Request . GetRateModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithRateName ( "character-level" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . getRateModelMaster (
new Gs2Enhance . GetRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . get_rate_model_master (
enhance . GetRateModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_rate_name ( 'character-level' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.get_rate_model_master ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
})
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 ( 'enhance' )
api_result_handler = client.get_rate_model_master_async ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
})
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 ;
updateRateModelMaster 強化レートマスターを更新
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 rateName string ✓ ~ 128文字 強化レート名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ targetInventoryModelId string ✓ ~ 1024文字 強化対象に使用できるインベントリモデルGRN acquireExperienceSuffix string ✓ ~ 1024文字 GS2-Experience で入手した経験値を格納する プロパティID に付与するサフィックス materialInventoryModelId string ✓ ~ 1024文字 素材に使用できるインベントリモデルGRN acquireExperienceHierarchy List<string> ~ 10 items ItemModelのメタデータに格納する、入手経験値を定義するJSONデータの階層構造の定義 experienceModelId string ✓ ~ 1024文字 強化の結果を得られる経験値 bonusRates List<BonusRate> ~ 1000 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . UpdateRateModelMaster (
& enhance . UpdateRateModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
RateName : pointy . String ( "character-level" ),
Description : nil ,
Metadata : pointy . String ( "CHARACTER_LEVEL2" ),
TargetInventoryModelId : pointy . String ( "grn:inventory:character2" ),
AcquireExperienceSuffix : pointy . String ( ":level2" ),
MaterialInventoryModelId : pointy . String ( "grn:inventory:material2" ),
AcquireExperienceHierarchy : [] * string {
pointy . String ( "experience2" ),
},
ExperienceModelId : pointy . String ( "grn:experience:level2" ),
BonusRates : [] enhance . BonusRate {
enhance . BonusRate {
Rate : pointy . Float32 ( 1.05 ),
Weight : pointy . Int32 ( 905 ),
},
enhance . BonusRate {
Rate : pointy . Float32 ( 1.55 ),
Weight : pointy . Int32 ( 95 ),
},
enhance . BonusRate {
Rate : pointy . Float32 ( 2.05 ),
Weight : pointy . Int32 ( 15 ),
},
},
}
)
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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\UpdateRateModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateRateModelMaster (
( new UpdateRateModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withRateName ( "character-level" )
-> withDescription ( null )
-> withMetadata ( "CHARACTER_LEVEL2" )
-> withTargetInventoryModelId ( "grn:inventory:character2" )
-> withAcquireExperienceSuffix ( ":level2" )
-> withMaterialInventoryModelId ( "grn:inventory:material2" )
-> withAcquireExperienceHierarchy ([
"experience2" ,
])
-> withExperienceModelId ( "grn:experience:level2" )
-> withBonusRates ([
( new \Gs2\Enhance\Model\BonusRate ())
-> withRate ( 1.05 )
-> withWeight ( 905 ),
( new \Gs2\Enhance\Model\BonusRate ())
-> withRate ( 1.55 )
-> withWeight ( 95 ),
( new \Gs2\Enhance\Model\BonusRate ())
-> withRate ( 2.05 )
-> withWeight ( 15 ),
])
);
$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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.UpdateRateModelMasterRequest ;
import io.gs2.enhance.result.UpdateRateModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
UpdateRateModelMasterResult result = client . updateRateModelMaster (
new UpdateRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
. withDescription ( null )
. withMetadata ( "CHARACTER_LEVEL2" )
. withTargetInventoryModelId ( "grn:inventory:character2" )
. withAcquireExperienceSuffix ( ":level2" )
. withMaterialInventoryModelId ( "grn:inventory:material2" )
. withAcquireExperienceHierarchy ( Arrays . asList (
"experience2"
))
. withExperienceModelId ( "grn:experience:level2" )
. withBonusRates ( Arrays . asList (
new io . gs2 . enhance . model . BonusRate ()
. withRate ( 1 . 05f )
. withWeight ( 905 ),
new io . gs2 . enhance . model . BonusRate ()
. withRate ( 1 . 55f )
. withWeight ( 95 ),
new io . gs2 . enhance . model . BonusRate ()
. withRate ( 2 . 05f )
. withWeight ( 15 )
))
);
RateModelMaster 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.UpdateRateModelMasterRequest ;
using Gs2.Gs2Enhance.Result.UpdateRateModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . UpdateRateModelMasterResult > asyncResult = null ;
yield return client . UpdateRateModelMaster (
new Gs2 . Gs2Enhance . Request . UpdateRateModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithRateName ( "character-level" )
. WithDescription ( null )
. WithMetadata ( "CHARACTER_LEVEL2" )
. WithTargetInventoryModelId ( "grn:inventory:character2" )
. WithAcquireExperienceSuffix ( ":level2" )
. WithMaterialInventoryModelId ( "grn:inventory:material2" )
. WithAcquireExperienceHierarchy ( new string [] {
"experience2" ,
})
. WithExperienceModelId ( "grn:experience:level2" )
. WithBonusRates ( new Gs2 . Gs2Enhance . Model . BonusRate [] {
new Gs2 . Gs2Enhance . Model . BonusRate ()
. WithRate ( 1.05f )
. WithWeight ( 905 ),
new Gs2 . Gs2Enhance . Model . BonusRate ()
. WithRate ( 1.55f )
. WithWeight ( 95 ),
new Gs2 . Gs2Enhance . Model . BonusRate ()
. WithRate ( 2.05f )
. WithWeight ( 15 ),
}),
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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . updateRateModelMaster (
new Gs2Enhance . UpdateRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
. withDescription ( null )
. withMetadata ( "CHARACTER_LEVEL2" )
. withTargetInventoryModelId ( "grn:inventory:character2" )
. withAcquireExperienceSuffix ( ":level2" )
. withMaterialInventoryModelId ( "grn:inventory:material2" )
. withAcquireExperienceHierarchy ([
"experience2" ,
])
. withExperienceModelId ( "grn:experience:level2" )
. withBonusRates ([
new Gs2Enhance . model . BonusRate ()
. withRate ( 1.05 )
. withWeight ( 905 ),
new Gs2Enhance . model . BonusRate ()
. withRate ( 1.55 )
. withWeight ( 95 ),
new Gs2Enhance . model . BonusRate ()
. withRate ( 2.05 )
. withWeight ( 15 ),
])
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . update_rate_model_master (
enhance . UpdateRateModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_rate_name ( 'character-level' )
. with_description ( None )
. with_metadata ( 'CHARACTER_LEVEL2' )
. with_target_inventory_model_id ( 'grn:inventory:character2' )
. with_acquire_experience_suffix ( ':level2' )
. with_material_inventory_model_id ( 'grn:inventory:material2' )
. with_acquire_experience_hierarchy ([
'experience2' ,
])
. with_experience_model_id ( 'grn:experience:level2' )
. with_bonus_rates ([
enhance . BonusRate ()
. with_rate ( 1.05 )
. with_weight ( 905 ),
enhance . BonusRate ()
. with_rate ( 1.55 )
. with_weight ( 95 ),
enhance . BonusRate ()
. with_rate ( 2.05 )
. with_weight ( 15 ),
])
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.update_rate_model_master ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
description = nil ,
metadata = "CHARACTER_LEVEL2" ,
targetInventoryModelId = "grn:inventory:character2" ,
acquireExperienceSuffix = ":level2" ,
materialInventoryModelId = "grn:inventory:material2" ,
acquireExperienceHierarchy = {
"experience2"
},
experienceModelId = "grn:experience:level2" ,
bonusRates = {
{
rate = 1.05 ,
weight = 905 ,
},
{
rate = 1.55 ,
weight = 95 ,
},
{
rate = 2.05 ,
weight = 15 ,
}
},
})
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 ( 'enhance' )
api_result_handler = client.update_rate_model_master_async ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
description = nil ,
metadata = "CHARACTER_LEVEL2" ,
targetInventoryModelId = "grn:inventory:character2" ,
acquireExperienceSuffix = ":level2" ,
materialInventoryModelId = "grn:inventory:material2" ,
acquireExperienceHierarchy = {
"experience2"
},
experienceModelId = "grn:experience:level2" ,
bonusRates = {
{
rate = 1.05 ,
weight = 905 ,
},
{
rate = 1.55 ,
weight = 95 ,
},
{
rate = 2.05 ,
weight = 15 ,
}
},
})
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 ;
deleteRateModelMaster 強化レートマスターを削除
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 rateName 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DeleteRateModelMaster (
& enhance . DeleteRateModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
RateName : pointy . String ( "character-level" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\DeleteRateModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> deleteRateModelMaster (
( new DeleteRateModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withRateName ( "character-level" )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DeleteRateModelMasterRequest ;
import io.gs2.enhance.result.DeleteRateModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
DeleteRateModelMasterResult result = client . deleteRateModelMaster (
new DeleteRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
);
RateModelMaster 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DeleteRateModelMasterRequest ;
using Gs2.Gs2Enhance.Result.DeleteRateModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DeleteRateModelMasterResult > asyncResult = null ;
yield return client . DeleteRateModelMaster (
new Gs2 . Gs2Enhance . Request . DeleteRateModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithRateName ( "character-level" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . deleteRateModelMaster (
new Gs2Enhance . DeleteRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . delete_rate_model_master (
enhance . DeleteRateModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_rate_name ( 'character-level' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.delete_rate_model_master ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
})
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 ( 'enhance' )
api_result_handler = client.delete_rate_model_master_async ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
})
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 ;
describeUnleashRateModels 限界突破レートモデルの一覧を取得
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DescribeUnleashRateModels (
& enhance . DescribeUnleashRateModelsRequest {
NamespaceName : pointy . String ( "namespace1" ),
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\DescribeUnleashRateModelsRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeUnleashRateModels (
( new DescribeUnleashRateModelsRequest ())
-> withNamespaceName ( self :: namespace1 )
);
$items = $result -> getItems ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DescribeUnleashRateModelsRequest ;
import io.gs2.enhance.result.DescribeUnleashRateModelsResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
DescribeUnleashRateModelsResult result = client . describeUnleashRateModels (
new DescribeUnleashRateModelsRequest ()
. withNamespaceName ( "namespace1" )
);
List < UnleashRateModel > 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DescribeUnleashRateModelsRequest ;
using Gs2.Gs2Enhance.Result.DescribeUnleashRateModelsResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DescribeUnleashRateModelsResult > asyncResult = null ;
yield return client . DescribeUnleashRateModels (
new Gs2 . Gs2Enhance . Request . DescribeUnleashRateModelsRequest ()
. WithNamespaceName ( "namespace1" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var items = result . Items ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . describeUnleashRateModels (
new Gs2Enhance . DescribeUnleashRateModelsRequest ()
. withNamespaceName ( "namespace1" )
);
const items = result . getItems ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . describe_unleash_rate_models (
enhance . DescribeUnleashRateModelsRequest ()
. with_namespace_name ( self . hash1 )
)
items = result . items
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.describe_unleash_rate_models ({
namespaceName = "namespace1" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
client = gs2 ( 'enhance' )
api_result_handler = client.describe_unleash_rate_models_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
items = result.items ;
getUnleashRateModel 限界突破レートモデルを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 rateName 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . GetUnleashRateModel (
& enhance . GetUnleashRateModelRequest {
NamespaceName : pointy . String ( "namespace1" ),
RateName : pointy . String ( "character-level" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\GetUnleashRateModelRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getUnleashRateModel (
( new GetUnleashRateModelRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withRateName ( "character-level" )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.GetUnleashRateModelRequest ;
import io.gs2.enhance.result.GetUnleashRateModelResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
GetUnleashRateModelResult result = client . getUnleashRateModel (
new GetUnleashRateModelRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
);
UnleashRateModel 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.GetUnleashRateModelRequest ;
using Gs2.Gs2Enhance.Result.GetUnleashRateModelResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . GetUnleashRateModelResult > asyncResult = null ;
yield return client . GetUnleashRateModel (
new Gs2 . Gs2Enhance . Request . GetUnleashRateModelRequest ()
. WithNamespaceName ( "namespace1" )
. WithRateName ( "character-level" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . getUnleashRateModel (
new Gs2Enhance . GetUnleashRateModelRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . get_unleash_rate_model (
enhance . GetUnleashRateModelRequest ()
. with_namespace_name ( self . hash1 )
. with_rate_name ( 'character-level' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.get_unleash_rate_model ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
})
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 ( 'enhance' )
api_result_handler = client.get_unleash_rate_model_async ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
})
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 ;
describeUnleashRateModelMasters 限界突破レートマスターの一覧を取得
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DescribeUnleashRateModelMasters (
& enhance . DescribeUnleashRateModelMastersRequest {
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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\DescribeUnleashRateModelMastersRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeUnleashRateModelMasters (
( new DescribeUnleashRateModelMastersRequest ())
-> 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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DescribeUnleashRateModelMastersRequest ;
import io.gs2.enhance.result.DescribeUnleashRateModelMastersResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
DescribeUnleashRateModelMastersResult result = client . describeUnleashRateModelMasters (
new DescribeUnleashRateModelMastersRequest ()
. withNamespaceName ( "namespace1" )
. withPageToken ( null )
. withLimit ( null )
);
List < UnleashRateModelMaster > 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DescribeUnleashRateModelMastersRequest ;
using Gs2.Gs2Enhance.Result.DescribeUnleashRateModelMastersResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DescribeUnleashRateModelMastersResult > asyncResult = null ;
yield return client . DescribeUnleashRateModelMasters (
new Gs2 . Gs2Enhance . Request . DescribeUnleashRateModelMastersRequest ()
. 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . describeUnleashRateModelMasters (
new Gs2Enhance . DescribeUnleashRateModelMastersRequest ()
. 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 enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . describe_unleash_rate_model_masters (
enhance . DescribeUnleashRateModelMastersRequest ()
. 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 ( 'enhance' )
api_result = client.describe_unleash_rate_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 ( 'enhance' )
api_result_handler = client.describe_unleash_rate_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 ;
createUnleashRateModelMaster 限界突破レートマスターを新規作成
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 name string ✓ ~ 128文字 限界突破レート名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ targetInventoryModelId string ✓ ~ 1024文字 限界突破対象に使用できるインベントリ gradeModelId string ✓ ~ 1024文字 グレードモデル gradeEntries List<UnleashRateEntryModel> ✓ 1 ~ 1000 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . CreateUnleashRateModelMaster (
& enhance . CreateUnleashRateModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
Name : pointy . String ( "character-level" ),
Description : nil ,
Metadata : pointy . String ( "CHARACTER_LEVEL" ),
TargetInventoryModelId : pointy . String ( "grn:inventory:character" ),
GradeModelId : pointy . String ( "grn:grade:character" ),
GradeEntries : [] enhance . UnleashRateEntryModel {
enhance . UnleashRateEntryModel {
GradeValue : pointy . Int64 ( 1 ),
NeedCount : pointy . Int32 ( 2 ),
},
enhance . UnleashRateEntryModel {
GradeValue : pointy . Int64 ( 2 ),
NeedCount : pointy . Int32 ( 2 ),
},
enhance . UnleashRateEntryModel {
GradeValue : pointy . Int64 ( 3 ),
NeedCount : pointy . Int32 ( 3 ),
},
enhance . UnleashRateEntryModel {
GradeValue : pointy . Int64 ( 4 ),
NeedCount : pointy . Int32 ( 3 ),
},
},
}
)
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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\CreateUnleashRateModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> createUnleashRateModelMaster (
( new CreateUnleashRateModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withName ( "character-level" )
-> withDescription ( null )
-> withMetadata ( "CHARACTER_LEVEL" )
-> withTargetInventoryModelId ( "grn:inventory:character" )
-> withGradeModelId ( "grn:grade:character" )
-> withGradeEntries ([
( new \Gs2\Enhance\Model\UnleashRateEntryModel ())
-> withGradeValue ( 1 )
-> withNeedCount ( 2 ),
( new \Gs2\Enhance\Model\UnleashRateEntryModel ())
-> withGradeValue ( 2 )
-> withNeedCount ( 2 ),
( new \Gs2\Enhance\Model\UnleashRateEntryModel ())
-> withGradeValue ( 3 )
-> withNeedCount ( 3 ),
( new \Gs2\Enhance\Model\UnleashRateEntryModel ())
-> withGradeValue ( 4 )
-> withNeedCount ( 3 ),
])
);
$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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.CreateUnleashRateModelMasterRequest ;
import io.gs2.enhance.result.CreateUnleashRateModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
CreateUnleashRateModelMasterResult result = client . createUnleashRateModelMaster (
new CreateUnleashRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withName ( "character-level" )
. withDescription ( null )
. withMetadata ( "CHARACTER_LEVEL" )
. withTargetInventoryModelId ( "grn:inventory:character" )
. withGradeModelId ( "grn:grade:character" )
. withGradeEntries ( Arrays . asList (
new io . gs2 . enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 1L )
. withNeedCount ( 2 ),
new io . gs2 . enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 2L )
. withNeedCount ( 2 ),
new io . gs2 . enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 3L )
. withNeedCount ( 3 ),
new io . gs2 . enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 4L )
. withNeedCount ( 3 )
))
);
UnleashRateModelMaster 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.CreateUnleashRateModelMasterRequest ;
using Gs2.Gs2Enhance.Result.CreateUnleashRateModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . CreateUnleashRateModelMasterResult > asyncResult = null ;
yield return client . CreateUnleashRateModelMaster (
new Gs2 . Gs2Enhance . Request . CreateUnleashRateModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithName ( "character-level" )
. WithDescription ( null )
. WithMetadata ( "CHARACTER_LEVEL" )
. WithTargetInventoryModelId ( "grn:inventory:character" )
. WithGradeModelId ( "grn:grade:character" )
. WithGradeEntries ( new Gs2 . Gs2Enhance . Model . UnleashRateEntryModel [] {
new Gs2 . Gs2Enhance . Model . UnleashRateEntryModel ()
. WithGradeValue ( 1L )
. WithNeedCount ( 2 ),
new Gs2 . Gs2Enhance . Model . UnleashRateEntryModel ()
. WithGradeValue ( 2L )
. WithNeedCount ( 2 ),
new Gs2 . Gs2Enhance . Model . UnleashRateEntryModel ()
. WithGradeValue ( 3L )
. WithNeedCount ( 3 ),
new Gs2 . Gs2Enhance . Model . UnleashRateEntryModel ()
. WithGradeValue ( 4L )
. WithNeedCount ( 3 ),
}),
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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . createUnleashRateModelMaster (
new Gs2Enhance . CreateUnleashRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withName ( "character-level" )
. withDescription ( null )
. withMetadata ( "CHARACTER_LEVEL" )
. withTargetInventoryModelId ( "grn:inventory:character" )
. withGradeModelId ( "grn:grade:character" )
. withGradeEntries ([
new Gs2Enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 1 )
. withNeedCount ( 2 ),
new Gs2Enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 2 )
. withNeedCount ( 2 ),
new Gs2Enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 3 )
. withNeedCount ( 3 ),
new Gs2Enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 4 )
. withNeedCount ( 3 ),
])
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . create_unleash_rate_model_master (
enhance . CreateUnleashRateModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_name ( 'character-level' )
. with_description ( None )
. with_metadata ( 'CHARACTER_LEVEL' )
. with_target_inventory_model_id ( 'grn:inventory:character' )
. with_grade_model_id ( 'grn:grade:character' )
. with_grade_entries ([
enhance . UnleashRateEntryModel ()
. with_grade_value ( 1 )
. with_need_count ( 2 ),
enhance . UnleashRateEntryModel ()
. with_grade_value ( 2 )
. with_need_count ( 2 ),
enhance . UnleashRateEntryModel ()
. with_grade_value ( 3 )
. with_need_count ( 3 ),
enhance . UnleashRateEntryModel ()
. with_grade_value ( 4 )
. with_need_count ( 3 ),
])
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.create_unleash_rate_model_master ({
namespaceName = "namespace1" ,
name = "character-level" ,
description = nil ,
metadata = "CHARACTER_LEVEL" ,
targetInventoryModelId = "grn:inventory:character" ,
gradeModelId = "grn:grade:character" ,
gradeEntries = {
{
gradeValue = 1 ,
needCount = 2 ,
},
{
gradeValue = 2 ,
needCount = 2 ,
},
{
gradeValue = 3 ,
needCount = 3 ,
},
{
gradeValue = 4 ,
needCount = 3 ,
}
},
})
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 ( 'enhance' )
api_result_handler = client.create_unleash_rate_model_master_async ({
namespaceName = "namespace1" ,
name = "character-level" ,
description = nil ,
metadata = "CHARACTER_LEVEL" ,
targetInventoryModelId = "grn:inventory:character" ,
gradeModelId = "grn:grade:character" ,
gradeEntries = {
{
gradeValue = 1 ,
needCount = 2 ,
},
{
gradeValue = 2 ,
needCount = 2 ,
},
{
gradeValue = 3 ,
needCount = 3 ,
},
{
gradeValue = 4 ,
needCount = 3 ,
}
},
})
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 ;
getUnleashRateModelMaster 限界突破レートマスターを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 rateName 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . GetUnleashRateModelMaster (
& enhance . GetUnleashRateModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
RateName : pointy . String ( "character-level" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\GetUnleashRateModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getUnleashRateModelMaster (
( new GetUnleashRateModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withRateName ( "character-level" )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.GetUnleashRateModelMasterRequest ;
import io.gs2.enhance.result.GetUnleashRateModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
GetUnleashRateModelMasterResult result = client . getUnleashRateModelMaster (
new GetUnleashRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
);
UnleashRateModelMaster 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.GetUnleashRateModelMasterRequest ;
using Gs2.Gs2Enhance.Result.GetUnleashRateModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . GetUnleashRateModelMasterResult > asyncResult = null ;
yield return client . GetUnleashRateModelMaster (
new Gs2 . Gs2Enhance . Request . GetUnleashRateModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithRateName ( "character-level" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . getUnleashRateModelMaster (
new Gs2Enhance . GetUnleashRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . get_unleash_rate_model_master (
enhance . GetUnleashRateModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_rate_name ( 'character-level' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.get_unleash_rate_model_master ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
})
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 ( 'enhance' )
api_result_handler = client.get_unleash_rate_model_master_async ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
})
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 ;
updateUnleashRateModelMaster 限界突破レートマスターを更新
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 rateName string ✓ ~ 128文字 限界突破レート名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ targetInventoryModelId string ✓ ~ 1024文字 限界突破対象に使用できるインベントリ gradeModelId string ✓ ~ 1024文字 グレードモデル gradeEntries List<UnleashRateEntryModel> ✓ 1 ~ 1000 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . UpdateUnleashRateModelMaster (
& enhance . UpdateUnleashRateModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
RateName : pointy . String ( "character-level" ),
Description : nil ,
Metadata : nil ,
TargetInventoryModelId : pointy . String ( "grn:inventory:character2" ),
GradeModelId : pointy . String ( "grn:grade:character2" ),
GradeEntries : [] enhance . UnleashRateEntryModel {
enhance . UnleashRateEntryModel {
GradeValue : pointy . Int64 ( 1 ),
NeedCount : pointy . Int32 ( 3 ),
},
enhance . UnleashRateEntryModel {
GradeValue : pointy . Int64 ( 2 ),
NeedCount : pointy . Int32 ( 3 ),
},
enhance . UnleashRateEntryModel {
GradeValue : pointy . Int64 ( 3 ),
NeedCount : pointy . Int32 ( 4 ),
},
enhance . UnleashRateEntryModel {
GradeValue : pointy . Int64 ( 4 ),
NeedCount : pointy . Int32 ( 4 ),
},
},
}
)
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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\UpdateUnleashRateModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateUnleashRateModelMaster (
( new UpdateUnleashRateModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withRateName ( "character-level" )
-> withDescription ( null )
-> withMetadata ( null )
-> withTargetInventoryModelId ( "grn:inventory:character2" )
-> withGradeModelId ( "grn:grade:character2" )
-> withGradeEntries ([
( new \Gs2\Enhance\Model\UnleashRateEntryModel ())
-> withGradeValue ( 1 )
-> withNeedCount ( 3 ),
( new \Gs2\Enhance\Model\UnleashRateEntryModel ())
-> withGradeValue ( 2 )
-> withNeedCount ( 3 ),
( new \Gs2\Enhance\Model\UnleashRateEntryModel ())
-> withGradeValue ( 3 )
-> withNeedCount ( 4 ),
( new \Gs2\Enhance\Model\UnleashRateEntryModel ())
-> withGradeValue ( 4 )
-> withNeedCount ( 4 ),
])
);
$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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.UpdateUnleashRateModelMasterRequest ;
import io.gs2.enhance.result.UpdateUnleashRateModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
UpdateUnleashRateModelMasterResult result = client . updateUnleashRateModelMaster (
new UpdateUnleashRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
. withDescription ( null )
. withMetadata ( null )
. withTargetInventoryModelId ( "grn:inventory:character2" )
. withGradeModelId ( "grn:grade:character2" )
. withGradeEntries ( Arrays . asList (
new io . gs2 . enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 1L )
. withNeedCount ( 3 ),
new io . gs2 . enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 2L )
. withNeedCount ( 3 ),
new io . gs2 . enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 3L )
. withNeedCount ( 4 ),
new io . gs2 . enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 4L )
. withNeedCount ( 4 )
))
);
UnleashRateModelMaster 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.UpdateUnleashRateModelMasterRequest ;
using Gs2.Gs2Enhance.Result.UpdateUnleashRateModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . UpdateUnleashRateModelMasterResult > asyncResult = null ;
yield return client . UpdateUnleashRateModelMaster (
new Gs2 . Gs2Enhance . Request . UpdateUnleashRateModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithRateName ( "character-level" )
. WithDescription ( null )
. WithMetadata ( null )
. WithTargetInventoryModelId ( "grn:inventory:character2" )
. WithGradeModelId ( "grn:grade:character2" )
. WithGradeEntries ( new Gs2 . Gs2Enhance . Model . UnleashRateEntryModel [] {
new Gs2 . Gs2Enhance . Model . UnleashRateEntryModel ()
. WithGradeValue ( 1L )
. WithNeedCount ( 3 ),
new Gs2 . Gs2Enhance . Model . UnleashRateEntryModel ()
. WithGradeValue ( 2L )
. WithNeedCount ( 3 ),
new Gs2 . Gs2Enhance . Model . UnleashRateEntryModel ()
. WithGradeValue ( 3L )
. WithNeedCount ( 4 ),
new Gs2 . Gs2Enhance . Model . UnleashRateEntryModel ()
. WithGradeValue ( 4L )
. WithNeedCount ( 4 ),
}),
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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . updateUnleashRateModelMaster (
new Gs2Enhance . UpdateUnleashRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
. withDescription ( null )
. withMetadata ( null )
. withTargetInventoryModelId ( "grn:inventory:character2" )
. withGradeModelId ( "grn:grade:character2" )
. withGradeEntries ([
new Gs2Enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 1 )
. withNeedCount ( 3 ),
new Gs2Enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 2 )
. withNeedCount ( 3 ),
new Gs2Enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 3 )
. withNeedCount ( 4 ),
new Gs2Enhance . model . UnleashRateEntryModel ()
. withGradeValue ( 4 )
. withNeedCount ( 4 ),
])
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . update_unleash_rate_model_master (
enhance . UpdateUnleashRateModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_rate_name ( 'character-level' )
. with_description ( None )
. with_metadata ( None )
. with_target_inventory_model_id ( 'grn:inventory:character2' )
. with_grade_model_id ( 'grn:grade:character2' )
. with_grade_entries ([
enhance . UnleashRateEntryModel ()
. with_grade_value ( 1 )
. with_need_count ( 3 ),
enhance . UnleashRateEntryModel ()
. with_grade_value ( 2 )
. with_need_count ( 3 ),
enhance . UnleashRateEntryModel ()
. with_grade_value ( 3 )
. with_need_count ( 4 ),
enhance . UnleashRateEntryModel ()
. with_grade_value ( 4 )
. with_need_count ( 4 ),
])
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.update_unleash_rate_model_master ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
description = nil ,
metadata = nil ,
targetInventoryModelId = "grn:inventory:character2" ,
gradeModelId = "grn:grade:character2" ,
gradeEntries = {
{
gradeValue = 1 ,
needCount = 3 ,
},
{
gradeValue = 2 ,
needCount = 3 ,
},
{
gradeValue = 3 ,
needCount = 4 ,
},
{
gradeValue = 4 ,
needCount = 4 ,
}
},
})
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 ( 'enhance' )
api_result_handler = client.update_unleash_rate_model_master_async ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
description = nil ,
metadata = nil ,
targetInventoryModelId = "grn:inventory:character2" ,
gradeModelId = "grn:grade:character2" ,
gradeEntries = {
{
gradeValue = 1 ,
needCount = 3 ,
},
{
gradeValue = 2 ,
needCount = 3 ,
},
{
gradeValue = 3 ,
needCount = 4 ,
},
{
gradeValue = 4 ,
needCount = 4 ,
}
},
})
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 ;
deleteUnleashRateModelMaster 限界突破レートマスターを削除
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 rateName 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DeleteUnleashRateModelMaster (
& enhance . DeleteUnleashRateModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
RateName : pointy . String ( "character-level" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\DeleteUnleashRateModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> deleteUnleashRateModelMaster (
( new DeleteUnleashRateModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withRateName ( "character-level" )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DeleteUnleashRateModelMasterRequest ;
import io.gs2.enhance.result.DeleteUnleashRateModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
DeleteUnleashRateModelMasterResult result = client . deleteUnleashRateModelMaster (
new DeleteUnleashRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
);
UnleashRateModelMaster 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DeleteUnleashRateModelMasterRequest ;
using Gs2.Gs2Enhance.Result.DeleteUnleashRateModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DeleteUnleashRateModelMasterResult > asyncResult = null ;
yield return client . DeleteUnleashRateModelMaster (
new Gs2 . Gs2Enhance . Request . DeleteUnleashRateModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithRateName ( "character-level" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . deleteUnleashRateModelMaster (
new Gs2Enhance . DeleteUnleashRateModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . delete_unleash_rate_model_master (
enhance . DeleteUnleashRateModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_rate_name ( 'character-level' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.delete_unleash_rate_model_master ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
})
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 ( 'enhance' )
api_result_handler = client.delete_unleash_rate_model_master_async ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
})
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 ;
directEnhance 強化を実行
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 rateName string ✓ ~ 128文字 強化レート名 accessToken string ✓ ~ 128文字 ユーザーID targetItemSetId string ✓ ~ 1024文字 強化対象のアイテムセット(有効期限ごとのアイテム所持数量)のGRN materials List<Material> ✓ 1 ~ 10 items 強化素材リスト config List<Config> [] ~ 32 items トランザクションの変数に適用する設定値
Result 型 説明 item RateModel 強化レートモデル transactionId string 発行されたトランザクションID stampSheet string 強化処理の実行に使用するスタンプシート stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN autoRunStampSheet bool? トランザクションの自動実行が有効か atomicCommit bool? トランザクションをアトミックにコミットするか transaction string 発行されたトランザクション transactionResult TransactionResult トランザクション実行結果 acquireExperience long 獲得経験値量 bonusRate float 経験値ボーナスの倍率(1.0=ボーナスなし)
実装例
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DirectEnhance (
& enhance . DirectEnhanceRequest {
NamespaceName : pointy . String ( "namespace1" ),
RateName : pointy . String ( "rate-0001" ),
AccessToken : pointy . String ( "accessToken-0001" ),
TargetItemSetId : pointy . String ( "item-set-0001" ),
Materials : [] enhance . Material {
enhance . Material {
MaterialItemSetId : pointy . String ( "material-0001" ),
Count : pointy . Int32 ( 1 ),
},
},
Config : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
transactionId := result . TransactionId
stampSheet := result . StampSheet
stampSheetEncryptionKeyId := result . StampSheetEncryptionKeyId
autoRunStampSheet := result . AutoRunStampSheet
atomicCommit := result . AtomicCommit
transaction := result . Transaction
transactionResult := result . TransactionResult
acquireExperience := result . AcquireExperience
bonusRate := result . BonusRate
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\DirectEnhanceRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> directEnhance (
( new DirectEnhanceRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withRateName ( "rate-0001" )
-> withAccessToken ( self :: $accessToken0001 )
-> withTargetItemSetId ( "item-set-0001" )
-> withMaterials ([
( new Material ())
-> withMaterialItemSetId ( "material-0001" )
-> withCount ( 1 ),
])
-> withConfig ( null )
);
$item = $result -> getItem ();
$transactionId = $result -> getTransactionId ();
$stampSheet = $result -> getStampSheet ();
$stampSheetEncryptionKeyId = $result -> getStampSheetEncryptionKeyId ();
$autoRunStampSheet = $result -> getAutoRunStampSheet ();
$atomicCommit = $result -> getAtomicCommit ();
$transaction = $result -> getTransaction ();
$transactionResult = $result -> getTransactionResult ();
$acquireExperience = $result -> getAcquireExperience ();
$bonusRate = $result -> getBonusRate ();
} 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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DirectEnhanceRequest ;
import io.gs2.enhance.result.DirectEnhanceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
DirectEnhanceResult result = client . directEnhance (
new DirectEnhanceRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "rate-0001" )
. withAccessToken ( "accessToken-0001" )
. withTargetItemSetId ( "item-set-0001" )
. withMaterials ( Arrays . asList (
new Material ()
. withMaterialItemSetId ( "material-0001" )
. withCount ( 1 )
))
. withConfig ( null )
);
RateModel item = result . getItem ();
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 ();
long acquireExperience = result . getAcquireExperience ();
float bonusRate = result . getBonusRate ();
} 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DirectEnhanceRequest ;
using Gs2.Gs2Enhance.Result.DirectEnhanceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DirectEnhanceResult > asyncResult = null ;
yield return client . DirectEnhance (
new Gs2 . Gs2Enhance . Request . DirectEnhanceRequest ()
. WithNamespaceName ( "namespace1" )
. WithRateName ( "rate-0001" )
. WithAccessToken ( "accessToken-0001" )
. WithTargetItemSetId ( "item-set-0001" )
. WithMaterials ( new Gs2 . Gs2Enhance . Model . Material [] {
new Gs2 . Gs2Enhance . Model . Material ()
. WithMaterialItemSetId ( "material-0001" )
. WithCount ( 1 ),
})
. WithConfig ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
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 ;
var acquireExperience = result . AcquireExperience ;
var bonusRate = result . BonusRate ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . directEnhance (
new Gs2Enhance . DirectEnhanceRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "rate-0001" )
. withAccessToken ( "accessToken-0001" )
. withTargetItemSetId ( "item-set-0001" )
. withMaterials ([
new Gs2Enhance . model . Material ()
. withMaterialItemSetId ( "material-0001" )
. withCount ( 1 ),
])
. withConfig ( null )
);
const item = result . getItem ();
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 ();
const acquireExperience = result . getAcquireExperience ();
const bonusRate = result . getBonusRate ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . direct_enhance (
enhance . DirectEnhanceRequest ()
. with_namespace_name ( self . hash1 )
. with_rate_name ( 'rate-0001' )
. with_access_token ( self . access_token_0001 )
. with_target_item_set_id ( 'item-set-0001' )
. with_materials ([
enhance . Material ()
. with_material_item_set_id ( 'material-0001' )
. with_count ( 1 ),
])
. with_config ( None )
)
item = result . item
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
acquire_experience = result . acquire_experience
bonus_rate = result . bonus_rate
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.direct_enhance ({
namespaceName = "namespace1" ,
rateName = "rate-0001" ,
accessToken = "accessToken-0001" ,
targetItemSetId = "item-set-0001" ,
materials = {
{
material_item_set_id = "material-0001" ,
count = 1 ,
}
},
config = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
acquireExperience = result.acquireExperience ;
bonusRate = result.bonusRate ;
client = gs2 ( 'enhance' )
api_result_handler = client.direct_enhance_async ({
namespaceName = "namespace1" ,
rateName = "rate-0001" ,
accessToken = "accessToken-0001" ,
targetItemSetId = "item-set-0001" ,
materials = {
{
material_item_set_id = "material-0001" ,
count = 1 ,
}
},
config = 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 ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
acquireExperience = result.acquireExperience ;
bonusRate = result.bonusRate ;
directEnhanceByUserId ユーザIDを指定して強化を実行
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 rateName string ✓ ~ 128文字 強化レート名 userId string ✓ ~ 128文字 ユーザーID targetItemSetId string ✓ ~ 1024文字 強化対象のアイテムセット(有効期限ごとのアイテム所持数量)のGRN materials List<Material> ✓ 1 ~ 10 items 強化素材リスト config List<Config> [] ~ 32 items トランザクションの変数に適用する設定値 timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 型 説明 item RateModel 強化レートモデル transactionId string 発行されたトランザクションID stampSheet string 強化処理の実行に使用するスタンプシート stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN autoRunStampSheet bool? トランザクションの自動実行が有効か atomicCommit bool? トランザクションをアトミックにコミットするか transaction string 発行されたトランザクション transactionResult TransactionResult トランザクション実行結果 acquireExperience long 獲得経験値量 bonusRate float 経験値ボーナスの倍率(1.0=ボーナスなし)
実装例
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DirectEnhanceByUserId (
& enhance . DirectEnhanceByUserIdRequest {
NamespaceName : pointy . String ( "namespace1" ),
RateName : pointy . String ( "rate-0001" ),
UserId : pointy . String ( "user-0001" ),
TargetItemSetId : pointy . String ( "item-set-0001" ),
Materials : [] enhance . Material {
enhance . Material {
MaterialItemSetId : pointy . String ( "material-0001" ),
Count : pointy . Int32 ( 1 ),
},
},
Config : nil ,
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
transactionId := result . TransactionId
stampSheet := result . StampSheet
stampSheetEncryptionKeyId := result . StampSheetEncryptionKeyId
autoRunStampSheet := result . AutoRunStampSheet
atomicCommit := result . AtomicCommit
transaction := result . Transaction
transactionResult := result . TransactionResult
acquireExperience := result . AcquireExperience
bonusRate := result . BonusRate
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\DirectEnhanceByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> directEnhanceByUserId (
( new DirectEnhanceByUserIdRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withRateName ( "rate-0001" )
-> withUserId ( "user-0001" )
-> withTargetItemSetId ( "item-set-0001" )
-> withMaterials ([
( new Material ())
-> withMaterialItemSetId ( "material-0001" )
-> withCount ( 1 ),
])
-> withConfig ( null )
-> withTimeOffsetToken ( null )
);
$item = $result -> getItem ();
$transactionId = $result -> getTransactionId ();
$stampSheet = $result -> getStampSheet ();
$stampSheetEncryptionKeyId = $result -> getStampSheetEncryptionKeyId ();
$autoRunStampSheet = $result -> getAutoRunStampSheet ();
$atomicCommit = $result -> getAtomicCommit ();
$transaction = $result -> getTransaction ();
$transactionResult = $result -> getTransactionResult ();
$acquireExperience = $result -> getAcquireExperience ();
$bonusRate = $result -> getBonusRate ();
} 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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DirectEnhanceByUserIdRequest ;
import io.gs2.enhance.result.DirectEnhanceByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
DirectEnhanceByUserIdResult result = client . directEnhanceByUserId (
new DirectEnhanceByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "rate-0001" )
. withUserId ( "user-0001" )
. withTargetItemSetId ( "item-set-0001" )
. withMaterials ( Arrays . asList (
new Material ()
. withMaterialItemSetId ( "material-0001" )
. withCount ( 1 )
))
. withConfig ( null )
. withTimeOffsetToken ( null )
);
RateModel item = result . getItem ();
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 ();
long acquireExperience = result . getAcquireExperience ();
float bonusRate = result . getBonusRate ();
} 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DirectEnhanceByUserIdRequest ;
using Gs2.Gs2Enhance.Result.DirectEnhanceByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DirectEnhanceByUserIdResult > asyncResult = null ;
yield return client . DirectEnhanceByUserId (
new Gs2 . Gs2Enhance . Request . DirectEnhanceByUserIdRequest ()
. WithNamespaceName ( "namespace1" )
. WithRateName ( "rate-0001" )
. WithUserId ( "user-0001" )
. WithTargetItemSetId ( "item-set-0001" )
. WithMaterials ( new Gs2 . Gs2Enhance . Model . Material [] {
new Gs2 . Gs2Enhance . Model . Material ()
. WithMaterialItemSetId ( "material-0001" )
. WithCount ( 1 ),
})
. WithConfig ( null )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
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 ;
var acquireExperience = result . AcquireExperience ;
var bonusRate = result . BonusRate ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . directEnhanceByUserId (
new Gs2Enhance . DirectEnhanceByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "rate-0001" )
. withUserId ( "user-0001" )
. withTargetItemSetId ( "item-set-0001" )
. withMaterials ([
new Gs2Enhance . model . Material ()
. withMaterialItemSetId ( "material-0001" )
. withCount ( 1 ),
])
. withConfig ( null )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
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 ();
const acquireExperience = result . getAcquireExperience ();
const bonusRate = result . getBonusRate ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . direct_enhance_by_user_id (
enhance . DirectEnhanceByUserIdRequest ()
. with_namespace_name ( self . hash1 )
. with_rate_name ( 'rate-0001' )
. with_user_id ( 'user-0001' )
. with_target_item_set_id ( 'item-set-0001' )
. with_materials ([
enhance . Material ()
. with_material_item_set_id ( 'material-0001' )
. with_count ( 1 ),
])
. with_config ( None )
. with_time_offset_token ( None )
)
item = result . item
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
acquire_experience = result . acquire_experience
bonus_rate = result . bonus_rate
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.direct_enhance_by_user_id ({
namespaceName = "namespace1" ,
rateName = "rate-0001" ,
userId = "user-0001" ,
targetItemSetId = "item-set-0001" ,
materials = {
{
material_item_set_id = "material-0001" ,
count = 1 ,
}
},
config = nil ,
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 ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
acquireExperience = result.acquireExperience ;
bonusRate = result.bonusRate ;
client = gs2 ( 'enhance' )
api_result_handler = client.direct_enhance_by_user_id_async ({
namespaceName = "namespace1" ,
rateName = "rate-0001" ,
userId = "user-0001" ,
targetItemSetId = "item-set-0001" ,
materials = {
{
material_item_set_id = "material-0001" ,
count = 1 ,
}
},
config = 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
item = result.item ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
acquireExperience = result.acquireExperience ;
bonusRate = result.bonusRate ;
directEnhanceByStampSheet 入手アクションとして強化を実行
Request 型 有効化条件 必須 デフォルト 値の制限 説明 stampSheet string ✓ ~ 5242880文字 トランザクション keyId string ✓ ~ 1024文字 暗号鍵GRN
Result 型 説明 item RateModel 強化レートモデル transactionId string 発行されたトランザクションID stampSheet string 強化処理の実行に使用するスタンプシート stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN autoRunStampSheet bool? トランザクションの自動実行が有効か atomicCommit bool? トランザクションをアトミックにコミットするか transaction string 発行されたトランザクション transactionResult TransactionResult トランザクション実行結果 acquireExperience long 獲得経験値量 bonusRate float 経験値ボーナスの倍率(1.0=ボーナスなし)
実装例
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DirectEnhanceByStampSheet (
& enhance . DirectEnhanceByStampSheetRequest {
StampSheet : pointy . String ( "stampSheet" ),
KeyId : pointy . String ( "key-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
transactionId := result . TransactionId
stampSheet := result . StampSheet
stampSheetEncryptionKeyId := result . StampSheetEncryptionKeyId
autoRunStampSheet := result . AutoRunStampSheet
atomicCommit := result . AtomicCommit
transaction := result . Transaction
transactionResult := result . TransactionResult
acquireExperience := result . AcquireExperience
bonusRate := result . BonusRate
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\DirectEnhanceByStampSheetRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> directEnhanceByStampSheet (
( new DirectEnhanceByStampSheetRequest ())
-> withStampSheet ( self :: stampSheet )
-> withKeyId ( self :: key - 0001 )
);
$item = $result -> getItem ();
$transactionId = $result -> getTransactionId ();
$stampSheet = $result -> getStampSheet ();
$stampSheetEncryptionKeyId = $result -> getStampSheetEncryptionKeyId ();
$autoRunStampSheet = $result -> getAutoRunStampSheet ();
$atomicCommit = $result -> getAtomicCommit ();
$transaction = $result -> getTransaction ();
$transactionResult = $result -> getTransactionResult ();
$acquireExperience = $result -> getAcquireExperience ();
$bonusRate = $result -> getBonusRate ();
} 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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DirectEnhanceByStampSheetRequest ;
import io.gs2.enhance.result.DirectEnhanceByStampSheetResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
DirectEnhanceByStampSheetResult result = client . directEnhanceByStampSheet (
new DirectEnhanceByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
RateModel item = result . getItem ();
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 ();
long acquireExperience = result . getAcquireExperience ();
float bonusRate = result . getBonusRate ();
} 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DirectEnhanceByStampSheetRequest ;
using Gs2.Gs2Enhance.Result.DirectEnhanceByStampSheetResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DirectEnhanceByStampSheetResult > asyncResult = null ;
yield return client . DirectEnhanceByStampSheet (
new Gs2 . Gs2Enhance . Request . DirectEnhanceByStampSheetRequest ()
. WithStampSheet ( "stampSheet" )
. WithKeyId ( "key-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
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 ;
var acquireExperience = result . AcquireExperience ;
var bonusRate = result . BonusRate ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . directEnhanceByStampSheet (
new Gs2Enhance . DirectEnhanceByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
const item = result . getItem ();
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 ();
const acquireExperience = result . getAcquireExperience ();
const bonusRate = result . getBonusRate ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . direct_enhance_by_stamp_sheet (
enhance . DirectEnhanceByStampSheetRequest ()
. with_stamp_sheet ( self . stamp_sheet )
. with_key_id ( self . key1 . key_id )
)
item = result . item
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
acquire_experience = result . acquire_experience
bonus_rate = result . bonus_rate
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.direct_enhance_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 ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
acquireExperience = result.acquireExperience ;
bonusRate = result.bonusRate ;
client = gs2 ( 'enhance' )
api_result_handler = client.direct_enhance_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 ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
acquireExperience = result.acquireExperience ;
bonusRate = result.bonusRate ;
unleash 限界突破を実行
GS2-Grade で管理するグレードを引き上げる強化処理で利用します。 なかでも、同種アイテムを素材として消費することでレベルキャップを引き上げるタイプの限界突破に利用します。
指定された素材を消費する代わりに限界突破対象のリソースのグレードを1引き上げることができます。 素材となるリソースが経験値などのリソースを持っていたとしても、そのリソースは引き継がれません。 引き継ぎが必要な場合は、事前に別のリソースに引き継ぐためのリソースに変換しておく必要があります。
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 rateName string ✓ ~ 128文字 強化レート名 accessToken string ✓ ~ 128文字 ユーザーID targetItemSetId string ✓ ~ 1024文字 限界突破対象のアイテムセット(有効期限ごとのアイテム所持数量)のGRN materials List<string> ✓ 1 ~ 1000 items 限界突破素材リスト config List<Config> [] ~ 32 items トランザクションの変数に適用する設定値
Result 型 説明 item UnleashRateModel 限界突破レートモデル 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . Unleash (
& enhance . UnleashRequest {
NamespaceName : pointy . String ( "namespace1" ),
RateName : pointy . String ( "rate-0001" ),
AccessToken : pointy . String ( "accessToken-0001" ),
TargetItemSetId : pointy . String ( "item-set-0001" ),
Materials : [] * string {
pointy . String ( "item-set-0002" ),
pointy . String ( "item-set-0003" ),
},
Config : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\UnleashRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> unleash (
( new UnleashRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withRateName ( "rate-0001" )
-> withAccessToken ( self :: $accessToken0001 )
-> withTargetItemSetId ( "item-set-0001" )
-> withMaterials ([
"item-set-0002" ,
"item-set-0003" ,
])
-> withConfig ( null )
);
$item = $result -> getItem ();
$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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.UnleashRequest ;
import io.gs2.enhance.result.UnleashResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
UnleashResult result = client . unleash (
new UnleashRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "rate-0001" )
. withAccessToken ( "accessToken-0001" )
. withTargetItemSetId ( "item-set-0001" )
. withMaterials ( Arrays . asList (
"item-set-0002" ,
"item-set-0003"
))
. withConfig ( null )
);
UnleashRateModel item = result . getItem ();
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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.UnleashRequest ;
using Gs2.Gs2Enhance.Result.UnleashResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . UnleashResult > asyncResult = null ;
yield return client . Unleash (
new Gs2 . Gs2Enhance . Request . UnleashRequest ()
. WithNamespaceName ( "namespace1" )
. WithRateName ( "rate-0001" )
. WithAccessToken ( "accessToken-0001" )
. WithTargetItemSetId ( "item-set-0001" )
. WithMaterials ( new string [] {
"item-set-0002" ,
"item-set-0003" ,
})
. WithConfig ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . unleash (
new Gs2Enhance . UnleashRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "rate-0001" )
. withAccessToken ( "accessToken-0001" )
. withTargetItemSetId ( "item-set-0001" )
. withMaterials ([
"item-set-0002" ,
"item-set-0003" ,
])
. withConfig ( null )
);
const item = result . getItem ();
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 enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . unleash (
enhance . UnleashRequest ()
. with_namespace_name ( self . hash1 )
. with_rate_name ( 'rate-0001' )
. with_access_token ( self . access_token_0001 )
. with_target_item_set_id ( 'item-set-0001' )
. with_materials ([
'item-set-0002' ,
'item-set-0003' ,
])
. with_config ( None )
)
item = result . item
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 ( 'enhance' )
api_result = client.unleash ({
namespaceName = "namespace1" ,
rateName = "rate-0001" ,
accessToken = "accessToken-0001" ,
targetItemSetId = "item-set-0001" ,
materials = {
"item-set-0002" ,
"item-set-0003"
},
config = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
client = gs2 ( 'enhance' )
api_result_handler = client.unleash_async ({
namespaceName = "namespace1" ,
rateName = "rate-0001" ,
accessToken = "accessToken-0001" ,
targetItemSetId = "item-set-0001" ,
materials = {
"item-set-0002" ,
"item-set-0003"
},
config = 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 ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
unleashByUserId ユーザーIDを指定して限界突破を実行
GS2-Grade で管理するグレードを引き上げる強化処理で利用します。 なかでも、同種アイテムを素材として消費することでレベルキャップを引き上げるタイプの限界突破に利用します。
指定された素材を消費する代わりに限界突破対象のリソースのグレードを1引き上げることができます。 素材となるリソースが経験値などのリソースを持っていたとしても、そのリソースは引き継がれません。 引き継ぎが必要な場合は、事前に別のリソースに引き継ぐためのリソースに変換しておく必要があります。
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 rateName string ✓ ~ 128文字 強化レート名 userId string ✓ ~ 128文字 ユーザーID targetItemSetId string ✓ ~ 1024文字 限界突破対象のアイテムセット(有効期限ごとのアイテム所持数量)のGRN materials List<string> ✓ 1 ~ 1000 items 限界突破素材リスト config List<Config> [] ~ 32 items トランザクションの変数に適用する設定値 timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 型 説明 item UnleashRateModel 限界突破レートモデル 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . UnleashByUserId (
& enhance . UnleashByUserIdRequest {
NamespaceName : pointy . String ( "namespace1" ),
RateName : pointy . String ( "rate-0001" ),
UserId : pointy . String ( "user-0001" ),
TargetItemSetId : pointy . String ( "item-set-0001" ),
Materials : [] * string {
pointy . String ( "item-set-0002" ),
pointy . String ( "item-set-0003" ),
},
Config : nil ,
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\UnleashByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> unleashByUserId (
( new UnleashByUserIdRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withRateName ( "rate-0001" )
-> withUserId ( "user-0001" )
-> withTargetItemSetId ( "item-set-0001" )
-> withMaterials ([
"item-set-0002" ,
"item-set-0003" ,
])
-> withConfig ( null )
-> withTimeOffsetToken ( null )
);
$item = $result -> getItem ();
$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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.UnleashByUserIdRequest ;
import io.gs2.enhance.result.UnleashByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
UnleashByUserIdResult result = client . unleashByUserId (
new UnleashByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "rate-0001" )
. withUserId ( "user-0001" )
. withTargetItemSetId ( "item-set-0001" )
. withMaterials ( Arrays . asList (
"item-set-0002" ,
"item-set-0003"
))
. withConfig ( null )
. withTimeOffsetToken ( null )
);
UnleashRateModel item = result . getItem ();
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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.UnleashByUserIdRequest ;
using Gs2.Gs2Enhance.Result.UnleashByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . UnleashByUserIdResult > asyncResult = null ;
yield return client . UnleashByUserId (
new Gs2 . Gs2Enhance . Request . UnleashByUserIdRequest ()
. WithNamespaceName ( "namespace1" )
. WithRateName ( "rate-0001" )
. WithUserId ( "user-0001" )
. WithTargetItemSetId ( "item-set-0001" )
. WithMaterials ( new string [] {
"item-set-0002" ,
"item-set-0003" ,
})
. WithConfig ( null )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . unleashByUserId (
new Gs2Enhance . UnleashByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "rate-0001" )
. withUserId ( "user-0001" )
. withTargetItemSetId ( "item-set-0001" )
. withMaterials ([
"item-set-0002" ,
"item-set-0003" ,
])
. withConfig ( null )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
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 enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . unleash_by_user_id (
enhance . UnleashByUserIdRequest ()
. with_namespace_name ( self . hash1 )
. with_rate_name ( 'rate-0001' )
. with_user_id ( 'user-0001' )
. with_target_item_set_id ( 'item-set-0001' )
. with_materials ([
'item-set-0002' ,
'item-set-0003' ,
])
. with_config ( None )
. with_time_offset_token ( None )
)
item = result . item
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 ( 'enhance' )
api_result = client.unleash_by_user_id ({
namespaceName = "namespace1" ,
rateName = "rate-0001" ,
userId = "user-0001" ,
targetItemSetId = "item-set-0001" ,
materials = {
"item-set-0002" ,
"item-set-0003"
},
config = nil ,
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 ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
client = gs2 ( 'enhance' )
api_result_handler = client.unleash_by_user_id_async ({
namespaceName = "namespace1" ,
rateName = "rate-0001" ,
userId = "user-0001" ,
targetItemSetId = "item-set-0001" ,
materials = {
"item-set-0002" ,
"item-set-0003"
},
config = 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
item = result.item ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
unleashByStampSheet 入手アクションとして限界突破を実行
Request 型 有効化条件 必須 デフォルト 値の制限 説明 stampSheet string ✓ ~ 5242880文字 トランザクション keyId string ✓ ~ 1024文字 暗号鍵GRN
Result 型 説明 item UnleashRateModel 限界突破レートモデル 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . UnleashByStampSheet (
& enhance . UnleashByStampSheetRequest {
StampSheet : pointy . String ( "stampSheet" ),
KeyId : pointy . String ( "key-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\UnleashByStampSheetRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> unleashByStampSheet (
( new UnleashByStampSheetRequest ())
-> withStampSheet ( self :: stampSheet )
-> withKeyId ( self :: key - 0001 )
);
$item = $result -> getItem ();
$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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.UnleashByStampSheetRequest ;
import io.gs2.enhance.result.UnleashByStampSheetResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
UnleashByStampSheetResult result = client . unleashByStampSheet (
new UnleashByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
UnleashRateModel item = result . getItem ();
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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.UnleashByStampSheetRequest ;
using Gs2.Gs2Enhance.Result.UnleashByStampSheetResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . UnleashByStampSheetResult > asyncResult = null ;
yield return client . UnleashByStampSheet (
new Gs2 . Gs2Enhance . Request . UnleashByStampSheetRequest ()
. WithStampSheet ( "stampSheet" )
. WithKeyId ( "key-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . unleashByStampSheet (
new Gs2Enhance . UnleashByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
const item = result . getItem ();
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 enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . unleash_by_stamp_sheet (
enhance . UnleashByStampSheetRequest ()
. with_stamp_sheet ( self . stamp_sheet )
. with_key_id ( self . key1 . key_id )
)
item = result . item
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 ( 'enhance' )
api_result = client.unleash_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 ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
client = gs2 ( 'enhance' )
api_result_handler = client.unleash_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 ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
createProgressByUserId ユーザIDを指定して強化を開始
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 userId string ✓ ~ 128文字 ユーザーID rateName string ✓ ~ 128文字 レートモデル名 targetItemSetId string ✓ ~ 1024文字 強化対象のアイテムセット(有効期限ごとのアイテム所持数量)のGRN materials List<Material> ~ 10 items 強化素材リスト force bool ✓ false すでに開始している強化がある場合にそれを破棄して開始するか 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . CreateProgressByUserId (
& enhance . CreateProgressByUserIdRequest {
NamespaceName : pointy . String ( "namespace1" ),
UserId : pointy . String ( "user-0001" ),
RateName : pointy . String ( "character-level" ),
TargetItemSetId : pointy . String ( "item-set-0001" ),
Materials : [] enhance . Material {
enhance . Material {
MaterialItemSetId : pointy . String ( "material-0001" ),
Count : pointy . Int32 ( 1 ),
},
},
Force : nil ,
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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\CreateProgressByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> createProgressByUserId (
( new CreateProgressByUserIdRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withUserId ( "user-0001" )
-> withRateName ( "character-level" )
-> withTargetItemSetId ( "item-set-0001" )
-> withMaterials ([
( new Material ())
-> withMaterialItemSetId ( "material-0001" )
-> withCount ( 1 ),
])
-> withForce ( null )
-> 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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.CreateProgressByUserIdRequest ;
import io.gs2.enhance.result.CreateProgressByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
CreateProgressByUserIdResult result = client . createProgressByUserId (
new CreateProgressByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withRateName ( "character-level" )
. withTargetItemSetId ( "item-set-0001" )
. withMaterials ( Arrays . asList (
new Material ()
. withMaterialItemSetId ( "material-0001" )
. withCount ( 1 )
))
. withForce ( null )
. withTimeOffsetToken ( null )
);
Progress 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.CreateProgressByUserIdRequest ;
using Gs2.Gs2Enhance.Result.CreateProgressByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . CreateProgressByUserIdResult > asyncResult = null ;
yield return client . CreateProgressByUserId (
new Gs2 . Gs2Enhance . Request . CreateProgressByUserIdRequest ()
. WithNamespaceName ( "namespace1" )
. WithUserId ( "user-0001" )
. WithRateName ( "character-level" )
. WithTargetItemSetId ( "item-set-0001" )
. WithMaterials ( new Gs2 . Gs2Enhance . Model . Material [] {
new Gs2 . Gs2Enhance . Model . Material ()
. WithMaterialItemSetId ( "material-0001" )
. WithCount ( 1 ),
})
. WithForce ( null )
. 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . createProgressByUserId (
new Gs2Enhance . CreateProgressByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withRateName ( "character-level" )
. withTargetItemSetId ( "item-set-0001" )
. withMaterials ([
new Gs2Enhance . model . Material ()
. withMaterialItemSetId ( "material-0001" )
. withCount ( 1 ),
])
. withForce ( null )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . create_progress_by_user_id (
enhance . CreateProgressByUserIdRequest ()
. with_namespace_name ( self . hash1 )
. with_user_id ( 'user-0001' )
. with_rate_name ( 'character-level' )
. with_target_item_set_id ( 'item-set-0001' )
. with_materials ([
enhance . Material ()
. with_material_item_set_id ( 'material-0001' )
. with_count ( 1 ),
])
. with_force ( None )
. with_time_offset_token ( None )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.create_progress_by_user_id ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
rateName = "character-level" ,
targetItemSetId = "item-set-0001" ,
materials = {
{
material_item_set_id = "material-0001" ,
count = 1 ,
}
},
force = nil ,
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 ( 'enhance' )
api_result_handler = client.create_progress_by_user_id_async ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
rateName = "character-level" ,
targetItemSetId = "item-set-0001" ,
materials = {
{
material_item_set_id = "material-0001" ,
count = 1 ,
}
},
force = 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
item = result.item ;
getProgress 実行中の強化を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 accessToken string ✓ ~ 128文字 ユーザー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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . GetProgress (
& enhance . GetProgressRequest {
NamespaceName : pointy . String ( "namespace1" ),
AccessToken : pointy . String ( "accessToken-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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\GetProgressRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getProgress (
( new GetProgressRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withAccessToken ( self :: $accessToken0001 )
);
$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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.GetProgressRequest ;
import io.gs2.enhance.result.GetProgressResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
GetProgressResult result = client . getProgress (
new GetProgressRequest ()
. withNamespaceName ( "namespace1" )
. withAccessToken ( "accessToken-0001" )
);
Progress 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.GetProgressRequest ;
using Gs2.Gs2Enhance.Result.GetProgressResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . GetProgressResult > asyncResult = null ;
yield return client . GetProgress (
new Gs2 . Gs2Enhance . Request . GetProgressRequest ()
. WithNamespaceName ( "namespace1" )
. WithAccessToken ( "accessToken-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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . getProgress (
new Gs2Enhance . GetProgressRequest ()
. withNamespaceName ( "namespace1" )
. withAccessToken ( "accessToken-0001" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . get_progress (
enhance . GetProgressRequest ()
. with_namespace_name ( self . hash1 )
. with_access_token ( self . access_token_0001 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.get_progress ({
namespaceName = "namespace1" ,
accessToken = "accessToken-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 ( 'enhance' )
api_result_handler = client.get_progress_async ({
namespaceName = "namespace1" ,
accessToken = "accessToken-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 ;
getProgressByUserId ユーザIDを指定して実行中の強化を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . GetProgressByUserId (
& enhance . GetProgressByUserIdRequest {
NamespaceName : pointy . String ( "namespace2" ),
UserId : pointy . String ( "user-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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\GetProgressByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getProgressByUserId (
( new GetProgressByUserIdRequest ())
-> withNamespaceName ( self :: namespace2 )
-> withUserId ( "user-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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.GetProgressByUserIdRequest ;
import io.gs2.enhance.result.GetProgressByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
GetProgressByUserIdResult result = client . getProgressByUserId (
new GetProgressByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
Progress 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.GetProgressByUserIdRequest ;
using Gs2.Gs2Enhance.Result.GetProgressByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . GetProgressByUserIdResult > asyncResult = null ;
yield return client . GetProgressByUserId (
new Gs2 . Gs2Enhance . Request . GetProgressByUserIdRequest ()
. WithNamespaceName ( "namespace2" )
. WithUserId ( "user-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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . getProgressByUserId (
new Gs2Enhance . GetProgressByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . get_progress_by_user_id (
enhance . GetProgressByUserIdRequest ()
. with_namespace_name ( self . hash2 )
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.get_progress_by_user_id ({
namespaceName = "namespace2" ,
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
item = result.item ;
client = gs2 ( 'enhance' )
api_result_handler = client.get_progress_by_user_id_async ({
namespaceName = "namespace2" ,
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
item = result.item ;
start 強化を開始
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 rateName string ✓ ~ 128文字 レートモデル名 targetItemSetId string ✓ ~ 1024文字 強化対象のアイテムセット(有効期限ごとのアイテム所持数量)のGRN materials List<Material> ~ 10 items 強化素材リスト accessToken string ✓ ~ 128文字 ユーザーID force bool ✓ false すでに開始している強化がある場合にそれを破棄して開始するか config List<Config> [] ~ 32 items トランザクションの変数に適用する設定値
Result 型 説明 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . Start (
& enhance . StartRequest {
NamespaceName : pointy . String ( "namespace1" ),
RateName : pointy . String ( "character-level" ),
TargetItemSetId : pointy . String ( "item-set-0001" ),
Materials : [] enhance . Material {
enhance . Material {
MaterialItemSetId : pointy . String ( "material-0001" ),
Count : pointy . Int32 ( 1 ),
},
},
AccessToken : pointy . String ( "accessToken-0001" ),
Force : nil ,
Config : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\StartRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> start (
( new StartRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withRateName ( "character-level" )
-> withTargetItemSetId ( "item-set-0001" )
-> withMaterials ([
( new Material ())
-> withMaterialItemSetId ( "material-0001" )
-> withCount ( 1 ),
])
-> withAccessToken ( self :: $accessToken0001 )
-> withForce ( null )
-> withConfig ( null )
);
$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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.StartRequest ;
import io.gs2.enhance.result.StartResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
StartResult result = client . start (
new StartRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
. withTargetItemSetId ( "item-set-0001" )
. withMaterials ( Arrays . asList (
new Material ()
. withMaterialItemSetId ( "material-0001" )
. withCount ( 1 )
))
. withAccessToken ( "accessToken-0001" )
. withForce ( null )
. withConfig ( null )
);
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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.StartRequest ;
using Gs2.Gs2Enhance.Result.StartResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . StartResult > asyncResult = null ;
yield return client . Start (
new Gs2 . Gs2Enhance . Request . StartRequest ()
. WithNamespaceName ( "namespace1" )
. WithRateName ( "character-level" )
. WithTargetItemSetId ( "item-set-0001" )
. WithMaterials ( new Gs2 . Gs2Enhance . Model . Material [] {
new Gs2 . Gs2Enhance . Model . Material ()
. WithMaterialItemSetId ( "material-0001" )
. WithCount ( 1 ),
})
. WithAccessToken ( "accessToken-0001" )
. WithForce ( null )
. WithConfig ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . start (
new Gs2Enhance . StartRequest ()
. withNamespaceName ( "namespace1" )
. withRateName ( "character-level" )
. withTargetItemSetId ( "item-set-0001" )
. withMaterials ([
new Gs2Enhance . model . Material ()
. withMaterialItemSetId ( "material-0001" )
. withCount ( 1 ),
])
. withAccessToken ( "accessToken-0001" )
. withForce ( null )
. withConfig ( null )
);
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 enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . start (
enhance . StartRequest ()
. with_namespace_name ( self . hash1 )
. with_rate_name ( 'character-level' )
. with_target_item_set_id ( 'item-set-0001' )
. with_materials ([
enhance . Material ()
. with_material_item_set_id ( 'material-0001' )
. with_count ( 1 ),
])
. with_access_token ( self . access_token_0001 )
. with_force ( None )
. with_config ( None )
)
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 ( 'enhance' )
api_result = client.start ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
targetItemSetId = "item-set-0001" ,
materials = {
{
material_item_set_id = "material-0001" ,
count = 1 ,
}
},
accessToken = "accessToken-0001" ,
force = nil ,
config = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
client = gs2 ( 'enhance' )
api_result_handler = client.start_async ({
namespaceName = "namespace1" ,
rateName = "character-level" ,
targetItemSetId = "item-set-0001" ,
materials = {
{
material_item_set_id = "material-0001" ,
count = 1 ,
}
},
accessToken = "accessToken-0001" ,
force = nil ,
config = 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
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
startByUserId ユーザIDを指定して強化を開始
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 rateName string ✓ ~ 128文字 レートモデル名 targetItemSetId string ✓ ~ 1024文字 強化対象のアイテムセット(有効期限ごとのアイテム所持数量)のGRN materials List<Material> ~ 10 items 強化素材リスト userId string ✓ ~ 128文字 ユーザーID force bool ✓ false すでに開始している強化がある場合にそれを破棄して開始するか config List<Config> [] ~ 32 items トランザクションの変数に適用する設定値 timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 型 説明 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . StartByUserId (
& enhance . StartByUserIdRequest {
NamespaceName : pointy . String ( "namespace2" ),
RateName : pointy . String ( "character-level" ),
TargetItemSetId : pointy . String ( "item-set-0001" ),
Materials : [] enhance . Material {
enhance . Material {
MaterialItemSetId : pointy . String ( "material-0001" ),
Count : pointy . Int32 ( 1 ),
},
},
UserId : pointy . String ( "user-0001" ),
Force : nil ,
Config : nil ,
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\StartByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> startByUserId (
( new StartByUserIdRequest ())
-> withNamespaceName ( self :: namespace2 )
-> withRateName ( "character-level" )
-> withTargetItemSetId ( "item-set-0001" )
-> withMaterials ([
( new Material ())
-> withMaterialItemSetId ( "material-0001" )
-> withCount ( 1 ),
])
-> withUserId ( "user-0001" )
-> withForce ( null )
-> withConfig ( null )
-> withTimeOffsetToken ( null )
);
$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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.StartByUserIdRequest ;
import io.gs2.enhance.result.StartByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
StartByUserIdResult result = client . startByUserId (
new StartByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withRateName ( "character-level" )
. withTargetItemSetId ( "item-set-0001" )
. withMaterials ( Arrays . asList (
new Material ()
. withMaterialItemSetId ( "material-0001" )
. withCount ( 1 )
))
. withUserId ( "user-0001" )
. withForce ( null )
. withConfig ( null )
. withTimeOffsetToken ( null )
);
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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.StartByUserIdRequest ;
using Gs2.Gs2Enhance.Result.StartByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . StartByUserIdResult > asyncResult = null ;
yield return client . StartByUserId (
new Gs2 . Gs2Enhance . Request . StartByUserIdRequest ()
. WithNamespaceName ( "namespace2" )
. WithRateName ( "character-level" )
. WithTargetItemSetId ( "item-set-0001" )
. WithMaterials ( new Gs2 . Gs2Enhance . Model . Material [] {
new Gs2 . Gs2Enhance . Model . Material ()
. WithMaterialItemSetId ( "material-0001" )
. WithCount ( 1 ),
})
. WithUserId ( "user-0001" )
. WithForce ( null )
. WithConfig ( null )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . startByUserId (
new Gs2Enhance . StartByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withRateName ( "character-level" )
. withTargetItemSetId ( "item-set-0001" )
. withMaterials ([
new Gs2Enhance . model . Material ()
. withMaterialItemSetId ( "material-0001" )
. withCount ( 1 ),
])
. withUserId ( "user-0001" )
. withForce ( null )
. withConfig ( null )
. withTimeOffsetToken ( null )
);
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 enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . start_by_user_id (
enhance . StartByUserIdRequest ()
. with_namespace_name ( self . hash2 )
. with_rate_name ( 'character-level' )
. with_target_item_set_id ( 'item-set-0001' )
. with_materials ([
enhance . Material ()
. with_material_item_set_id ( 'material-0001' )
. with_count ( 1 ),
])
. with_user_id ( 'user-0001' )
. with_force ( None )
. with_config ( None )
. with_time_offset_token ( None )
)
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 ( 'enhance' )
api_result = client.start_by_user_id ({
namespaceName = "namespace2" ,
rateName = "character-level" ,
targetItemSetId = "item-set-0001" ,
materials = {
{
material_item_set_id = "material-0001" ,
count = 1 ,
}
},
userId = "user-0001" ,
force = nil ,
config = nil ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
client = gs2 ( 'enhance' )
api_result_handler = client.start_by_user_id_async ({
namespaceName = "namespace2" ,
rateName = "character-level" ,
targetItemSetId = "item-set-0001" ,
materials = {
{
material_item_set_id = "material-0001" ,
count = 1 ,
}
},
userId = "user-0001" ,
force = nil ,
config = 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
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
end 強化を完了
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 accessToken string ✓ ~ 128文字 ユーザーID config List<Config> [] ~ 32 items トランザクションの変数に適用する設定値
Result 型 説明 item Progress 実行中の強化 transactionId string 発行されたトランザクションID stampSheet string 報酬付与処理の実行に使用するスタンプシート stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN autoRunStampSheet bool? トランザクションの自動実行が有効か atomicCommit bool? トランザクションをアトミックにコミットするか transaction string 発行されたトランザクション transactionResult TransactionResult トランザクション実行結果 acquireExperience long 獲得経験値量 bonusRate float 経験値ボーナスの倍率(1.0=ボーナスなし)
実装例
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . End (
& enhance . EndRequest {
NamespaceName : pointy . String ( "namespace2" ),
AccessToken : pointy . String ( "accessToken-0001" ),
Config : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
transactionId := result . TransactionId
stampSheet := result . StampSheet
stampSheetEncryptionKeyId := result . StampSheetEncryptionKeyId
autoRunStampSheet := result . AutoRunStampSheet
atomicCommit := result . AtomicCommit
transaction := result . Transaction
transactionResult := result . TransactionResult
acquireExperience := result . AcquireExperience
bonusRate := result . BonusRate
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\EndRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> end (
( new EndRequest ())
-> withNamespaceName ( self :: namespace2 )
-> withAccessToken ( self :: $accessToken0001 )
-> withConfig ( null )
);
$item = $result -> getItem ();
$transactionId = $result -> getTransactionId ();
$stampSheet = $result -> getStampSheet ();
$stampSheetEncryptionKeyId = $result -> getStampSheetEncryptionKeyId ();
$autoRunStampSheet = $result -> getAutoRunStampSheet ();
$atomicCommit = $result -> getAtomicCommit ();
$transaction = $result -> getTransaction ();
$transactionResult = $result -> getTransactionResult ();
$acquireExperience = $result -> getAcquireExperience ();
$bonusRate = $result -> getBonusRate ();
} 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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.EndRequest ;
import io.gs2.enhance.result.EndResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
EndResult result = client . end (
new EndRequest ()
. withNamespaceName ( "namespace2" )
. withAccessToken ( "accessToken-0001" )
. withConfig ( null )
);
Progress item = result . getItem ();
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 ();
long acquireExperience = result . getAcquireExperience ();
float bonusRate = result . getBonusRate ();
} 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.EndRequest ;
using Gs2.Gs2Enhance.Result.EndResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . EndResult > asyncResult = null ;
yield return client . End (
new Gs2 . Gs2Enhance . Request . EndRequest ()
. WithNamespaceName ( "namespace2" )
. WithAccessToken ( "accessToken-0001" )
. WithConfig ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
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 ;
var acquireExperience = result . AcquireExperience ;
var bonusRate = result . BonusRate ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . end (
new Gs2Enhance . EndRequest ()
. withNamespaceName ( "namespace2" )
. withAccessToken ( "accessToken-0001" )
. withConfig ( null )
);
const item = result . getItem ();
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 ();
const acquireExperience = result . getAcquireExperience ();
const bonusRate = result . getBonusRate ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . end (
enhance . EndRequest ()
. with_namespace_name ( self . hash2 )
. with_access_token ( self . access_token_0001 )
. with_config ( None )
)
item = result . item
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
acquire_experience = result . acquire_experience
bonus_rate = result . bonus_rate
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.end ({
namespaceName = "namespace2" ,
accessToken = "accessToken-0001" ,
config = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
acquireExperience = result.acquireExperience ;
bonusRate = result.bonusRate ;
client = gs2 ( 'enhance' )
api_result_handler = client.end_async ({
namespaceName = "namespace2" ,
accessToken = "accessToken-0001" ,
config = 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 ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
acquireExperience = result.acquireExperience ;
bonusRate = result.bonusRate ;
endByUserId ユーザIDを指定して強化を完了
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 userId string ✓ ~ 128文字 ユーザーID config List<Config> [] ~ 32 items トランザクションの変数に適用する設定値 timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 型 説明 item Progress 実行中の強化 transactionId string 発行されたトランザクションID stampSheet string 報酬付与処理の実行に使用するスタンプシート stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN autoRunStampSheet bool? トランザクションの自動実行が有効か atomicCommit bool? トランザクションをアトミックにコミットするか transaction string 発行されたトランザクション transactionResult TransactionResult トランザクション実行結果 acquireExperience long 獲得経験値量 bonusRate float 経験値ボーナスの倍率(1.0=ボーナスなし)
実装例
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . EndByUserId (
& enhance . EndByUserIdRequest {
NamespaceName : pointy . String ( "namespace2" ),
UserId : pointy . String ( "user-0001" ),
Config : nil ,
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
transactionId := result . TransactionId
stampSheet := result . StampSheet
stampSheetEncryptionKeyId := result . StampSheetEncryptionKeyId
autoRunStampSheet := result . AutoRunStampSheet
atomicCommit := result . AtomicCommit
transaction := result . Transaction
transactionResult := result . TransactionResult
acquireExperience := result . AcquireExperience
bonusRate := result . BonusRate
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\EndByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> endByUserId (
( new EndByUserIdRequest ())
-> withNamespaceName ( self :: namespace2 )
-> withUserId ( "user-0001" )
-> withConfig ( null )
-> withTimeOffsetToken ( null )
);
$item = $result -> getItem ();
$transactionId = $result -> getTransactionId ();
$stampSheet = $result -> getStampSheet ();
$stampSheetEncryptionKeyId = $result -> getStampSheetEncryptionKeyId ();
$autoRunStampSheet = $result -> getAutoRunStampSheet ();
$atomicCommit = $result -> getAtomicCommit ();
$transaction = $result -> getTransaction ();
$transactionResult = $result -> getTransactionResult ();
$acquireExperience = $result -> getAcquireExperience ();
$bonusRate = $result -> getBonusRate ();
} 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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.EndByUserIdRequest ;
import io.gs2.enhance.result.EndByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
EndByUserIdResult result = client . endByUserId (
new EndByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withUserId ( "user-0001" )
. withConfig ( null )
. withTimeOffsetToken ( null )
);
Progress item = result . getItem ();
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 ();
long acquireExperience = result . getAcquireExperience ();
float bonusRate = result . getBonusRate ();
} 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.EndByUserIdRequest ;
using Gs2.Gs2Enhance.Result.EndByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . EndByUserIdResult > asyncResult = null ;
yield return client . EndByUserId (
new Gs2 . Gs2Enhance . Request . EndByUserIdRequest ()
. WithNamespaceName ( "namespace2" )
. WithUserId ( "user-0001" )
. WithConfig ( null )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
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 ;
var acquireExperience = result . AcquireExperience ;
var bonusRate = result . BonusRate ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . endByUserId (
new Gs2Enhance . EndByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withUserId ( "user-0001" )
. withConfig ( null )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
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 ();
const acquireExperience = result . getAcquireExperience ();
const bonusRate = result . getBonusRate ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . end_by_user_id (
enhance . EndByUserIdRequest ()
. with_namespace_name ( self . hash2 )
. with_user_id ( 'user-0001' )
. with_config ( None )
. with_time_offset_token ( None )
)
item = result . item
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
acquire_experience = result . acquire_experience
bonus_rate = result . bonus_rate
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.end_by_user_id ({
namespaceName = "namespace2" ,
userId = "user-0001" ,
config = nil ,
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 ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
acquireExperience = result.acquireExperience ;
bonusRate = result.bonusRate ;
client = gs2 ( 'enhance' )
api_result_handler = client.end_by_user_id_async ({
namespaceName = "namespace2" ,
userId = "user-0001" ,
config = 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
item = result.item ;
transactionId = result.transactionId ;
stampSheet = result.stampSheet ;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId ;
autoRunStampSheet = result.autoRunStampSheet ;
atomicCommit = result.atomicCommit ;
transaction = result.transaction ;
transactionResult = result.transactionResult ;
acquireExperience = result.acquireExperience ;
bonusRate = result.bonusRate ;
deleteProgress 実行中の強化を削除
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 accessToken string ✓ ~ 128文字 ユーザー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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DeleteProgress (
& enhance . DeleteProgressRequest {
NamespaceName : pointy . String ( "namespace1" ),
AccessToken : pointy . String ( "accessToken-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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\DeleteProgressRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> deleteProgress (
( new DeleteProgressRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withAccessToken ( self :: $accessToken0001 )
);
$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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DeleteProgressRequest ;
import io.gs2.enhance.result.DeleteProgressResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
DeleteProgressResult result = client . deleteProgress (
new DeleteProgressRequest ()
. withNamespaceName ( "namespace1" )
. withAccessToken ( "accessToken-0001" )
);
Progress 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DeleteProgressRequest ;
using Gs2.Gs2Enhance.Result.DeleteProgressResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DeleteProgressResult > asyncResult = null ;
yield return client . DeleteProgress (
new Gs2 . Gs2Enhance . Request . DeleteProgressRequest ()
. WithNamespaceName ( "namespace1" )
. WithAccessToken ( "accessToken-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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . deleteProgress (
new Gs2Enhance . DeleteProgressRequest ()
. withNamespaceName ( "namespace1" )
. withAccessToken ( "accessToken-0001" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . delete_progress (
enhance . DeleteProgressRequest ()
. with_namespace_name ( self . hash1 )
. with_access_token ( self . access_token_0001 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.delete_progress ({
namespaceName = "namespace1" ,
accessToken = "accessToken-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 ( 'enhance' )
api_result_handler = client.delete_progress_async ({
namespaceName = "namespace1" ,
accessToken = "accessToken-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 ;
deleteProgressByUserId ユーザIDを指定して実行中の強化を削除
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DeleteProgressByUserId (
& enhance . DeleteProgressByUserIdRequest {
NamespaceName : pointy . String ( "namespace2" ),
UserId : pointy . String ( "user-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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\DeleteProgressByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> deleteProgressByUserId (
( new DeleteProgressByUserIdRequest ())
-> withNamespaceName ( self :: namespace2 )
-> withUserId ( "user-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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DeleteProgressByUserIdRequest ;
import io.gs2.enhance.result.DeleteProgressByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
DeleteProgressByUserIdResult result = client . deleteProgressByUserId (
new DeleteProgressByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
Progress 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DeleteProgressByUserIdRequest ;
using Gs2.Gs2Enhance.Result.DeleteProgressByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DeleteProgressByUserIdResult > asyncResult = null ;
yield return client . DeleteProgressByUserId (
new Gs2 . Gs2Enhance . Request . DeleteProgressByUserIdRequest ()
. WithNamespaceName ( "namespace2" )
. WithUserId ( "user-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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . deleteProgressByUserId (
new Gs2Enhance . DeleteProgressByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . delete_progress_by_user_id (
enhance . DeleteProgressByUserIdRequest ()
. with_namespace_name ( self . hash2 )
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.delete_progress_by_user_id ({
namespaceName = "namespace2" ,
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
item = result.item ;
client = gs2 ( 'enhance' )
api_result_handler = client.delete_progress_by_user_id_async ({
namespaceName = "namespace2" ,
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
item = result.item ;
createProgressByStampSheet 入手アクションとして強化を開始
Request 型 有効化条件 必須 デフォルト 値の制限 説明 stampSheet string ✓ ~ 5242880文字 トランザクション keyId string ✓ ~ 1024文字 暗号鍵GRN
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . CreateProgressByStampSheet (
& enhance . CreateProgressByStampSheetRequest {
StampSheet : pointy . String ( "stampSheet" ),
KeyId : pointy . String ( "key-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\CreateProgressByStampSheetRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> createProgressByStampSheet (
( new CreateProgressByStampSheetRequest ())
-> withStampSheet ( self :: stampSheet )
-> withKeyId ( self :: key - 0001 )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.CreateProgressByStampSheetRequest ;
import io.gs2.enhance.result.CreateProgressByStampSheetResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
CreateProgressByStampSheetResult result = client . createProgressByStampSheet (
new CreateProgressByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
Progress 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.CreateProgressByStampSheetRequest ;
using Gs2.Gs2Enhance.Result.CreateProgressByStampSheetResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . CreateProgressByStampSheetResult > asyncResult = null ;
yield return client . CreateProgressByStampSheet (
new Gs2 . Gs2Enhance . Request . CreateProgressByStampSheetRequest ()
. WithStampSheet ( "stampSheet" )
. WithKeyId ( "key-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . createProgressByStampSheet (
new Gs2Enhance . CreateProgressByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . create_progress_by_stamp_sheet (
enhance . CreateProgressByStampSheetRequest ()
. with_stamp_sheet ( self . stamp_sheet )
. with_key_id ( self . key1 . key_id )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.create_progress_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 ;
client = gs2 ( 'enhance' )
api_result_handler = client.create_progress_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 ;
deleteProgressByStampTask スタンプタスクで 実行中の強化 を削除
Request 型 有効化条件 必須 デフォルト 値の制限 説明 stampTask string ✓ ~ 5242880文字 消費アクション keyId string ✓ ~ 1024文字 暗号鍵GRN
Result 型 説明 item Progress 実行中の強化 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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . DeleteProgressByStampTask (
& enhance . DeleteProgressByStampTaskRequest {
StampTask : pointy . String ( "stampTask" ),
KeyId : pointy . String ( "key-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\DeleteProgressByStampTaskRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> deleteProgressByStampTask (
( new DeleteProgressByStampTaskRequest ())
-> withStampTask ( self :: stampTask )
-> withKeyId ( self :: key - 0001 )
);
$item = $result -> getItem ();
$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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.DeleteProgressByStampTaskRequest ;
import io.gs2.enhance.result.DeleteProgressByStampTaskResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
DeleteProgressByStampTaskResult result = client . deleteProgressByStampTask (
new DeleteProgressByStampTaskRequest ()
. withStampTask ( "stampTask" )
. withKeyId ( "key-0001" )
);
Progress item = result . getItem ();
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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.DeleteProgressByStampTaskRequest ;
using Gs2.Gs2Enhance.Result.DeleteProgressByStampTaskResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . DeleteProgressByStampTaskResult > asyncResult = null ;
yield return client . DeleteProgressByStampTask (
new Gs2 . Gs2Enhance . Request . DeleteProgressByStampTaskRequest ()
. 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 ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . deleteProgressByStampTask (
new Gs2Enhance . DeleteProgressByStampTaskRequest ()
. withStampTask ( "stampTask" )
. withKeyId ( "key-0001" )
);
const item = result . getItem ();
const newContextStack = result . getNewContextStack ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . delete_progress_by_stamp_task (
enhance . DeleteProgressByStampTaskRequest ()
. with_stamp_task ( self . stamp_task )
. with_key_id ( self . key1 . key_id )
)
item = result . item
new_context_stack = result . new_context_stack
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.delete_progress_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 ;
client = gs2 ( 'enhance' )
api_result_handler = client.delete_progress_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 ;
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . ExportMaster (
& enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.ExportMasterRequest ;
import io.gs2.enhance.result.ExportMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
ExportMasterResult result = client . exportMaster (
new ExportMasterRequest ()
. withNamespaceName ( "namespace1" )
);
CurrentRateMaster 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.ExportMasterRequest ;
using Gs2.Gs2Enhance.Result.ExportMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . ExportMasterResult > asyncResult = null ;
yield return client . ExportMaster (
new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . exportMaster (
new Gs2Enhance . ExportMasterRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . export_master (
enhance . ExportMasterRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
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 ( 'enhance' )
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 ;
getCurrentRateMaster 現在有効な強化レート設定を取得
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . GetCurrentRateMaster (
& enhance . GetCurrentRateMasterRequest {
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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\GetCurrentRateMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getCurrentRateMaster (
( new GetCurrentRateMasterRequest ())
-> 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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.GetCurrentRateMasterRequest ;
import io.gs2.enhance.result.GetCurrentRateMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
GetCurrentRateMasterResult result = client . getCurrentRateMaster (
new GetCurrentRateMasterRequest ()
. withNamespaceName ( "namespace1" )
);
CurrentRateMaster 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.GetCurrentRateMasterRequest ;
using Gs2.Gs2Enhance.Result.GetCurrentRateMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . GetCurrentRateMasterResult > asyncResult = null ;
yield return client . GetCurrentRateMaster (
new Gs2 . Gs2Enhance . Request . GetCurrentRateMasterRequest ()
. 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . getCurrentRateMaster (
new Gs2Enhance . GetCurrentRateMasterRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . get_current_rate_master (
enhance . GetCurrentRateMasterRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.get_current_rate_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 ( 'enhance' )
api_result_handler = client.get_current_rate_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 ;
updateCurrentRateMaster 現在有効な強化レート設定を更新
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . UpdateCurrentRateMaster (
& enhance . UpdateCurrentRateMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
Settings : pointy . String ( "{\n \"version\": \"2020-08-22\",\n \"rateModels\": [\n {\n \"name\": \"character-friendly\",\n \"metadata\": \"CHARACTER_FRIENDLY\",\n \"targetInventoryModelId\": \"grn:inventory:character\",\n \"acquireExperienceSuffix\": \":friendly\",\n \"materialInventoryModelId\": \"grn:inventory:sweet\",\n \"acquireExperienceHierarchy\": [\n \"taste\"\n ],\n \"experienceModelId\": \"grn:experience:friendly\",\n \"bonusRates\": [\n {\n \"rate\": 1,\n \"weight\": 90\n }\n ]\n },\n {\n \"name\": \"character-level\",\n \"metadata\": \"CHARACTER_LEVEL\",\n \"targetInventoryModelId\": \"grn:inventory:character\",\n \"acquireExperienceSuffix\": \":level\",\n \"materialInventoryModelId\": \"grn:inventory:material\",\n \"acquireExperienceHierarchy\": [\n \"experience\"\n ],\n \"experienceModelId\": \"grn:experience:level\",\n \"bonusRates\": [\n {\n \"rate\": 1,\n \"weight\": 90\n },\n {\n \"rate\": 1.5,\n \"weight\": 9\n },\n {\n \"rate\": 2,\n \"weight\": 1\n }\n ]\n }\n ],\n \"unleashRateModels\": []\n}" ),
}
)
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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\UpdateCurrentRateMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateCurrentRateMaster (
( new UpdateCurrentRateMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withSettings ( "{ \n \" version \" : \" 2020-08-22 \" , \n \" rateModels \" : [ \n { \n \" name \" : \" character-friendly \" , \n \" metadata \" : \" CHARACTER_FRIENDLY \" , \n \" targetInventoryModelId \" : \" grn:inventory:character \" , \n \" acquireExperienceSuffix \" : \" :friendly \" , \n \" materialInventoryModelId \" : \" grn:inventory:sweet \" , \n \" acquireExperienceHierarchy \" : [ \n \" taste \"\n ], \n \" experienceModelId \" : \" grn:experience:friendly \" , \n \" bonusRates \" : [ \n { \n \" rate \" : 1, \n \" weight \" : 90 \n } \n ] \n }, \n { \n \" name \" : \" character-level \" , \n \" metadata \" : \" CHARACTER_LEVEL \" , \n \" targetInventoryModelId \" : \" grn:inventory:character \" , \n \" acquireExperienceSuffix \" : \" :level \" , \n \" materialInventoryModelId \" : \" grn:inventory:material \" , \n \" acquireExperienceHierarchy \" : [ \n \" experience \"\n ], \n \" experienceModelId \" : \" grn:experience:level \" , \n \" bonusRates \" : [ \n { \n \" rate \" : 1, \n \" weight \" : 90 \n }, \n { \n \" rate \" : 1.5, \n \" weight \" : 9 \n }, \n { \n \" rate \" : 2, \n \" weight \" : 1 \n } \n ] \n } \n ], \n \" unleashRateModels \" : [] \n }" )
);
$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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.UpdateCurrentRateMasterRequest ;
import io.gs2.enhance.result.UpdateCurrentRateMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
UpdateCurrentRateMasterResult result = client . updateCurrentRateMaster (
new UpdateCurrentRateMasterRequest ()
. withNamespaceName ( "namespace1" )
. withSettings ( "{\n \"version\": \"2020-08-22\",\n \"rateModels\": [\n {\n \"name\": \"character-friendly\",\n \"metadata\": \"CHARACTER_FRIENDLY\",\n \"targetInventoryModelId\": \"grn:inventory:character\",\n \"acquireExperienceSuffix\": \":friendly\",\n \"materialInventoryModelId\": \"grn:inventory:sweet\",\n \"acquireExperienceHierarchy\": [\n \"taste\"\n ],\n \"experienceModelId\": \"grn:experience:friendly\",\n \"bonusRates\": [\n {\n \"rate\": 1,\n \"weight\": 90\n }\n ]\n },\n {\n \"name\": \"character-level\",\n \"metadata\": \"CHARACTER_LEVEL\",\n \"targetInventoryModelId\": \"grn:inventory:character\",\n \"acquireExperienceSuffix\": \":level\",\n \"materialInventoryModelId\": \"grn:inventory:material\",\n \"acquireExperienceHierarchy\": [\n \"experience\"\n ],\n \"experienceModelId\": \"grn:experience:level\",\n \"bonusRates\": [\n {\n \"rate\": 1,\n \"weight\": 90\n },\n {\n \"rate\": 1.5,\n \"weight\": 9\n },\n {\n \"rate\": 2,\n \"weight\": 1\n }\n ]\n }\n ],\n \"unleashRateModels\": []\n}" )
);
CurrentRateMaster 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.UpdateCurrentRateMasterRequest ;
using Gs2.Gs2Enhance.Result.UpdateCurrentRateMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . UpdateCurrentRateMasterResult > asyncResult = null ;
yield return client . UpdateCurrentRateMaster (
new Gs2 . Gs2Enhance . Request . UpdateCurrentRateMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithSettings ( "{\n \"version\": \"2020-08-22\",\n \"rateModels\": [\n {\n \"name\": \"character-friendly\",\n \"metadata\": \"CHARACTER_FRIENDLY\",\n \"targetInventoryModelId\": \"grn:inventory:character\",\n \"acquireExperienceSuffix\": \":friendly\",\n \"materialInventoryModelId\": \"grn:inventory:sweet\",\n \"acquireExperienceHierarchy\": [\n \"taste\"\n ],\n \"experienceModelId\": \"grn:experience:friendly\",\n \"bonusRates\": [\n {\n \"rate\": 1,\n \"weight\": 90\n }\n ]\n },\n {\n \"name\": \"character-level\",\n \"metadata\": \"CHARACTER_LEVEL\",\n \"targetInventoryModelId\": \"grn:inventory:character\",\n \"acquireExperienceSuffix\": \":level\",\n \"materialInventoryModelId\": \"grn:inventory:material\",\n \"acquireExperienceHierarchy\": [\n \"experience\"\n ],\n \"experienceModelId\": \"grn:experience:level\",\n \"bonusRates\": [\n {\n \"rate\": 1,\n \"weight\": 90\n },\n {\n \"rate\": 1.5,\n \"weight\": 9\n },\n {\n \"rate\": 2,\n \"weight\": 1\n }\n ]\n }\n ],\n \"unleashRateModels\": []\n}" ),
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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . updateCurrentRateMaster (
new Gs2Enhance . UpdateCurrentRateMasterRequest ()
. withNamespaceName ( "namespace1" )
. withSettings ( "{\n \"version\": \"2020-08-22\",\n \"rateModels\": [\n {\n \"name\": \"character-friendly\",\n \"metadata\": \"CHARACTER_FRIENDLY\",\n \"targetInventoryModelId\": \"grn:inventory:character\",\n \"acquireExperienceSuffix\": \":friendly\",\n \"materialInventoryModelId\": \"grn:inventory:sweet\",\n \"acquireExperienceHierarchy\": [\n \"taste\"\n ],\n \"experienceModelId\": \"grn:experience:friendly\",\n \"bonusRates\": [\n {\n \"rate\": 1,\n \"weight\": 90\n }\n ]\n },\n {\n \"name\": \"character-level\",\n \"metadata\": \"CHARACTER_LEVEL\",\n \"targetInventoryModelId\": \"grn:inventory:character\",\n \"acquireExperienceSuffix\": \":level\",\n \"materialInventoryModelId\": \"grn:inventory:material\",\n \"acquireExperienceHierarchy\": [\n \"experience\"\n ],\n \"experienceModelId\": \"grn:experience:level\",\n \"bonusRates\": [\n {\n \"rate\": 1,\n \"weight\": 90\n },\n {\n \"rate\": 1.5,\n \"weight\": 9\n },\n {\n \"rate\": 2,\n \"weight\": 1\n }\n ]\n }\n ],\n \"unleashRateModels\": []\n}" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . update_current_rate_master (
enhance . UpdateCurrentRateMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_settings ( '{ \n "version": "2020-08-22", \n "rateModels": [ \n { \n "name": "character-friendly", \n "metadata": "CHARACTER_FRIENDLY", \n "targetInventoryModelId": "grn:inventory:character", \n "acquireExperienceSuffix": ":friendly", \n "materialInventoryModelId": "grn:inventory:sweet", \n "acquireExperienceHierarchy": [ \n "taste" \n ], \n "experienceModelId": "grn:experience:friendly", \n "bonusRates": [ \n { \n "rate": 1, \n "weight": 90 \n } \n ] \n }, \n { \n "name": "character-level", \n "metadata": "CHARACTER_LEVEL", \n "targetInventoryModelId": "grn:inventory:character", \n "acquireExperienceSuffix": ":level", \n "materialInventoryModelId": "grn:inventory:material", \n "acquireExperienceHierarchy": [ \n "experience" \n ], \n "experienceModelId": "grn:experience:level", \n "bonusRates": [ \n { \n "rate": 1, \n "weight": 90 \n }, \n { \n "rate": 1.5, \n "weight": 9 \n }, \n { \n "rate": 2, \n "weight": 1 \n } \n ] \n } \n ], \n "unleashRateModels": [] \n }' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'enhance' )
api_result = client.update_current_rate_master ({
namespaceName = "namespace1" ,
settings = "{ \n " version ": " 2020 - 08 - 22 ", \n " rateModels ": [ \n { \n " name ": " character - friendly ", \n " metadata ": " CHARACTER_FRIENDLY ", \n " targetInventoryModelId ": " grn : inventory : character ", \n " acquireExperienceSuffix ": " : friendly ", \n " materialInventoryModelId ": " grn : inventory : sweet ", \n " acquireExperienceHierarchy ": [ \n " taste " \n ], \n " experienceModelId ": " grn : experience : friendly ", \n " bonusRates ": [ \n { \n " rate ": 1, \n " weight ": 90 \n } \n ] \n }, \n { \n " name ": " character - level ", \n " metadata ": " CHARACTER_LEVEL ", \n " targetInventoryModelId ": " grn : inventory : character ", \n " acquireExperienceSuffix ": " : level ", \n " materialInventoryModelId ": " grn : inventory : material ", \n " acquireExperienceHierarchy ": [ \n " experience " \n ], \n " experienceModelId ": " grn : experience : level ", \n " bonusRates ": [ \n { \n " rate ": 1, \n " weight ": 90 \n }, \n { \n " rate ": 1.5, \n " weight ": 9 \n }, \n { \n " rate ": 2, \n " weight ": 1 \n } \n ] \n } \n ], \n " unleashRateModels ": [] \n }" ,
})
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 ( 'enhance' )
api_result_handler = client.update_current_rate_master_async ({
namespaceName = "namespace1" ,
settings = "{ \n " version ": " 2020 - 08 - 22 ", \n " rateModels ": [ \n { \n " name ": " character - friendly ", \n " metadata ": " CHARACTER_FRIENDLY ", \n " targetInventoryModelId ": " grn : inventory : character ", \n " acquireExperienceSuffix ": " : friendly ", \n " materialInventoryModelId ": " grn : inventory : sweet ", \n " acquireExperienceHierarchy ": [ \n " taste " \n ], \n " experienceModelId ": " grn : experience : friendly ", \n " bonusRates ": [ \n { \n " rate ": 1, \n " weight ": 90 \n } \n ] \n }, \n { \n " name ": " character - level ", \n " metadata ": " CHARACTER_LEVEL ", \n " targetInventoryModelId ": " grn : inventory : character ", \n " acquireExperienceSuffix ": " : level ", \n " materialInventoryModelId ": " grn : inventory : material ", \n " acquireExperienceHierarchy ": [ \n " experience " \n ], \n " experienceModelId ": " grn : experience : level ", \n " bonusRates ": [ \n { \n " rate ": 1, \n " weight ": 90 \n }, \n { \n " rate ": 1.5, \n " weight ": 9 \n }, \n { \n " rate ": 2, \n " weight ": 1 \n } \n ] \n } \n ], \n " unleashRateModels ": [] \n }" ,
})
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 ;
updateCurrentRateMasterFromGitHub 現在有効な強化レート設定を更新
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/enhance"
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 := enhance . Gs2EnhanceRestClient {
Session : & session ,
}
result , err := client . UpdateCurrentRateMasterFromGitHub (
& enhance . UpdateCurrentRateMasterFromGitHubRequest {
NamespaceName : pointy . String ( "namespace1" ),
CheckoutSetting : & enhance . 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\Enhance\Gs2EnhanceRestClient ;
use Gs2\Enhance\Request\UpdateCurrentRateMasterFromGitHubRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateCurrentRateMasterFromGitHub (
( new UpdateCurrentRateMasterFromGitHubRequest ())
-> 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.enhance.rest.Gs2EnhanceRestClient ;
import io.gs2.enhance.request.UpdateCurrentRateMasterFromGitHubRequest ;
import io.gs2.enhance.result.UpdateCurrentRateMasterFromGitHubResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2EnhanceRestClient client = new Gs2EnhanceRestClient ( session );
try {
UpdateCurrentRateMasterFromGitHubResult result = client . updateCurrentRateMasterFromGitHub (
new UpdateCurrentRateMasterFromGitHubRequest ()
. withNamespaceName ( "namespace1" )
. withCheckoutSetting ( new GitHubCheckoutSetting ()
. withApiKeyId ( "$gitHubApiKey1.apiKeyId" )
. withRepositoryName ( "gs2io/master-data" )
. withSourcePath ( "path/to/file.json" )
. withReferenceType ( "branch" )
. withBranchName ( "develop" )
)
);
CurrentRateMaster 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.Gs2Enhance.Gs2EnhanceRestClient ;
using Gs2.Gs2Enhance.Request.UpdateCurrentRateMasterFromGitHubRequest ;
using Gs2.Gs2Enhance.Result.UpdateCurrentRateMasterFromGitHubResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2EnhanceRestClient ( session );
AsyncResult < Gs2 . Gs2Enhance . Result . UpdateCurrentRateMasterFromGitHubResult > asyncResult = null ;
yield return client . UpdateCurrentRateMasterFromGitHub (
new Gs2 . Gs2Enhance . Request . UpdateCurrentRateMasterFromGitHubRequest ()
. WithNamespaceName ( "namespace1" )
. WithCheckoutSetting ( new Gs2 . Gs2Enhance . 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 Gs2Enhance from '@/gs2/enhance' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Enhance . Gs2EnhanceRestClient ( session );
try {
const result = await client . updateCurrentRateMasterFromGitHub (
new Gs2Enhance . UpdateCurrentRateMasterFromGitHubRequest ()
. withNamespaceName ( "namespace1" )
. withCheckoutSetting ( new Gs2Enhance . 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 enhance
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = enhance . Gs2EnhanceRestClient ( session )
try :
result = client . update_current_rate_master_from_git_hub (
enhance . UpdateCurrentRateMasterFromGitHubRequest ()
. with_namespace_name ( self . hash1 )
. with_checkout_setting ( enhance . 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 ( 'enhance' )
api_result = client.update_current_rate_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 ( 'enhance' )
api_result_handler = client.update_current_rate_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 ;