GS2-Stamina SDK API リファレンス
モデル
Namespace
ネームスペース
ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。
GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024文字 | ネームスペースGRN | ||
name | string | ✓ | ~ 128文字 | ネームスペース名 | ||
description | string | ~ 1024文字 | 説明文 | |||
transactionSetting | TransactionSetting | トランザクション設定 | ||||
overflowTriggerScript | string | ~ 1024文字 | 回復処理時にあふれたスタミナに対して処理をする GS2-Script | |||
logSetting | LogSetting | ログの出力設定 | ||||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
関連するメソッド
describeNamespaces createNamespace getNamespace updateNamespace deleteNamespace
StaminaModelMaster
スタミナマスター
スタミナの最大値や、回復間隔、回復量といったパラメータを定義できます。
GS2-Experience と連動させて、最大値や回復量をコントロールすることもできます。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
staminaModelId | string | ✓ | ~ 1024文字 | スタミナモデルマスターGRN | ||
name | string | ✓ | ~ 128文字 | スタミナモデル名 | ||
metadata | string | ~ 128文字 | メタデータ | |||
description | string | ~ 1024文字 | 説明文 | |||
recoverIntervalMinutes | int | ✓ | ~ 2147483646 | スタミナを回復する速度(分) | ||
recoverValue | int | ✓ | 1 | ~ 2147483646 | 時間経過後に回復する量 | |
initialCapacity | int | ✓ | ~ 2147483646 | スタミナの最大値の初期値 | ||
isOverflow | bool | ✓ | 最大値を超えて回復するか | |||
maxCapacity | int | {isOverflow} | ✓ | ~ 2147483646 | 溢れた状況での最大値 isOverflow が “true” であれば 必須 | |
maxStaminaTableName | string | ~ 128文字 | GS2-Experience のランクによって最大スタミナ値を決定するスタミナ最大値テーブル名 | |||
recoverIntervalTableName | string | ~ 128文字 | GS2-Experience のランクによってスタミナの回復間隔を決定する回復間隔テーブル名 | |||
recoverValueTableName | string | ~ 128文字 | GS2-Experience のランクによってスタミナの回復量を決定する回復量テーブル名 | |||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
関連するメソッド
describeStaminaModelMasters createStaminaModelMaster getStaminaModelMaster updateStaminaModelMaster deleteStaminaModelMaster
MaxStaminaTableMaster
スタミナ最大値テーブルマスター
GS2-Experience のランクごとにスタミナの最大値を定義するエンティティです。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
maxStaminaTableId | string | ✓ | ~ 1024文字 | スタミナの最大値テーブルマスターGRN | ||
name | string | ✓ | ~ 128文字 | 最大スタミナ値テーブル名 | ||
metadata | string | ~ 128文字 | メタデータ | |||
description | string | ~ 1024文字 | 説明文 | |||
experienceModelId | string | ✓ | ~ 1024文字 | 経験値モデルGRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | ランク毎のスタミナの最大値テーブル | ||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
関連するメソッド
describeMaxStaminaTableMasters createMaxStaminaTableMaster getMaxStaminaTableMaster updateMaxStaminaTableMaster deleteMaxStaminaTableMaster
RecoverIntervalTableMaster
スタミナ回復間隔テーブルマスター
GS2-Experience のランクごとにスタミナの回復間隔を定義するエンティティです。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
recoverIntervalTableId | string | ✓ | ~ 1024文字 | スタミナ回復間隔テーブルマスターGRN | ||
name | string | ✓ | ~ 128文字 | スタミナ回復間隔テーブル名 | ||
metadata | string | ~ 128文字 | メタデータ | |||
description | string | ~ 1024文字 | 説明文 | |||
experienceModelId | string | ✓ | ~ 1024文字 | 経験値モデルGRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | ランク毎のスタミナ回復間隔テーブル | ||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
関連するメソッド
describeRecoverIntervalTableMasters createRecoverIntervalTableMaster getRecoverIntervalTableMaster updateRecoverIntervalTableMaster deleteRecoverIntervalTableMaster
RecoverValueTableMaster
スタミナ回復量テーブルマスター
GS2-Experience のランクごとにスタミナの回復量を定義するエンティティです。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
recoverValueTableId | string | ✓ | ~ 1024文字 | スタミナ回復量テーブルマスターGRN | ||
name | string | ✓ | ~ 128文字 | スタミナ回復量テーブル名 | ||
metadata | string | ~ 128文字 | メタデータ | |||
description | string | ~ 1024文字 | 説明文 | |||
experienceModelId | string | ✓ | ~ 1024文字 | 経験値モデルGRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | ランク毎のスタミナ回復量テーブル | ||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
関連するメソッド
describeRecoverValueTableMasters createRecoverValueTableMaster getRecoverValueTableMaster updateRecoverValueTableMaster deleteRecoverValueTableMaster
CurrentStaminaMaster
現在有効なマスターデータ
GS2ではマスターデータの管理にJSON形式のファイルを使用します。
ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが
よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
Note
JSONファイルの形式については GS2-Stamina マスターデータリファレンス をご参照ください。型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024文字 | 現在有効なスタミナマスターGRN | ||
settings | string | ✓ | ~ 5242880文字 | マスターデータ |
関連するメソッド
exportMaster getCurrentStaminaMaster updateCurrentStaminaMaster updateCurrentStaminaMasterFromGitHub
StaminaModel
スタミナモデル
スタミナの最大値や、回復間隔、回復量といったパラメータを定義できます。
GS2-Experience と連動させて、最大値や回復量をコントロールすることもできます。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
staminaModelId | string | ✓ | ~ 1024文字 | スタミナモデルGRN | ||
name | string | ✓ | ~ 128文字 | スタミナモデル名 | ||
metadata | string | ~ 128文字 | メタデータ | |||
recoverIntervalMinutes | int | ✓ | ~ 2147483646 | スタミナを回復する速度(分) | ||
recoverValue | int | ✓ | 1 | ~ 2147483646 | 時間経過後に回復する量 | |
initialCapacity | int | ✓ | ~ 2147483646 | スタミナの最大値の初期値 | ||
isOverflow | bool | ✓ | 最大値を超えて回復するか | |||
maxCapacity | int | {isOverflow} | ✓ | ~ 2147483646 | 溢れた状況での最大値 isOverflow が “true” であれば 必須 | |
maxStaminaTable | MaxStaminaTable | GS2-Experience と連携する際に使用するスタミナ最大値テーブル | ||||
recoverIntervalTable | RecoverIntervalTable | GS2-Experience と連携する際に使用する回復間隔テーブル | ||||
recoverValueTable | RecoverValueTable | GS2-Experience と連携する際に使用する回復量テーブル |
関連するメソッド
describeStaminaModels getStaminaModel getStamina getStaminaByUserId updateStaminaByUserId consumeStamina consumeStaminaByUserId applyStamina applyStaminaByUserId recoverStaminaByUserId raiseMaxValueByUserId decreaseMaxValue decreaseMaxValueByUserId setMaxValueByUserId setRecoverIntervalByUserId setRecoverValueByUserId setMaxValueByStatus setRecoverIntervalByStatus setRecoverValueByStatus
MaxStaminaTable
スタミナ最大値テーブル
GS2-Experience のランクごとにスタミナの最大値を定義するエンティティです。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | 最大スタミナ値テーブル名 | ||
metadata | string | ~ 128文字 | メタデータ | |||
experienceModelId | string | ✓ | ~ 1024文字 | 経験値モデルGRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | ランク毎のスタミナの最大値テーブル |
関連するモデル
RecoverIntervalTable
スタミナ回復間隔テーブル
GS2-Experience のランクごとにスタミナの回復間隔を定義するエンティティです。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | スタミナ回復間隔テーブル名 | ||
metadata | string | ~ 128文字 | メタデータ | |||
experienceModelId | string | ✓ | ~ 1024文字 | 経験値モデルGRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | ランク毎のスタミナ回復間隔テーブル |
関連するモデル
RecoverValueTable
スタミナ回復量テーブル
GS2-Experience のランクごとにスタミナの回復量を定義するエンティティです。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | スタミナ回復量テーブル名 | ||
metadata | string | ~ 128文字 | メタデータ | |||
experienceModelId | string | ✓ | ~ 1024文字 | 経験値モデルGRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | ランク毎のスタミナ回復量テーブル |
関連するモデル
Stamina
スタミナ
スタミナとは現実時間の時間経過で回復するポイントです。
一般的にこのスタミナを消費してゲームをプレイできるようにすることで、プレイヤーの1日のプレイ回数を制限し、ゲームの進行速度をゲーム提供側がコントロールする目的で使用されます。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
staminaId | string | ✓ | ~ 1024文字 | スタミナGRN | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
value | int | ✓ | ~ 2147483646 | スタミナ値 | ||
maxValue | int | ✓ | 1 ~ 2147483646 | スタミナの最大値 | ||
recoverIntervalMinutes | int | 1 ~ 2147483646 | スタミナの回復間隔(分) | |||
recoverValue | int | 1 ~ 2147483646 | スタミナの回復量 | |||
overflowValue | int | ✓ | ~ 2147483646 | スタミナの最大値を超えて格納されているスタミナ値 | ||
nextRecoverAt | long | 次回スタミナが回復する時間 (UNIX時間 単位:ミリ秒) | ||||
lastRecoveredAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
関連するメソッド
describeStaminas describeStaminasByUserId getStamina getStaminaByUserId updateStaminaByUserId consumeStamina consumeStaminaByUserId applyStamina applyStaminaByUserId recoverStaminaByUserId raiseMaxValueByUserId decreaseMaxValue decreaseMaxValueByUserId setMaxValueByUserId setRecoverIntervalByUserId setRecoverValueByUserId setMaxValueByStatus setRecoverIntervalByStatus setRecoverValueByStatus deleteStaminaByUserId verifyStaminaValue verifyStaminaValueByUserId verifyStaminaMaxValue verifyStaminaMaxValueByUserId verifyStaminaRecoverIntervalMinutes verifyStaminaRecoverIntervalMinutesByUserId verifyStaminaRecoverValue verifyStaminaRecoverValueByUserId verifyStaminaOverflowValue verifyStaminaOverflowValueByUserId
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文字 | コミットハッシュ referenceType が “commit_hash” であれば 必須 | |||||||||
branchName | string | {referenceType} == “branch” | ✓ | ~ 1024文字 | ブランチ名 referenceType が “branch” であれば 必須 | |||||||||
tagName | string | {referenceType} == “tag” | ✓ | ~ 1024文字 | タグ名 referenceType が “tag” であれば 必須 |
関連するメソッド
LogSetting
ログの書き出し設定
ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用されるログ名前空間の識別子(Namespace ID)を保持します。
ログ名前空間IDは、ログデータを集約し、保存する対象の GS2-Log の名前空間を指定します。
この設定を通じて、この名前空間以下のAPIリクエスト・レスポンスログデータが対象の GS2-Log へ出力されるようになります。
GS2-Log にはリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
loggingNamespaceId | string | ✓ | ~ 1024文字 | ログを出力する GS2-Log のネームスペースGRN |
関連するメソッド
関連するモデル
ScriptSetting
スクリプト設定
GS2 ではマイクロサービスのイベントに関連づけて、カスタムスクリプトを実行することができます。
このモデルは、スクリプトの実行をトリガーするための設定を保持します。
スクリプトの実行方式は大きく2種類あり、それは「同期実行」と「非同期実行」です。
同期実行は、スクリプトの実行が完了するまで処理がブロックされます。
かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることができます。
一方、非同期実行は、スクリプトの実行が完了するまで処理がブロックされません。
かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることはできません。
しかし、非同期実行は、スクリプトの実行が完了するまで処理がブロックされないため、APIの応答に影響を与えないため、原則非同期実行を使用することをおすすめします。
非同期実行には実行方式が2種類あり、GS2-Script と Amazon EventBridge があります。
Amazon EventBridge を使用することで、Lua 以外の言語で処理を記述することができます。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
triggerScriptId | string | ~ 1024文字 | 処理時に実行するスクリプト | |||||||||||
doneTriggerTargetType | 文字列列挙型 enum { “none”, “gs2_script”, “aws” } | ✓ | “none” | ~ 128文字 | 完了通知の通知先
| |||||||||
doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024文字 | 完了時に実行するスクリプト doneTriggerTargetType が “gs2_script” であれば 有効 | ||||||||||
doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024文字 | 完了時のスクリプトを実行するためのジョブキューのネームスペース doneTriggerTargetType が “gs2_script” であれば 有効 |
TransactionSetting
トランザクション設定
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
enableAutoRun | bool | ✓ | false | 発行したトランザクションをサーバーサイドで自動的に実行するか | ||
enableAtomicCommit | bool | {enableAutoRun} == true | ✓ | false | トランザクションの実行をアトミックにコミットするか enableAutoRun が true であれば 必須 | |
transactionUseDistributor | bool | {enableAtomicCommit} == true | ✓ | false | トランザクションを非同期処理で実行する enableAtomicCommit が true であれば 必須 | |
acquireActionUseJobQueue | bool | {enableAtomicCommit} == true | ✓ | false | 入手アクションを実行する際に GS2-JobQueue を使用するか enableAtomicCommit が true であれば 必須 | |
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
型 | 説明 | |
---|---|---|
items | List<Namespace> | ネームスペースのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeNamespacesRequest;
import io.gs2.stamina.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DescribeNamespacesRequest;
using Gs2.Gs2Stamina.Result.DescribeNamespacesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2Stamina.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 stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.describe_namespaces(
stamina.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('stamina')
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('stamina')
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 | トランザクション設定 | ||||
overflowTriggerScript | string | ~ 1024文字 | 回復処理時にあふれたスタミナに対して処理をする GS2-Script | |||
logSetting | LogSetting | ログの出力設定 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 作成したネームスペース |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CreateNamespace(
&stamina.CreateNamespaceRequest {
Name: pointy.String("namespace-0001"),
Description: nil,
TransactionSetting: nil,
OverflowTriggerScript: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script"),
LogSetting: &stamina.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CreateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createNamespace(
(new CreateNamespaceRequest())
->withName("namespace-0001")
->withDescription(null)
->withTransactionSetting(null)
->withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script")
->withLogSetting((new \Gs2\Stamina\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CreateNamespaceRequest;
import io.gs2.stamina.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace-0001")
.withDescription(null)
.withTransactionSetting(null)
.withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script")
.withLogSetting(new io.gs2.stamina.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CreateNamespaceRequest;
using Gs2.Gs2Stamina.Result.CreateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Stamina.Request.CreateNamespaceRequest()
.WithName("namespace-0001")
.WithDescription(null)
.WithTransactionSetting(null)
.WithOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script")
.WithLogSetting(new Gs2.Gs2Stamina.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.createNamespace(
new Gs2Stamina.CreateNamespaceRequest()
.withName("namespace-0001")
.withDescription(null)
.withTransactionSetting(null)
.withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script")
.withLogSetting(new Gs2Stamina.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.create_namespace(
stamina.CreateNamespaceRequest()
.with_name('namespace-0001')
.with_description(None)
.with_transaction_setting(None)
.with_overflow_trigger_script('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script')
.with_log_setting(
stamina.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.create_namespace({
name="namespace-0001",
description=nil,
transactionSetting=nil,
overflowTriggerScript="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script",
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.create_namespace_async({
name="namespace-0001",
description=nil,
transactionSetting=nil,
overflowTriggerScript="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script",
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getNamespaceStatus
ネームスペースの状態を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
status | string |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.GetNamespaceStatus(
&stamina.GetNamespaceStatusRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetNamespaceStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getNamespaceStatus(
(new GetNamespaceStatusRequest())
->withNamespaceName("namespace-0001")
);
$status = $result->getStatus();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetNamespaceStatusRequest;
import io.gs2.stamina.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
GetNamespaceStatusResult result = client.getNamespaceStatus(
new GetNamespaceStatusRequest()
.withNamespaceName("namespace-0001")
);
String status = result.getStatus();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Stamina.Result.GetNamespaceStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Stamina.Request.GetNamespaceStatusRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2Stamina.GetNamespaceStatusRequest()
.withNamespaceName("namespace-0001")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.get_namespace_status(
stamina.GetNamespaceStatusRequest()
.with_namespace_name('namespace-0001')
)
status = result.status
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_namespace_status({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
client = gs2('stamina')
api_result_handler = client.get_namespace_status_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
getNamespace
ネームスペースを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | ネームスペース |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.GetNamespace(
&stamina.GetNamespaceRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getNamespace(
(new GetNamespaceRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetNamespaceRequest;
import io.gs2.stamina.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
GetNamespaceResult result = client.getNamespace(
new GetNamespaceRequest()
.withNamespaceName("namespace-0001")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.GetNamespaceRequest;
using Gs2.Gs2Stamina.Result.GetNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Stamina.Request.GetNamespaceRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.getNamespace(
new Gs2Stamina.GetNamespaceRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.get_namespace(
stamina.GetNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_namespace({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.get_namespace_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateNamespace
ネームスペースを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
description | string | ~ 1024文字 | 説明文 | |||
transactionSetting | TransactionSetting | トランザクション設定 | ||||
overflowTriggerScript | string | ~ 1024文字 | 回復処理時にあふれたスタミナに対して処理をする GS2-Script | |||
logSetting | LogSetting | ログの出力設定 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 更新したネームスペース |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.UpdateNamespace(
&stamina.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace-0001"),
Description: pointy.String("description1"),
TransactionSetting: nil,
OverflowTriggerScript: nil,
LogSetting: &stamina.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateNamespace(
(new UpdateNamespaceRequest())
->withNamespaceName("namespace-0001")
->withDescription("description1")
->withTransactionSetting(null)
->withOverflowTriggerScript(null)
->withLogSetting((new \Gs2\Stamina\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateNamespaceRequest;
import io.gs2.stamina.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace-0001")
.withDescription("description1")
.withTransactionSetting(null)
.withOverflowTriggerScript(null)
.withLogSetting(new io.gs2.stamina.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.UpdateNamespaceRequest;
using Gs2.Gs2Stamina.Result.UpdateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Stamina.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace-0001")
.WithDescription("description1")
.WithTransactionSetting(null)
.WithOverflowTriggerScript(null)
.WithLogSetting(new Gs2.Gs2Stamina.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2Stamina.UpdateNamespaceRequest()
.withNamespaceName("namespace-0001")
.withDescription("description1")
.withTransactionSetting(null)
.withOverflowTriggerScript(null)
.withLogSetting(new Gs2Stamina.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.update_namespace(
stamina.UpdateNamespaceRequest()
.with_namespace_name('namespace-0001')
.with_description('description1')
.with_transaction_setting(None)
.with_overflow_trigger_script(None)
.with_log_setting(
stamina.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.update_namespace({
namespaceName="namespace-0001",
description="description1",
transactionSetting=nil,
overflowTriggerScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.update_namespace_async({
namespaceName="namespace-0001",
description="description1",
transactionSetting=nil,
overflowTriggerScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteNamespace
ネームスペースを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 削除したネームスペース |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DeleteNamespace(
&stamina.DeleteNamespaceRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DeleteNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteNamespace(
(new DeleteNamespaceRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DeleteNamespaceRequest;
import io.gs2.stamina.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DeleteNamespaceResult result = client.deleteNamespace(
new DeleteNamespaceRequest()
.withNamespaceName("namespace-0001")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DeleteNamespaceRequest;
using Gs2.Gs2Stamina.Result.DeleteNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Stamina.Request.DeleteNamespaceRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2Stamina.DeleteNamespaceRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.delete_namespace(
stamina.DeleteNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.delete_namespace({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.delete_namespace_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getServiceVersion
マイクロサービスのバージョンを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 |
---|
Result
型 | 説明 | |
---|---|---|
item | string | バージョン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.GetServiceVersion(
&stamina.GetServiceVersionRequest {
}
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetServiceVersionRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getServiceVersion(
(new GetServiceVersionRequest())
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetServiceVersionRequest;
import io.gs2.stamina.result.GetServiceVersionResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
GetServiceVersionResult result = client.getServiceVersion(
new GetServiceVersionRequest()
);
String 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.GetServiceVersionRequest;
using Gs2.Gs2Stamina.Result.GetServiceVersionResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
new Gs2.Gs2Stamina.Request.GetServiceVersionRequest(),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.getServiceVersion(
new Gs2Stamina.GetServiceVersionRequest()
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.get_service_version(
stamina.GetServiceVersionRequest()
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_service_version({
})
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('stamina')
api_result_handler = client.get_service_version_async({
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
dumpUserDataByUserId
指定したユーザーIDに紐づくデータのダンプを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 |
---|
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DumpUserDataByUserId(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DumpUserDataByUserIdRequest;
import io.gs2.stamina.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Stamina.Result.DumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.dumpUserDataByUserId(
new Gs2Stamina.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.dump_user_data_by_user_id(
stamina.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
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('stamina')
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
型 | 説明 | |
---|---|---|
url | string | 出力データのURL |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.stamina.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Stamina.Result.CheckDumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.checkDumpUserDataByUserId(
new Gs2Stamina.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.check_dump_user_data_by_user_id(
stamina.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
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('stamina')
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
型 | 説明 |
---|
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CleanUserDataByUserId(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CleanUserDataByUserIdRequest;
import io.gs2.stamina.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Stamina.Result.CleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.cleanUserDataByUserId(
new Gs2Stamina.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.clean_user_data_by_user_id(
stamina.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
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('stamina')
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
型 | 説明 |
---|
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.stamina.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Stamina.Result.CheckCleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.checkCleanUserDataByUserId(
new Gs2Stamina.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.check_clean_user_data_by_user_id(
stamina.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
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('stamina')
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 |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.stamina.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Stamina.Result.PrepareImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.prepareImportUserDataByUserId(
new Gs2Stamina.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 stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.prepare_import_user_data_by_user_id(
stamina.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('stamina')
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('stamina')
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
型 | 説明 |
---|
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.ImportUserDataByUserId(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.ImportUserDataByUserIdRequest;
import io.gs2.stamina.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Stamina.Result.ImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.importUserDataByUserId(
new Gs2Stamina.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.import_user_data_by_user_id(
stamina.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('stamina')
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('stamina')
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
型 | 説明 | |
---|---|---|
url | string | 出力ログのURL |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
&stamina.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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CheckImportUserDataByUserIdRequest;
import io.gs2.stamina.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Stamina.Result.CheckImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2Stamina.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.checkImportUserDataByUserId(
new Gs2Stamina.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 stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.check_import_user_data_by_user_id(
stamina.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('stamina')
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('stamina')
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;
describeStaminaModelMasters
スタミナモデルマスターの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<StaminaModelMaster> | スタミナモデルマスターのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DescribeStaminaModelMasters(
&stamina.DescribeStaminaModelMastersRequest {
NamespaceName: pointy.String("namespace-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeStaminaModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeStaminaModelMasters(
(new DescribeStaminaModelMastersRequest())
->withNamespaceName("namespace-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeStaminaModelMastersRequest;
import io.gs2.stamina.result.DescribeStaminaModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DescribeStaminaModelMastersResult result = client.describeStaminaModelMasters(
new DescribeStaminaModelMastersRequest()
.withNamespaceName("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
List<StaminaModelMaster> 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DescribeStaminaModelMastersRequest;
using Gs2.Gs2Stamina.Result.DescribeStaminaModelMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DescribeStaminaModelMastersResult> asyncResult = null;
yield return client.DescribeStaminaModelMasters(
new Gs2.Gs2Stamina.Request.DescribeStaminaModelMastersRequest()
.WithNamespaceName("namespace-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.describeStaminaModelMasters(
new Gs2Stamina.DescribeStaminaModelMastersRequest()
.withNamespaceName("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.describe_stamina_model_masters(
stamina.DescribeStaminaModelMastersRequest()
.with_namespace_name('namespace-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.describe_stamina_model_masters({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')
api_result_handler = client.describe_stamina_model_masters_async({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createStaminaModelMaster
スタミナモデルマスターを新規作成
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
name | string | ✓ | ~ 128文字 | スタミナモデル名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 128文字 | メタデータ | |||
recoverIntervalMinutes | int | ✓ | ~ 2147483646 | スタミナを回復する速度(分) | ||
recoverValue | int | ✓ | 1 | ~ 2147483646 | 時間経過後に回復する量 | |
initialCapacity | int | ✓ | ~ 2147483646 | スタミナの最大値の初期値 | ||
isOverflow | bool | ✓ | 最大値を超えて回復するか | |||
maxCapacity | int | {isOverflow} | ✓ | ~ 2147483646 | 溢れた状況での最大値 isOverflow が “true” であれば必須 | |
maxStaminaTableName | string | ~ 128文字 | GS2-Experience のランクによって最大スタミナ値を決定するスタミナ最大値テーブル名 | |||
recoverIntervalTableName | string | ~ 128文字 | GS2-Experience のランクによってスタミナの回復間隔を決定する回復間隔テーブル名 | |||
recoverValueTableName | string | ~ 128文字 | GS2-Experience のランクによってスタミナの回復量を決定する回復量テーブル名 |
Result
型 | 説明 | |
---|---|---|
item | StaminaModelMaster | 作成したスタミナモデルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CreateStaminaModelMaster(
&stamina.CreateStaminaModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Name: pointy.String("stamina-0001"),
Description: nil,
Metadata: nil,
RecoverIntervalMinutes: pointy.Int32(15),
RecoverValue: nil,
InitialCapacity: pointy.Int32(50),
IsOverflow: pointy.Bool(false),
MaxCapacity: nil,
MaxStaminaTableName: pointy.String("maxStaminaTable-0001"),
RecoverIntervalTableName: pointy.String("recoverIntervalTable-0001"),
RecoverValueTableName: pointy.String("recoverValueTable-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CreateStaminaModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createStaminaModelMaster(
(new CreateStaminaModelMasterRequest())
->withNamespaceName("namespace-0001")
->withName("stamina-0001")
->withDescription(null)
->withMetadata(null)
->withRecoverIntervalMinutes(15)
->withRecoverValue(null)
->withInitialCapacity(50)
->withIsOverflow(False)
->withMaxCapacity(null)
->withMaxStaminaTableName("maxStaminaTable-0001")
->withRecoverIntervalTableName("recoverIntervalTable-0001")
->withRecoverValueTableName("recoverValueTable-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CreateStaminaModelMasterRequest;
import io.gs2.stamina.result.CreateStaminaModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
CreateStaminaModelMasterResult result = client.createStaminaModelMaster(
new CreateStaminaModelMasterRequest()
.withNamespaceName("namespace-0001")
.withName("stamina-0001")
.withDescription(null)
.withMetadata(null)
.withRecoverIntervalMinutes(15)
.withRecoverValue(null)
.withInitialCapacity(50)
.withIsOverflow(false)
.withMaxCapacity(null)
.withMaxStaminaTableName("maxStaminaTable-0001")
.withRecoverIntervalTableName("recoverIntervalTable-0001")
.withRecoverValueTableName("recoverValueTable-0001")
);
StaminaModelMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CreateStaminaModelMasterRequest;
using Gs2.Gs2Stamina.Result.CreateStaminaModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CreateStaminaModelMasterResult> asyncResult = null;
yield return client.CreateStaminaModelMaster(
new Gs2.Gs2Stamina.Request.CreateStaminaModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithName("stamina-0001")
.WithDescription(null)
.WithMetadata(null)
.WithRecoverIntervalMinutes(15)
.WithRecoverValue(null)
.WithInitialCapacity(50)
.WithIsOverflow(false)
.WithMaxCapacity(null)
.WithMaxStaminaTableName("maxStaminaTable-0001")
.WithRecoverIntervalTableName("recoverIntervalTable-0001")
.WithRecoverValueTableName("recoverValueTable-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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.createStaminaModelMaster(
new Gs2Stamina.CreateStaminaModelMasterRequest()
.withNamespaceName("namespace-0001")
.withName("stamina-0001")
.withDescription(null)
.withMetadata(null)
.withRecoverIntervalMinutes(15)
.withRecoverValue(null)
.withInitialCapacity(50)
.withIsOverflow(false)
.withMaxCapacity(null)
.withMaxStaminaTableName("maxStaminaTable-0001")
.withRecoverIntervalTableName("recoverIntervalTable-0001")
.withRecoverValueTableName("recoverValueTable-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.create_stamina_model_master(
stamina.CreateStaminaModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_name('stamina-0001')
.with_description(None)
.with_metadata(None)
.with_recover_interval_minutes(15)
.with_recover_value(None)
.with_initial_capacity(50)
.with_is_overflow(False)
.with_max_capacity(None)
.with_max_stamina_table_name('maxStaminaTable-0001')
.with_recover_interval_table_name('recover_interval_table-0001')
.with_recover_value_table_name('recoverValueTable-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.create_stamina_model_master({
namespaceName="namespace-0001",
name="stamina-0001",
description=nil,
metadata=nil,
recoverIntervalMinutes=15,
recoverValue=nil,
initialCapacity=50,
isOverflow=false,
maxCapacity=nil,
maxStaminaTableName="maxStaminaTable-0001",
recoverIntervalTableName="recoverIntervalTable-0001",
recoverValueTableName="recoverValueTable-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('stamina')
api_result_handler = client.create_stamina_model_master_async({
namespaceName="namespace-0001",
name="stamina-0001",
description=nil,
metadata=nil,
recoverIntervalMinutes=15,
recoverValue=nil,
initialCapacity=50,
isOverflow=false,
maxCapacity=nil,
maxStaminaTableName="maxStaminaTable-0001",
recoverIntervalTableName="recoverIntervalTable-0001",
recoverValueTableName="recoverValueTable-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;
getStaminaModelMaster
スタミナモデルマスターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデル名 |
Result
型 | 説明 | |
---|---|---|
item | StaminaModelMaster | スタミナモデルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.GetStaminaModelMaster(
&stamina.GetStaminaModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetStaminaModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getStaminaModelMaster(
(new GetStaminaModelMasterRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetStaminaModelMasterRequest;
import io.gs2.stamina.result.GetStaminaModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
GetStaminaModelMasterResult result = client.getStaminaModelMaster(
new GetStaminaModelMasterRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
);
StaminaModelMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.GetStaminaModelMasterRequest;
using Gs2.Gs2Stamina.Result.GetStaminaModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.GetStaminaModelMasterResult> asyncResult = null;
yield return client.GetStaminaModelMaster(
new Gs2.Gs2Stamina.Request.GetStaminaModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.getStaminaModelMaster(
new Gs2Stamina.GetStaminaModelMasterRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.get_stamina_model_master(
stamina.GetStaminaModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_stamina_model_master({
namespaceName="namespace-0001",
staminaName="stamina-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('stamina')
api_result_handler = client.get_stamina_model_master_async({
namespaceName="namespace-0001",
staminaName="stamina-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;
updateStaminaModelMaster
スタミナモデルマスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデル名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 128文字 | メタデータ | |||
recoverIntervalMinutes | int | ✓ | ~ 2147483646 | スタミナを回復する速度(分) | ||
recoverValue | int | ✓ | 1 | ~ 2147483646 | 時間経過後に回復する量 | |
initialCapacity | int | ✓ | ~ 2147483646 | スタミナの最大値の初期値 | ||
isOverflow | bool | ✓ | 最大値を超えて回復するか | |||
maxCapacity | int | {isOverflow} | ✓ | ~ 2147483646 | 溢れた状況での最大値 isOverflow が “true” であれば必須 | |
maxStaminaTableName | string | ~ 128文字 | GS2-Experience のランクによって最大スタミナ値を決定するスタミナ最大値テーブル名 | |||
recoverIntervalTableName | string | ~ 128文字 | GS2-Experience のランクによってスタミナの回復間隔を決定する回復間隔テーブル名 | |||
recoverValueTableName | string | ~ 128文字 | GS2-Experience のランクによってスタミナの回復量を決定する回復量テーブル名 |
Result
型 | 説明 | |
---|---|---|
item | StaminaModelMaster | 更新したスタミナモデルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.UpdateStaminaModelMaster(
&stamina.UpdateStaminaModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
Description: pointy.String("description1"),
Metadata: pointy.String("STAMINA_MODEL_MASTER_0001"),
RecoverIntervalMinutes: pointy.Int32(20),
RecoverValue: pointy.Int32(2),
InitialCapacity: pointy.Int32(60),
IsOverflow: pointy.Bool(true),
MaxCapacity: pointy.Int32(999),
MaxStaminaTableName: pointy.String("maxStaminaTable-0002"),
RecoverIntervalTableName: pointy.String("recoverIntervalTable-0002"),
RecoverValueTableName: pointy.String("recoverValueTable-0002"),
}
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateStaminaModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateStaminaModelMaster(
(new UpdateStaminaModelMasterRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withDescription("description1")
->withMetadata("STAMINA_MODEL_MASTER_0001")
->withRecoverIntervalMinutes(20)
->withRecoverValue(2)
->withInitialCapacity(60)
->withIsOverflow(True)
->withMaxCapacity(999)
->withMaxStaminaTableName("maxStaminaTable-0002")
->withRecoverIntervalTableName("recoverIntervalTable-0002")
->withRecoverValueTableName("recoverValueTable-0002")
);
$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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateStaminaModelMasterRequest;
import io.gs2.stamina.result.UpdateStaminaModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
UpdateStaminaModelMasterResult result = client.updateStaminaModelMaster(
new UpdateStaminaModelMasterRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withDescription("description1")
.withMetadata("STAMINA_MODEL_MASTER_0001")
.withRecoverIntervalMinutes(20)
.withRecoverValue(2)
.withInitialCapacity(60)
.withIsOverflow(true)
.withMaxCapacity(999)
.withMaxStaminaTableName("maxStaminaTable-0002")
.withRecoverIntervalTableName("recoverIntervalTable-0002")
.withRecoverValueTableName("recoverValueTable-0002")
);
StaminaModelMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.UpdateStaminaModelMasterRequest;
using Gs2.Gs2Stamina.Result.UpdateStaminaModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.UpdateStaminaModelMasterResult> asyncResult = null;
yield return client.UpdateStaminaModelMaster(
new Gs2.Gs2Stamina.Request.UpdateStaminaModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithDescription("description1")
.WithMetadata("STAMINA_MODEL_MASTER_0001")
.WithRecoverIntervalMinutes(20)
.WithRecoverValue(2)
.WithInitialCapacity(60)
.WithIsOverflow(true)
.WithMaxCapacity(999)
.WithMaxStaminaTableName("maxStaminaTable-0002")
.WithRecoverIntervalTableName("recoverIntervalTable-0002")
.WithRecoverValueTableName("recoverValueTable-0002"),
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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.updateStaminaModelMaster(
new Gs2Stamina.UpdateStaminaModelMasterRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withDescription("description1")
.withMetadata("STAMINA_MODEL_MASTER_0001")
.withRecoverIntervalMinutes(20)
.withRecoverValue(2)
.withInitialCapacity(60)
.withIsOverflow(true)
.withMaxCapacity(999)
.withMaxStaminaTableName("maxStaminaTable-0002")
.withRecoverIntervalTableName("recoverIntervalTable-0002")
.withRecoverValueTableName("recoverValueTable-0002")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.update_stamina_model_master(
stamina.UpdateStaminaModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_description('description1')
.with_metadata('STAMINA_MODEL_MASTER_0001')
.with_recover_interval_minutes(20)
.with_recover_value(2)
.with_initial_capacity(60)
.with_is_overflow(True)
.with_max_capacity(999)
.with_max_stamina_table_name('maxStaminaTable-0002')
.with_recover_interval_table_name('recover_interval_table-0002')
.with_recover_value_table_name('recoverValueTable-0002')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.update_stamina_model_master({
namespaceName="namespace-0001",
staminaName="stamina-0001",
description="description1",
metadata="STAMINA_MODEL_MASTER_0001",
recoverIntervalMinutes=20,
recoverValue=2,
initialCapacity=60,
isOverflow=true,
maxCapacity=999,
maxStaminaTableName="maxStaminaTable-0002",
recoverIntervalTableName="recoverIntervalTable-0002",
recoverValueTableName="recoverValueTable-0002",
})
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('stamina')
api_result_handler = client.update_stamina_model_master_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
description="description1",
metadata="STAMINA_MODEL_MASTER_0001",
recoverIntervalMinutes=20,
recoverValue=2,
initialCapacity=60,
isOverflow=true,
maxCapacity=999,
maxStaminaTableName="maxStaminaTable-0002",
recoverIntervalTableName="recoverIntervalTable-0002",
recoverValueTableName="recoverValueTable-0002",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteStaminaModelMaster
スタミナモデルマスターを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデル名 |
Result
型 | 説明 | |
---|---|---|
item | StaminaModelMaster | 削除したスタミナモデルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DeleteStaminaModelMaster(
&stamina.DeleteStaminaModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DeleteStaminaModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteStaminaModelMaster(
(new DeleteStaminaModelMasterRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DeleteStaminaModelMasterRequest;
import io.gs2.stamina.result.DeleteStaminaModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DeleteStaminaModelMasterResult result = client.deleteStaminaModelMaster(
new DeleteStaminaModelMasterRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
);
StaminaModelMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DeleteStaminaModelMasterRequest;
using Gs2.Gs2Stamina.Result.DeleteStaminaModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DeleteStaminaModelMasterResult> asyncResult = null;
yield return client.DeleteStaminaModelMaster(
new Gs2.Gs2Stamina.Request.DeleteStaminaModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.deleteStaminaModelMaster(
new Gs2Stamina.DeleteStaminaModelMasterRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.delete_stamina_model_master(
stamina.DeleteStaminaModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.delete_stamina_model_master({
namespaceName="namespace-0001",
staminaName="stamina-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('stamina')
api_result_handler = client.delete_stamina_model_master_async({
namespaceName="namespace-0001",
staminaName="stamina-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;
describeMaxStaminaTableMasters
スタミナの最大値テーブルマスターの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<MaxStaminaTableMaster> | スタミナの最大値テーブルマスターのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DescribeMaxStaminaTableMasters(
&stamina.DescribeMaxStaminaTableMastersRequest {
NamespaceName: pointy.String("namespace-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeMaxStaminaTableMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeMaxStaminaTableMasters(
(new DescribeMaxStaminaTableMastersRequest())
->withNamespaceName("namespace-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeMaxStaminaTableMastersRequest;
import io.gs2.stamina.result.DescribeMaxStaminaTableMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DescribeMaxStaminaTableMastersResult result = client.describeMaxStaminaTableMasters(
new DescribeMaxStaminaTableMastersRequest()
.withNamespaceName("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
List<MaxStaminaTableMaster> 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DescribeMaxStaminaTableMastersRequest;
using Gs2.Gs2Stamina.Result.DescribeMaxStaminaTableMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DescribeMaxStaminaTableMastersResult> asyncResult = null;
yield return client.DescribeMaxStaminaTableMasters(
new Gs2.Gs2Stamina.Request.DescribeMaxStaminaTableMastersRequest()
.WithNamespaceName("namespace-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.describeMaxStaminaTableMasters(
new Gs2Stamina.DescribeMaxStaminaTableMastersRequest()
.withNamespaceName("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.describe_max_stamina_table_masters(
stamina.DescribeMaxStaminaTableMastersRequest()
.with_namespace_name('namespace-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.describe_max_stamina_table_masters({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')
api_result_handler = client.describe_max_stamina_table_masters_async({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createMaxStaminaTableMaster
スタミナの最大値テーブルマスターを新規作成
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
name | string | ✓ | ~ 128文字 | 最大スタミナ値テーブル名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 128文字 | メタデータ | |||
experienceModelId | string | ✓ | ~ 1024文字 | 経験値モデルGRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | ランク毎のスタミナの最大値テーブル |
Result
型 | 説明 | |
---|---|---|
item | MaxStaminaTableMaster | 作成したスタミナの最大値テーブルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CreateMaxStaminaTableMaster(
&stamina.CreateMaxStaminaTableMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Name: pointy.String("max-stamina-table-0001"),
Description: nil,
Metadata: nil,
ExperienceModelId: pointy.String("experienceModelId-0001"),
Values: []*int32{
pointy.Int32(50),
pointy.Int32(150),
pointy.Int32(250),
pointy.Int32(350),
pointy.Int32(450),
pointy.Int32(550),
pointy.Int32(650),
pointy.Int32(750),
pointy.Int32(850),
pointy.Int32(950),
pointy.Int32(1050),
pointy.Int32(1150),
pointy.Int32(1250),
pointy.Int32(1350),
pointy.Int32(1450),
pointy.Int32(1550),
pointy.Int32(1650),
pointy.Int32(1750),
pointy.Int32(1850),
pointy.Int32(1950),
pointy.Int32(2050),
pointy.Int32(2150),
pointy.Int32(2250),
pointy.Int32(2350),
pointy.Int32(2450),
pointy.Int32(2550),
pointy.Int32(2650),
pointy.Int32(2750),
pointy.Int32(2850),
pointy.Int32(2950),
pointy.Int32(3050),
pointy.Int32(3150),
pointy.Int32(3250),
pointy.Int32(3350),
pointy.Int32(3450),
pointy.Int32(3550),
pointy.Int32(3650),
pointy.Int32(3750),
pointy.Int32(3850),
pointy.Int32(3950),
pointy.Int32(4050),
pointy.Int32(4150),
pointy.Int32(4250),
pointy.Int32(4350),
pointy.Int32(4450),
pointy.Int32(4550),
pointy.Int32(4650),
pointy.Int32(4750),
pointy.Int32(4850),
pointy.Int32(4950),
pointy.Int32(5050),
pointy.Int32(5150),
pointy.Int32(5250),
pointy.Int32(5350),
pointy.Int32(5450),
pointy.Int32(5550),
pointy.Int32(5650),
pointy.Int32(5750),
pointy.Int32(5850),
pointy.Int32(5950),
pointy.Int32(6050),
pointy.Int32(6150),
pointy.Int32(6250),
pointy.Int32(6350),
pointy.Int32(6450),
pointy.Int32(6550),
pointy.Int32(6650),
pointy.Int32(6750),
pointy.Int32(6850),
pointy.Int32(6950),
pointy.Int32(7050),
pointy.Int32(7150),
pointy.Int32(7250),
pointy.Int32(7350),
pointy.Int32(7450),
pointy.Int32(7550),
pointy.Int32(7650),
pointy.Int32(7750),
pointy.Int32(7850),
pointy.Int32(7950),
pointy.Int32(8050),
pointy.Int32(8150),
pointy.Int32(8250),
pointy.Int32(8350),
pointy.Int32(8450),
pointy.Int32(8550),
pointy.Int32(8650),
pointy.Int32(8750),
pointy.Int32(8850),
pointy.Int32(8950),
pointy.Int32(9050),
pointy.Int32(9150),
pointy.Int32(9250),
pointy.Int32(9350),
pointy.Int32(9450),
pointy.Int32(9550),
pointy.Int32(9650),
pointy.Int32(9750),
pointy.Int32(9850),
pointy.Int32(9950),
},
}
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CreateMaxStaminaTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createMaxStaminaTableMaster(
(new CreateMaxStaminaTableMasterRequest())
->withNamespaceName("namespace-0001")
->withName("max-stamina-table-0001")
->withDescription(null)
->withMetadata(null)
->withExperienceModelId("experienceModelId-0001")
->withValues([
50,
150,
250,
350,
450,
550,
650,
750,
850,
950,
1050,
1150,
1250,
1350,
1450,
1550,
1650,
1750,
1850,
1950,
2050,
2150,
2250,
2350,
2450,
2550,
2650,
2750,
2850,
2950,
3050,
3150,
3250,
3350,
3450,
3550,
3650,
3750,
3850,
3950,
4050,
4150,
4250,
4350,
4450,
4550,
4650,
4750,
4850,
4950,
5050,
5150,
5250,
5350,
5450,
5550,
5650,
5750,
5850,
5950,
6050,
6150,
6250,
6350,
6450,
6550,
6650,
6750,
6850,
6950,
7050,
7150,
7250,
7350,
7450,
7550,
7650,
7750,
7850,
7950,
8050,
8150,
8250,
8350,
8450,
8550,
8650,
8750,
8850,
8950,
9050,
9150,
9250,
9350,
9450,
9550,
9650,
9750,
9850,
9950,
])
);
$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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CreateMaxStaminaTableMasterRequest;
import io.gs2.stamina.result.CreateMaxStaminaTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
CreateMaxStaminaTableMasterResult result = client.createMaxStaminaTableMaster(
new CreateMaxStaminaTableMasterRequest()
.withNamespaceName("namespace-0001")
.withName("max-stamina-table-0001")
.withDescription(null)
.withMetadata(null)
.withExperienceModelId("experienceModelId-0001")
.withValues(Arrays.asList(
50,
150,
250,
350,
450,
550,
650,
750,
850,
950,
1050,
1150,
1250,
1350,
1450,
1550,
1650,
1750,
1850,
1950,
2050,
2150,
2250,
2350,
2450,
2550,
2650,
2750,
2850,
2950,
3050,
3150,
3250,
3350,
3450,
3550,
3650,
3750,
3850,
3950,
4050,
4150,
4250,
4350,
4450,
4550,
4650,
4750,
4850,
4950,
5050,
5150,
5250,
5350,
5450,
5550,
5650,
5750,
5850,
5950,
6050,
6150,
6250,
6350,
6450,
6550,
6650,
6750,
6850,
6950,
7050,
7150,
7250,
7350,
7450,
7550,
7650,
7750,
7850,
7950,
8050,
8150,
8250,
8350,
8450,
8550,
8650,
8750,
8850,
8950,
9050,
9150,
9250,
9350,
9450,
9550,
9650,
9750,
9850,
9950
))
);
MaxStaminaTableMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CreateMaxStaminaTableMasterRequest;
using Gs2.Gs2Stamina.Result.CreateMaxStaminaTableMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CreateMaxStaminaTableMasterResult> asyncResult = null;
yield return client.CreateMaxStaminaTableMaster(
new Gs2.Gs2Stamina.Request.CreateMaxStaminaTableMasterRequest()
.WithNamespaceName("namespace-0001")
.WithName("max-stamina-table-0001")
.WithDescription(null)
.WithMetadata(null)
.WithExperienceModelId("experienceModelId-0001")
.WithValues(new int[] {
50,
150,
250,
350,
450,
550,
650,
750,
850,
950,
1050,
1150,
1250,
1350,
1450,
1550,
1650,
1750,
1850,
1950,
2050,
2150,
2250,
2350,
2450,
2550,
2650,
2750,
2850,
2950,
3050,
3150,
3250,
3350,
3450,
3550,
3650,
3750,
3850,
3950,
4050,
4150,
4250,
4350,
4450,
4550,
4650,
4750,
4850,
4950,
5050,
5150,
5250,
5350,
5450,
5550,
5650,
5750,
5850,
5950,
6050,
6150,
6250,
6350,
6450,
6550,
6650,
6750,
6850,
6950,
7050,
7150,
7250,
7350,
7450,
7550,
7650,
7750,
7850,
7950,
8050,
8150,
8250,
8350,
8450,
8550,
8650,
8750,
8850,
8950,
9050,
9150,
9250,
9350,
9450,
9550,
9650,
9750,
9850,
9950,
}),
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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.createMaxStaminaTableMaster(
new Gs2Stamina.CreateMaxStaminaTableMasterRequest()
.withNamespaceName("namespace-0001")
.withName("max-stamina-table-0001")
.withDescription(null)
.withMetadata(null)
.withExperienceModelId("experienceModelId-0001")
.withValues([
50,
150,
250,
350,
450,
550,
650,
750,
850,
950,
1050,
1150,
1250,
1350,
1450,
1550,
1650,
1750,
1850,
1950,
2050,
2150,
2250,
2350,
2450,
2550,
2650,
2750,
2850,
2950,
3050,
3150,
3250,
3350,
3450,
3550,
3650,
3750,
3850,
3950,
4050,
4150,
4250,
4350,
4450,
4550,
4650,
4750,
4850,
4950,
5050,
5150,
5250,
5350,
5450,
5550,
5650,
5750,
5850,
5950,
6050,
6150,
6250,
6350,
6450,
6550,
6650,
6750,
6850,
6950,
7050,
7150,
7250,
7350,
7450,
7550,
7650,
7750,
7850,
7950,
8050,
8150,
8250,
8350,
8450,
8550,
8650,
8750,
8850,
8950,
9050,
9150,
9250,
9350,
9450,
9550,
9650,
9750,
9850,
9950,
])
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.create_max_stamina_table_master(
stamina.CreateMaxStaminaTableMasterRequest()
.with_namespace_name('namespace-0001')
.with_name('max-stamina-table-0001')
.with_description(None)
.with_metadata(None)
.with_experience_model_id('experienceModelId-0001')
.with_values([
50,
150,
250,
350,
450,
550,
650,
750,
850,
950,
1050,
1150,
1250,
1350,
1450,
1550,
1650,
1750,
1850,
1950,
2050,
2150,
2250,
2350,
2450,
2550,
2650,
2750,
2850,
2950,
3050,
3150,
3250,
3350,
3450,
3550,
3650,
3750,
3850,
3950,
4050,
4150,
4250,
4350,
4450,
4550,
4650,
4750,
4850,
4950,
5050,
5150,
5250,
5350,
5450,
5550,
5650,
5750,
5850,
5950,
6050,
6150,
6250,
6350,
6450,
6550,
6650,
6750,
6850,
6950,
7050,
7150,
7250,
7350,
7450,
7550,
7650,
7750,
7850,
7950,
8050,
8150,
8250,
8350,
8450,
8550,
8650,
8750,
8850,
8950,
9050,
9150,
9250,
9350,
9450,
9550,
9650,
9750,
9850,
9950,
])
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.create_max_stamina_table_master({
namespaceName="namespace-0001",
name="max-stamina-table-0001",
description=nil,
metadata=nil,
experienceModelId="experienceModelId-0001",
values={
50,
150,
250,
350,
450,
550,
650,
750,
850,
950,
1050,
1150,
1250,
1350,
1450,
1550,
1650,
1750,
1850,
1950,
2050,
2150,
2250,
2350,
2450,
2550,
2650,
2750,
2850,
2950,
3050,
3150,
3250,
3350,
3450,
3550,
3650,
3750,
3850,
3950,
4050,
4150,
4250,
4350,
4450,
4550,
4650,
4750,
4850,
4950,
5050,
5150,
5250,
5350,
5450,
5550,
5650,
5750,
5850,
5950,
6050,
6150,
6250,
6350,
6450,
6550,
6650,
6750,
6850,
6950,
7050,
7150,
7250,
7350,
7450,
7550,
7650,
7750,
7850,
7950,
8050,
8150,
8250,
8350,
8450,
8550,
8650,
8750,
8850,
8950,
9050,
9150,
9250,
9350,
9450,
9550,
9650,
9750,
9850,
9950
},
})
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('stamina')
api_result_handler = client.create_max_stamina_table_master_async({
namespaceName="namespace-0001",
name="max-stamina-table-0001",
description=nil,
metadata=nil,
experienceModelId="experienceModelId-0001",
values={
50,
150,
250,
350,
450,
550,
650,
750,
850,
950,
1050,
1150,
1250,
1350,
1450,
1550,
1650,
1750,
1850,
1950,
2050,
2150,
2250,
2350,
2450,
2550,
2650,
2750,
2850,
2950,
3050,
3150,
3250,
3350,
3450,
3550,
3650,
3750,
3850,
3950,
4050,
4150,
4250,
4350,
4450,
4550,
4650,
4750,
4850,
4950,
5050,
5150,
5250,
5350,
5450,
5550,
5650,
5750,
5850,
5950,
6050,
6150,
6250,
6350,
6450,
6550,
6650,
6750,
6850,
6950,
7050,
7150,
7250,
7350,
7450,
7550,
7650,
7750,
7850,
7950,
8050,
8150,
8250,
8350,
8450,
8550,
8650,
8750,
8850,
8950,
9050,
9150,
9250,
9350,
9450,
9550,
9650,
9750,
9850,
9950
},
})
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;
getMaxStaminaTableMaster
スタミナの最大値テーブルマスターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
maxStaminaTableName | string | ✓ | ~ 128文字 | 最大スタミナ値テーブル名 |
Result
型 | 説明 | |
---|---|---|
item | MaxStaminaTableMaster | スタミナの最大値テーブルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.GetMaxStaminaTableMaster(
&stamina.GetMaxStaminaTableMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
MaxStaminaTableName: pointy.String("max-stamina-table-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetMaxStaminaTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getMaxStaminaTableMaster(
(new GetMaxStaminaTableMasterRequest())
->withNamespaceName("namespace-0001")
->withMaxStaminaTableName("max-stamina-table-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetMaxStaminaTableMasterRequest;
import io.gs2.stamina.result.GetMaxStaminaTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
GetMaxStaminaTableMasterResult result = client.getMaxStaminaTableMaster(
new GetMaxStaminaTableMasterRequest()
.withNamespaceName("namespace-0001")
.withMaxStaminaTableName("max-stamina-table-0001")
);
MaxStaminaTableMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.GetMaxStaminaTableMasterRequest;
using Gs2.Gs2Stamina.Result.GetMaxStaminaTableMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.GetMaxStaminaTableMasterResult> asyncResult = null;
yield return client.GetMaxStaminaTableMaster(
new Gs2.Gs2Stamina.Request.GetMaxStaminaTableMasterRequest()
.WithNamespaceName("namespace-0001")
.WithMaxStaminaTableName("max-stamina-table-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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.getMaxStaminaTableMaster(
new Gs2Stamina.GetMaxStaminaTableMasterRequest()
.withNamespaceName("namespace-0001")
.withMaxStaminaTableName("max-stamina-table-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.get_max_stamina_table_master(
stamina.GetMaxStaminaTableMasterRequest()
.with_namespace_name('namespace-0001')
.with_max_stamina_table_name('max-stamina-table-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_max_stamina_table_master({
namespaceName="namespace-0001",
maxStaminaTableName="max-stamina-table-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('stamina')
api_result_handler = client.get_max_stamina_table_master_async({
namespaceName="namespace-0001",
maxStaminaTableName="max-stamina-table-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;
updateMaxStaminaTableMaster
スタミナの最大値テーブルマスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
maxStaminaTableName | string | ✓ | ~ 128文字 | 最大スタミナ値テーブル名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 128文字 | メタデータ | |||
experienceModelId | string | ✓ | ~ 1024文字 | 経験値モデルGRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | ランク毎のスタミナの最大値テーブル |
Result
型 | 説明 | |
---|---|---|
item | MaxStaminaTableMaster | 更新したスタミナの最大値テーブルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.UpdateMaxStaminaTableMaster(
&stamina.UpdateMaxStaminaTableMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
MaxStaminaTableName: pointy.String("max-stamina-table-0001"),
Description: pointy.String("description1"),
Metadata: nil,
ExperienceModelId: pointy.String("experienceModelId-1001"),
Values: []*int32{
pointy.Int32(50),
pointy.Int32(200),
pointy.Int32(350),
pointy.Int32(500),
pointy.Int32(650),
pointy.Int32(800),
pointy.Int32(950),
pointy.Int32(1100),
pointy.Int32(1250),
pointy.Int32(1400),
pointy.Int32(1550),
pointy.Int32(1700),
pointy.Int32(1850),
pointy.Int32(2000),
pointy.Int32(2150),
pointy.Int32(2300),
pointy.Int32(2450),
pointy.Int32(2600),
pointy.Int32(2750),
pointy.Int32(2900),
pointy.Int32(3050),
pointy.Int32(3200),
pointy.Int32(3350),
pointy.Int32(3500),
pointy.Int32(3650),
pointy.Int32(3800),
pointy.Int32(3950),
pointy.Int32(4100),
pointy.Int32(4250),
pointy.Int32(4400),
pointy.Int32(4550),
pointy.Int32(4700),
pointy.Int32(4850),
pointy.Int32(5000),
pointy.Int32(5150),
pointy.Int32(5300),
pointy.Int32(5450),
pointy.Int32(5600),
pointy.Int32(5750),
pointy.Int32(5900),
pointy.Int32(6050),
pointy.Int32(6200),
pointy.Int32(6350),
pointy.Int32(6500),
pointy.Int32(6650),
pointy.Int32(6800),
pointy.Int32(6950),
pointy.Int32(7100),
pointy.Int32(7250),
pointy.Int32(7400),
pointy.Int32(7550),
pointy.Int32(7700),
pointy.Int32(7850),
pointy.Int32(8000),
pointy.Int32(8150),
pointy.Int32(8300),
pointy.Int32(8450),
pointy.Int32(8600),
pointy.Int32(8750),
pointy.Int32(8900),
pointy.Int32(9050),
pointy.Int32(9200),
pointy.Int32(9350),
pointy.Int32(9500),
pointy.Int32(9650),
pointy.Int32(9800),
pointy.Int32(9950),
pointy.Int32(10100),
pointy.Int32(10250),
pointy.Int32(10400),
pointy.Int32(10550),
pointy.Int32(10700),
pointy.Int32(10850),
pointy.Int32(11000),
pointy.Int32(11150),
pointy.Int32(11300),
pointy.Int32(11450),
pointy.Int32(11600),
pointy.Int32(11750),
pointy.Int32(11900),
pointy.Int32(12050),
pointy.Int32(12200),
pointy.Int32(12350),
pointy.Int32(12500),
pointy.Int32(12650),
pointy.Int32(12800),
pointy.Int32(12950),
pointy.Int32(13100),
pointy.Int32(13250),
pointy.Int32(13400),
pointy.Int32(13550),
pointy.Int32(13700),
pointy.Int32(13850),
pointy.Int32(14000),
pointy.Int32(14150),
pointy.Int32(14300),
pointy.Int32(14450),
pointy.Int32(14600),
pointy.Int32(14750),
pointy.Int32(14900),
},
}
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateMaxStaminaTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateMaxStaminaTableMaster(
(new UpdateMaxStaminaTableMasterRequest())
->withNamespaceName("namespace-0001")
->withMaxStaminaTableName("max-stamina-table-0001")
->withDescription("description1")
->withMetadata(null)
->withExperienceModelId("experienceModelId-1001")
->withValues([
50,
200,
350,
500,
650,
800,
950,
1100,
1250,
1400,
1550,
1700,
1850,
2000,
2150,
2300,
2450,
2600,
2750,
2900,
3050,
3200,
3350,
3500,
3650,
3800,
3950,
4100,
4250,
4400,
4550,
4700,
4850,
5000,
5150,
5300,
5450,
5600,
5750,
5900,
6050,
6200,
6350,
6500,
6650,
6800,
6950,
7100,
7250,
7400,
7550,
7700,
7850,
8000,
8150,
8300,
8450,
8600,
8750,
8900,
9050,
9200,
9350,
9500,
9650,
9800,
9950,
10100,
10250,
10400,
10550,
10700,
10850,
11000,
11150,
11300,
11450,
11600,
11750,
11900,
12050,
12200,
12350,
12500,
12650,
12800,
12950,
13100,
13250,
13400,
13550,
13700,
13850,
14000,
14150,
14300,
14450,
14600,
14750,
14900,
])
);
$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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateMaxStaminaTableMasterRequest;
import io.gs2.stamina.result.UpdateMaxStaminaTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
UpdateMaxStaminaTableMasterResult result = client.updateMaxStaminaTableMaster(
new UpdateMaxStaminaTableMasterRequest()
.withNamespaceName("namespace-0001")
.withMaxStaminaTableName("max-stamina-table-0001")
.withDescription("description1")
.withMetadata(null)
.withExperienceModelId("experienceModelId-1001")
.withValues(Arrays.asList(
50,
200,
350,
500,
650,
800,
950,
1100,
1250,
1400,
1550,
1700,
1850,
2000,
2150,
2300,
2450,
2600,
2750,
2900,
3050,
3200,
3350,
3500,
3650,
3800,
3950,
4100,
4250,
4400,
4550,
4700,
4850,
5000,
5150,
5300,
5450,
5600,
5750,
5900,
6050,
6200,
6350,
6500,
6650,
6800,
6950,
7100,
7250,
7400,
7550,
7700,
7850,
8000,
8150,
8300,
8450,
8600,
8750,
8900,
9050,
9200,
9350,
9500,
9650,
9800,
9950,
10100,
10250,
10400,
10550,
10700,
10850,
11000,
11150,
11300,
11450,
11600,
11750,
11900,
12050,
12200,
12350,
12500,
12650,
12800,
12950,
13100,
13250,
13400,
13550,
13700,
13850,
14000,
14150,
14300,
14450,
14600,
14750,
14900
))
);
MaxStaminaTableMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.UpdateMaxStaminaTableMasterRequest;
using Gs2.Gs2Stamina.Result.UpdateMaxStaminaTableMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.UpdateMaxStaminaTableMasterResult> asyncResult = null;
yield return client.UpdateMaxStaminaTableMaster(
new Gs2.Gs2Stamina.Request.UpdateMaxStaminaTableMasterRequest()
.WithNamespaceName("namespace-0001")
.WithMaxStaminaTableName("max-stamina-table-0001")
.WithDescription("description1")
.WithMetadata(null)
.WithExperienceModelId("experienceModelId-1001")
.WithValues(new int[] {
50,
200,
350,
500,
650,
800,
950,
1100,
1250,
1400,
1550,
1700,
1850,
2000,
2150,
2300,
2450,
2600,
2750,
2900,
3050,
3200,
3350,
3500,
3650,
3800,
3950,
4100,
4250,
4400,
4550,
4700,
4850,
5000,
5150,
5300,
5450,
5600,
5750,
5900,
6050,
6200,
6350,
6500,
6650,
6800,
6950,
7100,
7250,
7400,
7550,
7700,
7850,
8000,
8150,
8300,
8450,
8600,
8750,
8900,
9050,
9200,
9350,
9500,
9650,
9800,
9950,
10100,
10250,
10400,
10550,
10700,
10850,
11000,
11150,
11300,
11450,
11600,
11750,
11900,
12050,
12200,
12350,
12500,
12650,
12800,
12950,
13100,
13250,
13400,
13550,
13700,
13850,
14000,
14150,
14300,
14450,
14600,
14750,
14900,
}),
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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.updateMaxStaminaTableMaster(
new Gs2Stamina.UpdateMaxStaminaTableMasterRequest()
.withNamespaceName("namespace-0001")
.withMaxStaminaTableName("max-stamina-table-0001")
.withDescription("description1")
.withMetadata(null)
.withExperienceModelId("experienceModelId-1001")
.withValues([
50,
200,
350,
500,
650,
800,
950,
1100,
1250,
1400,
1550,
1700,
1850,
2000,
2150,
2300,
2450,
2600,
2750,
2900,
3050,
3200,
3350,
3500,
3650,
3800,
3950,
4100,
4250,
4400,
4550,
4700,
4850,
5000,
5150,
5300,
5450,
5600,
5750,
5900,
6050,
6200,
6350,
6500,
6650,
6800,
6950,
7100,
7250,
7400,
7550,
7700,
7850,
8000,
8150,
8300,
8450,
8600,
8750,
8900,
9050,
9200,
9350,
9500,
9650,
9800,
9950,
10100,
10250,
10400,
10550,
10700,
10850,
11000,
11150,
11300,
11450,
11600,
11750,
11900,
12050,
12200,
12350,
12500,
12650,
12800,
12950,
13100,
13250,
13400,
13550,
13700,
13850,
14000,
14150,
14300,
14450,
14600,
14750,
14900,
])
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.update_max_stamina_table_master(
stamina.UpdateMaxStaminaTableMasterRequest()
.with_namespace_name('namespace-0001')
.with_max_stamina_table_name('max-stamina-table-0001')
.with_description('description1')
.with_metadata(None)
.with_experience_model_id('experienceModelId-1001')
.with_values([
50,
200,
350,
500,
650,
800,
950,
1100,
1250,
1400,
1550,
1700,
1850,
2000,
2150,
2300,
2450,
2600,
2750,
2900,
3050,
3200,
3350,
3500,
3650,
3800,
3950,
4100,
4250,
4400,
4550,
4700,
4850,
5000,
5150,
5300,
5450,
5600,
5750,
5900,
6050,
6200,
6350,
6500,
6650,
6800,
6950,
7100,
7250,
7400,
7550,
7700,
7850,
8000,
8150,
8300,
8450,
8600,
8750,
8900,
9050,
9200,
9350,
9500,
9650,
9800,
9950,
10100,
10250,
10400,
10550,
10700,
10850,
11000,
11150,
11300,
11450,
11600,
11750,
11900,
12050,
12200,
12350,
12500,
12650,
12800,
12950,
13100,
13250,
13400,
13550,
13700,
13850,
14000,
14150,
14300,
14450,
14600,
14750,
14900,
])
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.update_max_stamina_table_master({
namespaceName="namespace-0001",
maxStaminaTableName="max-stamina-table-0001",
description="description1",
metadata=nil,
experienceModelId="experienceModelId-1001",
values={
50,
200,
350,
500,
650,
800,
950,
1100,
1250,
1400,
1550,
1700,
1850,
2000,
2150,
2300,
2450,
2600,
2750,
2900,
3050,
3200,
3350,
3500,
3650,
3800,
3950,
4100,
4250,
4400,
4550,
4700,
4850,
5000,
5150,
5300,
5450,
5600,
5750,
5900,
6050,
6200,
6350,
6500,
6650,
6800,
6950,
7100,
7250,
7400,
7550,
7700,
7850,
8000,
8150,
8300,
8450,
8600,
8750,
8900,
9050,
9200,
9350,
9500,
9650,
9800,
9950,
10100,
10250,
10400,
10550,
10700,
10850,
11000,
11150,
11300,
11450,
11600,
11750,
11900,
12050,
12200,
12350,
12500,
12650,
12800,
12950,
13100,
13250,
13400,
13550,
13700,
13850,
14000,
14150,
14300,
14450,
14600,
14750,
14900
},
})
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('stamina')
api_result_handler = client.update_max_stamina_table_master_async({
namespaceName="namespace-0001",
maxStaminaTableName="max-stamina-table-0001",
description="description1",
metadata=nil,
experienceModelId="experienceModelId-1001",
values={
50,
200,
350,
500,
650,
800,
950,
1100,
1250,
1400,
1550,
1700,
1850,
2000,
2150,
2300,
2450,
2600,
2750,
2900,
3050,
3200,
3350,
3500,
3650,
3800,
3950,
4100,
4250,
4400,
4550,
4700,
4850,
5000,
5150,
5300,
5450,
5600,
5750,
5900,
6050,
6200,
6350,
6500,
6650,
6800,
6950,
7100,
7250,
7400,
7550,
7700,
7850,
8000,
8150,
8300,
8450,
8600,
8750,
8900,
9050,
9200,
9350,
9500,
9650,
9800,
9950,
10100,
10250,
10400,
10550,
10700,
10850,
11000,
11150,
11300,
11450,
11600,
11750,
11900,
12050,
12200,
12350,
12500,
12650,
12800,
12950,
13100,
13250,
13400,
13550,
13700,
13850,
14000,
14150,
14300,
14450,
14600,
14750,
14900
},
})
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;
deleteMaxStaminaTableMaster
スタミナの最大値テーブルマスターを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
maxStaminaTableName | string | ✓ | ~ 128文字 | 最大スタミナ値テーブル名 |
Result
型 | 説明 | |
---|---|---|
item | MaxStaminaTableMaster | 削除したスタミナの最大値テーブルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DeleteMaxStaminaTableMaster(
&stamina.DeleteMaxStaminaTableMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
MaxStaminaTableName: pointy.String("max-stamina-table-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DeleteMaxStaminaTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteMaxStaminaTableMaster(
(new DeleteMaxStaminaTableMasterRequest())
->withNamespaceName("namespace-0001")
->withMaxStaminaTableName("max-stamina-table-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DeleteMaxStaminaTableMasterRequest;
import io.gs2.stamina.result.DeleteMaxStaminaTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DeleteMaxStaminaTableMasterResult result = client.deleteMaxStaminaTableMaster(
new DeleteMaxStaminaTableMasterRequest()
.withNamespaceName("namespace-0001")
.withMaxStaminaTableName("max-stamina-table-0001")
);
MaxStaminaTableMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DeleteMaxStaminaTableMasterRequest;
using Gs2.Gs2Stamina.Result.DeleteMaxStaminaTableMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DeleteMaxStaminaTableMasterResult> asyncResult = null;
yield return client.DeleteMaxStaminaTableMaster(
new Gs2.Gs2Stamina.Request.DeleteMaxStaminaTableMasterRequest()
.WithNamespaceName("namespace-0001")
.WithMaxStaminaTableName("max-stamina-table-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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.deleteMaxStaminaTableMaster(
new Gs2Stamina.DeleteMaxStaminaTableMasterRequest()
.withNamespaceName("namespace-0001")
.withMaxStaminaTableName("max-stamina-table-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.delete_max_stamina_table_master(
stamina.DeleteMaxStaminaTableMasterRequest()
.with_namespace_name('namespace-0001')
.with_max_stamina_table_name('max-stamina-table-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.delete_max_stamina_table_master({
namespaceName="namespace-0001",
maxStaminaTableName="max-stamina-table-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('stamina')
api_result_handler = client.delete_max_stamina_table_master_async({
namespaceName="namespace-0001",
maxStaminaTableName="max-stamina-table-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;
describeRecoverIntervalTableMasters
スタミナ回復間隔テーブルマスターの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<RecoverIntervalTableMaster> | スタミナ回復間隔テーブルマスターのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DescribeRecoverIntervalTableMasters(
&stamina.DescribeRecoverIntervalTableMastersRequest {
NamespaceName: pointy.String("namespace-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeRecoverIntervalTableMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeRecoverIntervalTableMasters(
(new DescribeRecoverIntervalTableMastersRequest())
->withNamespaceName("namespace-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeRecoverIntervalTableMastersRequest;
import io.gs2.stamina.result.DescribeRecoverIntervalTableMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DescribeRecoverIntervalTableMastersResult result = client.describeRecoverIntervalTableMasters(
new DescribeRecoverIntervalTableMastersRequest()
.withNamespaceName("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
List<RecoverIntervalTableMaster> 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DescribeRecoverIntervalTableMastersRequest;
using Gs2.Gs2Stamina.Result.DescribeRecoverIntervalTableMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DescribeRecoverIntervalTableMastersResult> asyncResult = null;
yield return client.DescribeRecoverIntervalTableMasters(
new Gs2.Gs2Stamina.Request.DescribeRecoverIntervalTableMastersRequest()
.WithNamespaceName("namespace-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.describeRecoverIntervalTableMasters(
new Gs2Stamina.DescribeRecoverIntervalTableMastersRequest()
.withNamespaceName("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.describe_recover_interval_table_masters(
stamina.DescribeRecoverIntervalTableMastersRequest()
.with_namespace_name('namespace-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.describe_recover_interval_table_masters({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')
api_result_handler = client.describe_recover_interval_table_masters_async({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createRecoverIntervalTableMaster
スタミナ回復間隔テーブルマスターを新規作成
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
name | string | ✓ | ~ 128文字 | スタミナ回復間隔テーブル名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 128文字 | メタデータ | |||
experienceModelId | string | ✓ | ~ 1024文字 | 経験値モデルGRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | ランク毎のスタミナ回復間隔テーブル |
Result
型 | 説明 | |
---|---|---|
item | RecoverIntervalTableMaster | 作成したスタミナ回復間隔テーブルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CreateRecoverIntervalTableMaster(
&stamina.CreateRecoverIntervalTableMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Name: pointy.String("recover-interval-table-0001"),
Description: nil,
Metadata: nil,
ExperienceModelId: pointy.String("experienceModelId-0001"),
Values: []*int32{
pointy.Int32(40),
pointy.Int32(140),
pointy.Int32(240),
pointy.Int32(340),
pointy.Int32(440),
pointy.Int32(540),
pointy.Int32(640),
pointy.Int32(740),
pointy.Int32(840),
pointy.Int32(940),
pointy.Int32(1040),
pointy.Int32(1140),
pointy.Int32(1240),
pointy.Int32(1340),
pointy.Int32(1440),
pointy.Int32(1540),
pointy.Int32(1640),
pointy.Int32(1740),
pointy.Int32(1840),
pointy.Int32(1940),
pointy.Int32(2040),
pointy.Int32(2140),
pointy.Int32(2240),
pointy.Int32(2340),
pointy.Int32(2440),
pointy.Int32(2540),
pointy.Int32(2640),
pointy.Int32(2740),
pointy.Int32(2840),
pointy.Int32(2940),
pointy.Int32(3040),
pointy.Int32(3140),
pointy.Int32(3240),
pointy.Int32(3340),
pointy.Int32(3440),
pointy.Int32(3540),
pointy.Int32(3640),
pointy.Int32(3740),
pointy.Int32(3840),
pointy.Int32(3940),
pointy.Int32(4040),
pointy.Int32(4140),
pointy.Int32(4240),
pointy.Int32(4340),
pointy.Int32(4440),
pointy.Int32(4540),
pointy.Int32(4640),
pointy.Int32(4740),
pointy.Int32(4840),
pointy.Int32(4940),
pointy.Int32(5040),
pointy.Int32(5140),
pointy.Int32(5240),
pointy.Int32(5340),
pointy.Int32(5440),
pointy.Int32(5540),
pointy.Int32(5640),
pointy.Int32(5740),
pointy.Int32(5840),
pointy.Int32(5940),
pointy.Int32(6040),
pointy.Int32(6140),
pointy.Int32(6240),
pointy.Int32(6340),
pointy.Int32(6440),
pointy.Int32(6540),
pointy.Int32(6640),
pointy.Int32(6740),
pointy.Int32(6840),
pointy.Int32(6940),
pointy.Int32(7040),
pointy.Int32(7140),
pointy.Int32(7240),
pointy.Int32(7340),
pointy.Int32(7440),
pointy.Int32(7540),
pointy.Int32(7640),
pointy.Int32(7740),
pointy.Int32(7840),
pointy.Int32(7940),
pointy.Int32(8040),
pointy.Int32(8140),
pointy.Int32(8240),
pointy.Int32(8340),
pointy.Int32(8440),
pointy.Int32(8540),
pointy.Int32(8640),
pointy.Int32(8740),
pointy.Int32(8840),
pointy.Int32(8940),
pointy.Int32(9040),
pointy.Int32(9140),
pointy.Int32(9240),
pointy.Int32(9340),
pointy.Int32(9440),
pointy.Int32(9540),
pointy.Int32(9640),
pointy.Int32(9740),
pointy.Int32(9840),
pointy.Int32(9940),
},
}
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CreateRecoverIntervalTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createRecoverIntervalTableMaster(
(new CreateRecoverIntervalTableMasterRequest())
->withNamespaceName("namespace-0001")
->withName("recover-interval-table-0001")
->withDescription(null)
->withMetadata(null)
->withExperienceModelId("experienceModelId-0001")
->withValues([
40,
140,
240,
340,
440,
540,
640,
740,
840,
940,
1040,
1140,
1240,
1340,
1440,
1540,
1640,
1740,
1840,
1940,
2040,
2140,
2240,
2340,
2440,
2540,
2640,
2740,
2840,
2940,
3040,
3140,
3240,
3340,
3440,
3540,
3640,
3740,
3840,
3940,
4040,
4140,
4240,
4340,
4440,
4540,
4640,
4740,
4840,
4940,
5040,
5140,
5240,
5340,
5440,
5540,
5640,
5740,
5840,
5940,
6040,
6140,
6240,
6340,
6440,
6540,
6640,
6740,
6840,
6940,
7040,
7140,
7240,
7340,
7440,
7540,
7640,
7740,
7840,
7940,
8040,
8140,
8240,
8340,
8440,
8540,
8640,
8740,
8840,
8940,
9040,
9140,
9240,
9340,
9440,
9540,
9640,
9740,
9840,
9940,
])
);
$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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CreateRecoverIntervalTableMasterRequest;
import io.gs2.stamina.result.CreateRecoverIntervalTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
CreateRecoverIntervalTableMasterResult result = client.createRecoverIntervalTableMaster(
new CreateRecoverIntervalTableMasterRequest()
.withNamespaceName("namespace-0001")
.withName("recover-interval-table-0001")
.withDescription(null)
.withMetadata(null)
.withExperienceModelId("experienceModelId-0001")
.withValues(Arrays.asList(
40,
140,
240,
340,
440,
540,
640,
740,
840,
940,
1040,
1140,
1240,
1340,
1440,
1540,
1640,
1740,
1840,
1940,
2040,
2140,
2240,
2340,
2440,
2540,
2640,
2740,
2840,
2940,
3040,
3140,
3240,
3340,
3440,
3540,
3640,
3740,
3840,
3940,
4040,
4140,
4240,
4340,
4440,
4540,
4640,
4740,
4840,
4940,
5040,
5140,
5240,
5340,
5440,
5540,
5640,
5740,
5840,
5940,
6040,
6140,
6240,
6340,
6440,
6540,
6640,
6740,
6840,
6940,
7040,
7140,
7240,
7340,
7440,
7540,
7640,
7740,
7840,
7940,
8040,
8140,
8240,
8340,
8440,
8540,
8640,
8740,
8840,
8940,
9040,
9140,
9240,
9340,
9440,
9540,
9640,
9740,
9840,
9940
))
);
RecoverIntervalTableMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CreateRecoverIntervalTableMasterRequest;
using Gs2.Gs2Stamina.Result.CreateRecoverIntervalTableMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CreateRecoverIntervalTableMasterResult> asyncResult = null;
yield return client.CreateRecoverIntervalTableMaster(
new Gs2.Gs2Stamina.Request.CreateRecoverIntervalTableMasterRequest()
.WithNamespaceName("namespace-0001")
.WithName("recover-interval-table-0001")
.WithDescription(null)
.WithMetadata(null)
.WithExperienceModelId("experienceModelId-0001")
.WithValues(new int[] {
40,
140,
240,
340,
440,
540,
640,
740,
840,
940,
1040,
1140,
1240,
1340,
1440,
1540,
1640,
1740,
1840,
1940,
2040,
2140,
2240,
2340,
2440,
2540,
2640,
2740,
2840,
2940,
3040,
3140,
3240,
3340,
3440,
3540,
3640,
3740,
3840,
3940,
4040,
4140,
4240,
4340,
4440,
4540,
4640,
4740,
4840,
4940,
5040,
5140,
5240,
5340,
5440,
5540,
5640,
5740,
5840,
5940,
6040,
6140,
6240,
6340,
6440,
6540,
6640,
6740,
6840,
6940,
7040,
7140,
7240,
7340,
7440,
7540,
7640,
7740,
7840,
7940,
8040,
8140,
8240,
8340,
8440,
8540,
8640,
8740,
8840,
8940,
9040,
9140,
9240,
9340,
9440,
9540,
9640,
9740,
9840,
9940,
}),
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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.createRecoverIntervalTableMaster(
new Gs2Stamina.CreateRecoverIntervalTableMasterRequest()
.withNamespaceName("namespace-0001")
.withName("recover-interval-table-0001")
.withDescription(null)
.withMetadata(null)
.withExperienceModelId("experienceModelId-0001")
.withValues([
40,
140,
240,
340,
440,
540,
640,
740,
840,
940,
1040,
1140,
1240,
1340,
1440,
1540,
1640,
1740,
1840,
1940,
2040,
2140,
2240,
2340,
2440,
2540,
2640,
2740,
2840,
2940,
3040,
3140,
3240,
3340,
3440,
3540,
3640,
3740,
3840,
3940,
4040,
4140,
4240,
4340,
4440,
4540,
4640,
4740,
4840,
4940,
5040,
5140,
5240,
5340,
5440,
5540,
5640,
5740,
5840,
5940,
6040,
6140,
6240,
6340,
6440,
6540,
6640,
6740,
6840,
6940,
7040,
7140,
7240,
7340,
7440,
7540,
7640,
7740,
7840,
7940,
8040,
8140,
8240,
8340,
8440,
8540,
8640,
8740,
8840,
8940,
9040,
9140,
9240,
9340,
9440,
9540,
9640,
9740,
9840,
9940,
])
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.create_recover_interval_table_master(
stamina.CreateRecoverIntervalTableMasterRequest()
.with_namespace_name('namespace-0001')
.with_name('recover-interval-table-0001')
.with_description(None)
.with_metadata(None)
.with_experience_model_id('experienceModelId-0001')
.with_values([
40,
140,
240,
340,
440,
540,
640,
740,
840,
940,
1040,
1140,
1240,
1340,
1440,
1540,
1640,
1740,
1840,
1940,
2040,
2140,
2240,
2340,
2440,
2540,
2640,
2740,
2840,
2940,
3040,
3140,
3240,
3340,
3440,
3540,
3640,
3740,
3840,
3940,
4040,
4140,
4240,
4340,
4440,
4540,
4640,
4740,
4840,
4940,
5040,
5140,
5240,
5340,
5440,
5540,
5640,
5740,
5840,
5940,
6040,
6140,
6240,
6340,
6440,
6540,
6640,
6740,
6840,
6940,
7040,
7140,
7240,
7340,
7440,
7540,
7640,
7740,
7840,
7940,
8040,
8140,
8240,
8340,
8440,
8540,
8640,
8740,
8840,
8940,
9040,
9140,
9240,
9340,
9440,
9540,
9640,
9740,
9840,
9940,
])
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.create_recover_interval_table_master({
namespaceName="namespace-0001",
name="recover-interval-table-0001",
description=nil,
metadata=nil,
experienceModelId="experienceModelId-0001",
values={
40,
140,
240,
340,
440,
540,
640,
740,
840,
940,
1040,
1140,
1240,
1340,
1440,
1540,
1640,
1740,
1840,
1940,
2040,
2140,
2240,
2340,
2440,
2540,
2640,
2740,
2840,
2940,
3040,
3140,
3240,
3340,
3440,
3540,
3640,
3740,
3840,
3940,
4040,
4140,
4240,
4340,
4440,
4540,
4640,
4740,
4840,
4940,
5040,
5140,
5240,
5340,
5440,
5540,
5640,
5740,
5840,
5940,
6040,
6140,
6240,
6340,
6440,
6540,
6640,
6740,
6840,
6940,
7040,
7140,
7240,
7340,
7440,
7540,
7640,
7740,
7840,
7940,
8040,
8140,
8240,
8340,
8440,
8540,
8640,
8740,
8840,
8940,
9040,
9140,
9240,
9340,
9440,
9540,
9640,
9740,
9840,
9940
},
})
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('stamina')
api_result_handler = client.create_recover_interval_table_master_async({
namespaceName="namespace-0001",
name="recover-interval-table-0001",
description=nil,
metadata=nil,
experienceModelId="experienceModelId-0001",
values={
40,
140,
240,
340,
440,
540,
640,
740,
840,
940,
1040,
1140,
1240,
1340,
1440,
1540,
1640,
1740,
1840,
1940,
2040,
2140,
2240,
2340,
2440,
2540,
2640,
2740,
2840,
2940,
3040,
3140,
3240,
3340,
3440,
3540,
3640,
3740,
3840,
3940,
4040,
4140,
4240,
4340,
4440,
4540,
4640,
4740,
4840,
4940,
5040,
5140,
5240,
5340,
5440,
5540,
5640,
5740,
5840,
5940,
6040,
6140,
6240,
6340,
6440,
6540,
6640,
6740,
6840,
6940,
7040,
7140,
7240,
7340,
7440,
7540,
7640,
7740,
7840,
7940,
8040,
8140,
8240,
8340,
8440,
8540,
8640,
8740,
8840,
8940,
9040,
9140,
9240,
9340,
9440,
9540,
9640,
9740,
9840,
9940
},
})
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;
getRecoverIntervalTableMaster
スタミナ回復間隔テーブルマスターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
recoverIntervalTableName | string | ✓ | ~ 128文字 | スタミナ回復間隔テーブル名 |
Result
型 | 説明 | |
---|---|---|
item | RecoverIntervalTableMaster | スタミナ回復間隔テーブルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.GetRecoverIntervalTableMaster(
&stamina.GetRecoverIntervalTableMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
RecoverIntervalTableName: pointy.String("recover-interval-table-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetRecoverIntervalTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getRecoverIntervalTableMaster(
(new GetRecoverIntervalTableMasterRequest())
->withNamespaceName("namespace-0001")
->withRecoverIntervalTableName("recover-interval-table-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetRecoverIntervalTableMasterRequest;
import io.gs2.stamina.result.GetRecoverIntervalTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
GetRecoverIntervalTableMasterResult result = client.getRecoverIntervalTableMaster(
new GetRecoverIntervalTableMasterRequest()
.withNamespaceName("namespace-0001")
.withRecoverIntervalTableName("recover-interval-table-0001")
);
RecoverIntervalTableMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.GetRecoverIntervalTableMasterRequest;
using Gs2.Gs2Stamina.Result.GetRecoverIntervalTableMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.GetRecoverIntervalTableMasterResult> asyncResult = null;
yield return client.GetRecoverIntervalTableMaster(
new Gs2.Gs2Stamina.Request.GetRecoverIntervalTableMasterRequest()
.WithNamespaceName("namespace-0001")
.WithRecoverIntervalTableName("recover-interval-table-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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.getRecoverIntervalTableMaster(
new Gs2Stamina.GetRecoverIntervalTableMasterRequest()
.withNamespaceName("namespace-0001")
.withRecoverIntervalTableName("recover-interval-table-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.get_recover_interval_table_master(
stamina.GetRecoverIntervalTableMasterRequest()
.with_namespace_name('namespace-0001')
.with_recover_interval_table_name('recover-interval-table-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_recover_interval_table_master({
namespaceName="namespace-0001",
recoverIntervalTableName="recover-interval-table-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('stamina')
api_result_handler = client.get_recover_interval_table_master_async({
namespaceName="namespace-0001",
recoverIntervalTableName="recover-interval-table-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;
updateRecoverIntervalTableMaster
スタミナ回復間隔テーブルマスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
recoverIntervalTableName | string | ✓ | ~ 128文字 | スタミナ回復間隔テーブル名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 128文字 | メタデータ | |||
experienceModelId | string | ✓ | ~ 1024文字 | 経験値モデルGRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | ランク毎のスタミナ回復間隔テーブル |
Result
型 | 説明 | |
---|---|---|
item | RecoverIntervalTableMaster | 更新したスタミナ回復間隔テーブルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.UpdateRecoverIntervalTableMaster(
&stamina.UpdateRecoverIntervalTableMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
RecoverIntervalTableName: pointy.String("recover-interval-table-0001"),
Description: pointy.String("description1"),
Metadata: nil,
ExperienceModelId: pointy.String("experienceModelId-1001"),
Values: []*int32{
pointy.Int32(40),
pointy.Int32(190),
pointy.Int32(340),
pointy.Int32(490),
pointy.Int32(640),
pointy.Int32(790),
pointy.Int32(940),
pointy.Int32(1090),
pointy.Int32(1240),
pointy.Int32(1390),
pointy.Int32(1540),
pointy.Int32(1690),
pointy.Int32(1840),
pointy.Int32(1990),
pointy.Int32(2140),
pointy.Int32(2290),
pointy.Int32(2440),
pointy.Int32(2590),
pointy.Int32(2740),
pointy.Int32(2890),
pointy.Int32(3040),
pointy.Int32(3190),
pointy.Int32(3340),
pointy.Int32(3490),
pointy.Int32(3640),
pointy.Int32(3790),
pointy.Int32(3940),
pointy.Int32(4090),
pointy.Int32(4240),
pointy.Int32(4390),
pointy.Int32(4540),
pointy.Int32(4690),
pointy.Int32(4840),
pointy.Int32(4990),
pointy.Int32(5140),
pointy.Int32(5290),
pointy.Int32(5440),
pointy.Int32(5590),
pointy.Int32(5740),
pointy.Int32(5890),
pointy.Int32(6040),
pointy.Int32(6190),
pointy.Int32(6340),
pointy.Int32(6490),
pointy.Int32(6640),
pointy.Int32(6790),
pointy.Int32(6940),
pointy.Int32(7090),
pointy.Int32(7240),
pointy.Int32(7390),
pointy.Int32(7540),
pointy.Int32(7690),
pointy.Int32(7840),
pointy.Int32(7990),
pointy.Int32(8140),
pointy.Int32(8290),
pointy.Int32(8440),
pointy.Int32(8590),
pointy.Int32(8740),
pointy.Int32(8890),
pointy.Int32(9040),
pointy.Int32(9190),
pointy.Int32(9340),
pointy.Int32(9490),
pointy.Int32(9640),
pointy.Int32(9790),
pointy.Int32(9940),
pointy.Int32(10090),
pointy.Int32(10240),
pointy.Int32(10390),
pointy.Int32(10540),
pointy.Int32(10690),
pointy.Int32(10840),
pointy.Int32(10990),
pointy.Int32(11140),
pointy.Int32(11290),
pointy.Int32(11440),
pointy.Int32(11590),
pointy.Int32(11740),
pointy.Int32(11890),
pointy.Int32(12040),
pointy.Int32(12190),
pointy.Int32(12340),
pointy.Int32(12490),
pointy.Int32(12640),
pointy.Int32(12790),
pointy.Int32(12940),
pointy.Int32(13090),
pointy.Int32(13240),
pointy.Int32(13390),
pointy.Int32(13540),
pointy.Int32(13690),
pointy.Int32(13840),
pointy.Int32(13990),
pointy.Int32(14140),
pointy.Int32(14290),
pointy.Int32(14440),
pointy.Int32(14590),
pointy.Int32(14740),
pointy.Int32(14890),
},
}
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateRecoverIntervalTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateRecoverIntervalTableMaster(
(new UpdateRecoverIntervalTableMasterRequest())
->withNamespaceName("namespace-0001")
->withRecoverIntervalTableName("recover-interval-table-0001")
->withDescription("description1")
->withMetadata(null)
->withExperienceModelId("experienceModelId-1001")
->withValues([
40,
190,
340,
490,
640,
790,
940,
1090,
1240,
1390,
1540,
1690,
1840,
1990,
2140,
2290,
2440,
2590,
2740,
2890,
3040,
3190,
3340,
3490,
3640,
3790,
3940,
4090,
4240,
4390,
4540,
4690,
4840,
4990,
5140,
5290,
5440,
5590,
5740,
5890,
6040,
6190,
6340,
6490,
6640,
6790,
6940,
7090,
7240,
7390,
7540,
7690,
7840,
7990,
8140,
8290,
8440,
8590,
8740,
8890,
9040,
9190,
9340,
9490,
9640,
9790,
9940,
10090,
10240,
10390,
10540,
10690,
10840,
10990,
11140,
11290,
11440,
11590,
11740,
11890,
12040,
12190,
12340,
12490,
12640,
12790,
12940,
13090,
13240,
13390,
13540,
13690,
13840,
13990,
14140,
14290,
14440,
14590,
14740,
14890,
])
);
$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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateRecoverIntervalTableMasterRequest;
import io.gs2.stamina.result.UpdateRecoverIntervalTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
UpdateRecoverIntervalTableMasterResult result = client.updateRecoverIntervalTableMaster(
new UpdateRecoverIntervalTableMasterRequest()
.withNamespaceName("namespace-0001")
.withRecoverIntervalTableName("recover-interval-table-0001")
.withDescription("description1")
.withMetadata(null)
.withExperienceModelId("experienceModelId-1001")
.withValues(Arrays.asList(
40,
190,
340,
490,
640,
790,
940,
1090,
1240,
1390,
1540,
1690,
1840,
1990,
2140,
2290,
2440,
2590,
2740,
2890,
3040,
3190,
3340,
3490,
3640,
3790,
3940,
4090,
4240,
4390,
4540,
4690,
4840,
4990,
5140,
5290,
5440,
5590,
5740,
5890,
6040,
6190,
6340,
6490,
6640,
6790,
6940,
7090,
7240,
7390,
7540,
7690,
7840,
7990,
8140,
8290,
8440,
8590,
8740,
8890,
9040,
9190,
9340,
9490,
9640,
9790,
9940,
10090,
10240,
10390,
10540,
10690,
10840,
10990,
11140,
11290,
11440,
11590,
11740,
11890,
12040,
12190,
12340,
12490,
12640,
12790,
12940,
13090,
13240,
13390,
13540,
13690,
13840,
13990,
14140,
14290,
14440,
14590,
14740,
14890
))
);
RecoverIntervalTableMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.UpdateRecoverIntervalTableMasterRequest;
using Gs2.Gs2Stamina.Result.UpdateRecoverIntervalTableMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.UpdateRecoverIntervalTableMasterResult> asyncResult = null;
yield return client.UpdateRecoverIntervalTableMaster(
new Gs2.Gs2Stamina.Request.UpdateRecoverIntervalTableMasterRequest()
.WithNamespaceName("namespace-0001")
.WithRecoverIntervalTableName("recover-interval-table-0001")
.WithDescription("description1")
.WithMetadata(null)
.WithExperienceModelId("experienceModelId-1001")
.WithValues(new int[] {
40,
190,
340,
490,
640,
790,
940,
1090,
1240,
1390,
1540,
1690,
1840,
1990,
2140,
2290,
2440,
2590,
2740,
2890,
3040,
3190,
3340,
3490,
3640,
3790,
3940,
4090,
4240,
4390,
4540,
4690,
4840,
4990,
5140,
5290,
5440,
5590,
5740,
5890,
6040,
6190,
6340,
6490,
6640,
6790,
6940,
7090,
7240,
7390,
7540,
7690,
7840,
7990,
8140,
8290,
8440,
8590,
8740,
8890,
9040,
9190,
9340,
9490,
9640,
9790,
9940,
10090,
10240,
10390,
10540,
10690,
10840,
10990,
11140,
11290,
11440,
11590,
11740,
11890,
12040,
12190,
12340,
12490,
12640,
12790,
12940,
13090,
13240,
13390,
13540,
13690,
13840,
13990,
14140,
14290,
14440,
14590,
14740,
14890,
}),
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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.updateRecoverIntervalTableMaster(
new Gs2Stamina.UpdateRecoverIntervalTableMasterRequest()
.withNamespaceName("namespace-0001")
.withRecoverIntervalTableName("recover-interval-table-0001")
.withDescription("description1")
.withMetadata(null)
.withExperienceModelId("experienceModelId-1001")
.withValues([
40,
190,
340,
490,
640,
790,
940,
1090,
1240,
1390,
1540,
1690,
1840,
1990,
2140,
2290,
2440,
2590,
2740,
2890,
3040,
3190,
3340,
3490,
3640,
3790,
3940,
4090,
4240,
4390,
4540,
4690,
4840,
4990,
5140,
5290,
5440,
5590,
5740,
5890,
6040,
6190,
6340,
6490,
6640,
6790,
6940,
7090,
7240,
7390,
7540,
7690,
7840,
7990,
8140,
8290,
8440,
8590,
8740,
8890,
9040,
9190,
9340,
9490,
9640,
9790,
9940,
10090,
10240,
10390,
10540,
10690,
10840,
10990,
11140,
11290,
11440,
11590,
11740,
11890,
12040,
12190,
12340,
12490,
12640,
12790,
12940,
13090,
13240,
13390,
13540,
13690,
13840,
13990,
14140,
14290,
14440,
14590,
14740,
14890,
])
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.update_recover_interval_table_master(
stamina.UpdateRecoverIntervalTableMasterRequest()
.with_namespace_name('namespace-0001')
.with_recover_interval_table_name('recover-interval-table-0001')
.with_description('description1')
.with_metadata(None)
.with_experience_model_id('experienceModelId-1001')
.with_values([
40,
190,
340,
490,
640,
790,
940,
1090,
1240,
1390,
1540,
1690,
1840,
1990,
2140,
2290,
2440,
2590,
2740,
2890,
3040,
3190,
3340,
3490,
3640,
3790,
3940,
4090,
4240,
4390,
4540,
4690,
4840,
4990,
5140,
5290,
5440,
5590,
5740,
5890,
6040,
6190,
6340,
6490,
6640,
6790,
6940,
7090,
7240,
7390,
7540,
7690,
7840,
7990,
8140,
8290,
8440,
8590,
8740,
8890,
9040,
9190,
9340,
9490,
9640,
9790,
9940,
10090,
10240,
10390,
10540,
10690,
10840,
10990,
11140,
11290,
11440,
11590,
11740,
11890,
12040,
12190,
12340,
12490,
12640,
12790,
12940,
13090,
13240,
13390,
13540,
13690,
13840,
13990,
14140,
14290,
14440,
14590,
14740,
14890,
])
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.update_recover_interval_table_master({
namespaceName="namespace-0001",
recoverIntervalTableName="recover-interval-table-0001",
description="description1",
metadata=nil,
experienceModelId="experienceModelId-1001",
values={
40,
190,
340,
490,
640,
790,
940,
1090,
1240,
1390,
1540,
1690,
1840,
1990,
2140,
2290,
2440,
2590,
2740,
2890,
3040,
3190,
3340,
3490,
3640,
3790,
3940,
4090,
4240,
4390,
4540,
4690,
4840,
4990,
5140,
5290,
5440,
5590,
5740,
5890,
6040,
6190,
6340,
6490,
6640,
6790,
6940,
7090,
7240,
7390,
7540,
7690,
7840,
7990,
8140,
8290,
8440,
8590,
8740,
8890,
9040,
9190,
9340,
9490,
9640,
9790,
9940,
10090,
10240,
10390,
10540,
10690,
10840,
10990,
11140,
11290,
11440,
11590,
11740,
11890,
12040,
12190,
12340,
12490,
12640,
12790,
12940,
13090,
13240,
13390,
13540,
13690,
13840,
13990,
14140,
14290,
14440,
14590,
14740,
14890
},
})
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('stamina')
api_result_handler = client.update_recover_interval_table_master_async({
namespaceName="namespace-0001",
recoverIntervalTableName="recover-interval-table-0001",
description="description1",
metadata=nil,
experienceModelId="experienceModelId-1001",
values={
40,
190,
340,
490,
640,
790,
940,
1090,
1240,
1390,
1540,
1690,
1840,
1990,
2140,
2290,
2440,
2590,
2740,
2890,
3040,
3190,
3340,
3490,
3640,
3790,
3940,
4090,
4240,
4390,
4540,
4690,
4840,
4990,
5140,
5290,
5440,
5590,
5740,
5890,
6040,
6190,
6340,
6490,
6640,
6790,
6940,
7090,
7240,
7390,
7540,
7690,
7840,
7990,
8140,
8290,
8440,
8590,
8740,
8890,
9040,
9190,
9340,
9490,
9640,
9790,
9940,
10090,
10240,
10390,
10540,
10690,
10840,
10990,
11140,
11290,
11440,
11590,
11740,
11890,
12040,
12190,
12340,
12490,
12640,
12790,
12940,
13090,
13240,
13390,
13540,
13690,
13840,
13990,
14140,
14290,
14440,
14590,
14740,
14890
},
})
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;
deleteRecoverIntervalTableMaster
スタミナ回復間隔テーブルマスターを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
recoverIntervalTableName | string | ✓ | ~ 128文字 | スタミナ回復間隔テーブル名 |
Result
型 | 説明 | |
---|---|---|
item | RecoverIntervalTableMaster | 削除したスタミナ回復間隔テーブルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DeleteRecoverIntervalTableMaster(
&stamina.DeleteRecoverIntervalTableMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
RecoverIntervalTableName: pointy.String("recover-interval-table-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DeleteRecoverIntervalTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteRecoverIntervalTableMaster(
(new DeleteRecoverIntervalTableMasterRequest())
->withNamespaceName("namespace-0001")
->withRecoverIntervalTableName("recover-interval-table-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DeleteRecoverIntervalTableMasterRequest;
import io.gs2.stamina.result.DeleteRecoverIntervalTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DeleteRecoverIntervalTableMasterResult result = client.deleteRecoverIntervalTableMaster(
new DeleteRecoverIntervalTableMasterRequest()
.withNamespaceName("namespace-0001")
.withRecoverIntervalTableName("recover-interval-table-0001")
);
RecoverIntervalTableMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DeleteRecoverIntervalTableMasterRequest;
using Gs2.Gs2Stamina.Result.DeleteRecoverIntervalTableMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DeleteRecoverIntervalTableMasterResult> asyncResult = null;
yield return client.DeleteRecoverIntervalTableMaster(
new Gs2.Gs2Stamina.Request.DeleteRecoverIntervalTableMasterRequest()
.WithNamespaceName("namespace-0001")
.WithRecoverIntervalTableName("recover-interval-table-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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.deleteRecoverIntervalTableMaster(
new Gs2Stamina.DeleteRecoverIntervalTableMasterRequest()
.withNamespaceName("namespace-0001")
.withRecoverIntervalTableName("recover-interval-table-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.delete_recover_interval_table_master(
stamina.DeleteRecoverIntervalTableMasterRequest()
.with_namespace_name('namespace-0001')
.with_recover_interval_table_name('recover-interval-table-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.delete_recover_interval_table_master({
namespaceName="namespace-0001",
recoverIntervalTableName="recover-interval-table-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('stamina')
api_result_handler = client.delete_recover_interval_table_master_async({
namespaceName="namespace-0001",
recoverIntervalTableName="recover-interval-table-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;
describeRecoverValueTableMasters
スタミナ回復量テーブルマスターの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<RecoverValueTableMaster> | スタミナ回復量テーブルマスターのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DescribeRecoverValueTableMasters(
&stamina.DescribeRecoverValueTableMastersRequest {
NamespaceName: pointy.String("namespace-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeRecoverValueTableMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeRecoverValueTableMasters(
(new DescribeRecoverValueTableMastersRequest())
->withNamespaceName("namespace-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeRecoverValueTableMastersRequest;
import io.gs2.stamina.result.DescribeRecoverValueTableMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DescribeRecoverValueTableMastersResult result = client.describeRecoverValueTableMasters(
new DescribeRecoverValueTableMastersRequest()
.withNamespaceName("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
List<RecoverValueTableMaster> 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DescribeRecoverValueTableMastersRequest;
using Gs2.Gs2Stamina.Result.DescribeRecoverValueTableMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DescribeRecoverValueTableMastersResult> asyncResult = null;
yield return client.DescribeRecoverValueTableMasters(
new Gs2.Gs2Stamina.Request.DescribeRecoverValueTableMastersRequest()
.WithNamespaceName("namespace-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.describeRecoverValueTableMasters(
new Gs2Stamina.DescribeRecoverValueTableMastersRequest()
.withNamespaceName("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.describe_recover_value_table_masters(
stamina.DescribeRecoverValueTableMastersRequest()
.with_namespace_name('namespace-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.describe_recover_value_table_masters({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')
api_result_handler = client.describe_recover_value_table_masters_async({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createRecoverValueTableMaster
スタミナ回復量テーブルマスターを新規作成
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
name | string | ✓ | ~ 128文字 | スタミナ回復量テーブル名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 128文字 | メタデータ | |||
experienceModelId | string | ✓ | ~ 1024文字 | 経験値モデルGRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | ランク毎のスタミナ回復量テーブル |
Result
型 | 説明 | |
---|---|---|
item | RecoverValueTableMaster | 作成したスタミナ回復量テーブルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.CreateRecoverValueTableMaster(
&stamina.CreateRecoverValueTableMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Name: pointy.String("recover-value-table-0001"),
Description: nil,
Metadata: nil,
ExperienceModelId: pointy.String("experienceModelId-0001"),
Values: []*int32{
pointy.Int32(30),
pointy.Int32(130),
pointy.Int32(230),
pointy.Int32(330),
pointy.Int32(430),
pointy.Int32(530),
pointy.Int32(630),
pointy.Int32(730),
pointy.Int32(830),
pointy.Int32(930),
pointy.Int32(1030),
pointy.Int32(1130),
pointy.Int32(1230),
pointy.Int32(1330),
pointy.Int32(1430),
pointy.Int32(1530),
pointy.Int32(1630),
pointy.Int32(1730),
pointy.Int32(1830),
pointy.Int32(1930),
pointy.Int32(2030),
pointy.Int32(2130),
pointy.Int32(2230),
pointy.Int32(2330),
pointy.Int32(2430),
pointy.Int32(2530),
pointy.Int32(2630),
pointy.Int32(2730),
pointy.Int32(2830),
pointy.Int32(2930),
pointy.Int32(3030),
pointy.Int32(3130),
pointy.Int32(3230),
pointy.Int32(3330),
pointy.Int32(3430),
pointy.Int32(3530),
pointy.Int32(3630),
pointy.Int32(3730),
pointy.Int32(3830),
pointy.Int32(3930),
pointy.Int32(4030),
pointy.Int32(4130),
pointy.Int32(4230),
pointy.Int32(4330),
pointy.Int32(4430),
pointy.Int32(4530),
pointy.Int32(4630),
pointy.Int32(4730),
pointy.Int32(4830),
pointy.Int32(4930),
pointy.Int32(5030),
pointy.Int32(5130),
pointy.Int32(5230),
pointy.Int32(5330),
pointy.Int32(5430),
pointy.Int32(5530),
pointy.Int32(5630),
pointy.Int32(5730),
pointy.Int32(5830),
pointy.Int32(5930),
pointy.Int32(6030),
pointy.Int32(6130),
pointy.Int32(6230),
pointy.Int32(6330),
pointy.Int32(6430),
pointy.Int32(6530),
pointy.Int32(6630),
pointy.Int32(6730),
pointy.Int32(6830),
pointy.Int32(6930),
pointy.Int32(7030),
pointy.Int32(7130),
pointy.Int32(7230),
pointy.Int32(7330),
pointy.Int32(7430),
pointy.Int32(7530),
pointy.Int32(7630),
pointy.Int32(7730),
pointy.Int32(7830),
pointy.Int32(7930),
pointy.Int32(8030),
pointy.Int32(8130),
pointy.Int32(8230),
pointy.Int32(8330),
pointy.Int32(8430),
pointy.Int32(8530),
pointy.Int32(8630),
pointy.Int32(8730),
pointy.Int32(8830),
pointy.Int32(8930),
pointy.Int32(9030),
pointy.Int32(9130),
pointy.Int32(9230),
pointy.Int32(9330),
pointy.Int32(9430),
pointy.Int32(9530),
pointy.Int32(9630),
pointy.Int32(9730),
pointy.Int32(9830),
pointy.Int32(9930),
},
}
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\CreateRecoverValueTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createRecoverValueTableMaster(
(new CreateRecoverValueTableMasterRequest())
->withNamespaceName("namespace-0001")
->withName("recover-value-table-0001")
->withDescription(null)
->withMetadata(null)
->withExperienceModelId("experienceModelId-0001")
->withValues([
30,
130,
230,
330,
430,
530,
630,
730,
830,
930,
1030,
1130,
1230,
1330,
1430,
1530,
1630,
1730,
1830,
1930,
2030,
2130,
2230,
2330,
2430,
2530,
2630,
2730,
2830,
2930,
3030,
3130,
3230,
3330,
3430,
3530,
3630,
3730,
3830,
3930,
4030,
4130,
4230,
4330,
4430,
4530,
4630,
4730,
4830,
4930,
5030,
5130,
5230,
5330,
5430,
5530,
5630,
5730,
5830,
5930,
6030,
6130,
6230,
6330,
6430,
6530,
6630,
6730,
6830,
6930,
7030,
7130,
7230,
7330,
7430,
7530,
7630,
7730,
7830,
7930,
8030,
8130,
8230,
8330,
8430,
8530,
8630,
8730,
8830,
8930,
9030,
9130,
9230,
9330,
9430,
9530,
9630,
9730,
9830,
9930,
])
);
$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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.CreateRecoverValueTableMasterRequest;
import io.gs2.stamina.result.CreateRecoverValueTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
CreateRecoverValueTableMasterResult result = client.createRecoverValueTableMaster(
new CreateRecoverValueTableMasterRequest()
.withNamespaceName("namespace-0001")
.withName("recover-value-table-0001")
.withDescription(null)
.withMetadata(null)
.withExperienceModelId("experienceModelId-0001")
.withValues(Arrays.asList(
30,
130,
230,
330,
430,
530,
630,
730,
830,
930,
1030,
1130,
1230,
1330,
1430,
1530,
1630,
1730,
1830,
1930,
2030,
2130,
2230,
2330,
2430,
2530,
2630,
2730,
2830,
2930,
3030,
3130,
3230,
3330,
3430,
3530,
3630,
3730,
3830,
3930,
4030,
4130,
4230,
4330,
4430,
4530,
4630,
4730,
4830,
4930,
5030,
5130,
5230,
5330,
5430,
5530,
5630,
5730,
5830,
5930,
6030,
6130,
6230,
6330,
6430,
6530,
6630,
6730,
6830,
6930,
7030,
7130,
7230,
7330,
7430,
7530,
7630,
7730,
7830,
7930,
8030,
8130,
8230,
8330,
8430,
8530,
8630,
8730,
8830,
8930,
9030,
9130,
9230,
9330,
9430,
9530,
9630,
9730,
9830,
9930
))
);
RecoverValueTableMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.CreateRecoverValueTableMasterRequest;
using Gs2.Gs2Stamina.Result.CreateRecoverValueTableMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.CreateRecoverValueTableMasterResult> asyncResult = null;
yield return client.CreateRecoverValueTableMaster(
new Gs2.Gs2Stamina.Request.CreateRecoverValueTableMasterRequest()
.WithNamespaceName("namespace-0001")
.WithName("recover-value-table-0001")
.WithDescription(null)
.WithMetadata(null)
.WithExperienceModelId("experienceModelId-0001")
.WithValues(new int[] {
30,
130,
230,
330,
430,
530,
630,
730,
830,
930,
1030,
1130,
1230,
1330,
1430,
1530,
1630,
1730,
1830,
1930,
2030,
2130,
2230,
2330,
2430,
2530,
2630,
2730,
2830,
2930,
3030,
3130,
3230,
3330,
3430,
3530,
3630,
3730,
3830,
3930,
4030,
4130,
4230,
4330,
4430,
4530,
4630,
4730,
4830,
4930,
5030,
5130,
5230,
5330,
5430,
5530,
5630,
5730,
5830,
5930,
6030,
6130,
6230,
6330,
6430,
6530,
6630,
6730,
6830,
6930,
7030,
7130,
7230,
7330,
7430,
7530,
7630,
7730,
7830,
7930,
8030,
8130,
8230,
8330,
8430,
8530,
8630,
8730,
8830,
8930,
9030,
9130,
9230,
9330,
9430,
9530,
9630,
9730,
9830,
9930,
}),
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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.createRecoverValueTableMaster(
new Gs2Stamina.CreateRecoverValueTableMasterRequest()
.withNamespaceName("namespace-0001")
.withName("recover-value-table-0001")
.withDescription(null)
.withMetadata(null)
.withExperienceModelId("experienceModelId-0001")
.withValues([
30,
130,
230,
330,
430,
530,
630,
730,
830,
930,
1030,
1130,
1230,
1330,
1430,
1530,
1630,
1730,
1830,
1930,
2030,
2130,
2230,
2330,
2430,
2530,
2630,
2730,
2830,
2930,
3030,
3130,
3230,
3330,
3430,
3530,
3630,
3730,
3830,
3930,
4030,
4130,
4230,
4330,
4430,
4530,
4630,
4730,
4830,
4930,
5030,
5130,
5230,
5330,
5430,
5530,
5630,
5730,
5830,
5930,
6030,
6130,
6230,
6330,
6430,
6530,
6630,
6730,
6830,
6930,
7030,
7130,
7230,
7330,
7430,
7530,
7630,
7730,
7830,
7930,
8030,
8130,
8230,
8330,
8430,
8530,
8630,
8730,
8830,
8930,
9030,
9130,
9230,
9330,
9430,
9530,
9630,
9730,
9830,
9930,
])
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.create_recover_value_table_master(
stamina.CreateRecoverValueTableMasterRequest()
.with_namespace_name('namespace-0001')
.with_name('recover-value-table-0001')
.with_description(None)
.with_metadata(None)
.with_experience_model_id('experienceModelId-0001')
.with_values([
30,
130,
230,
330,
430,
530,
630,
730,
830,
930,
1030,
1130,
1230,
1330,
1430,
1530,
1630,
1730,
1830,
1930,
2030,
2130,
2230,
2330,
2430,
2530,
2630,
2730,
2830,
2930,
3030,
3130,
3230,
3330,
3430,
3530,
3630,
3730,
3830,
3930,
4030,
4130,
4230,
4330,
4430,
4530,
4630,
4730,
4830,
4930,
5030,
5130,
5230,
5330,
5430,
5530,
5630,
5730,
5830,
5930,
6030,
6130,
6230,
6330,
6430,
6530,
6630,
6730,
6830,
6930,
7030,
7130,
7230,
7330,
7430,
7530,
7630,
7730,
7830,
7930,
8030,
8130,
8230,
8330,
8430,
8530,
8630,
8730,
8830,
8930,
9030,
9130,
9230,
9330,
9430,
9530,
9630,
9730,
9830,
9930,
])
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.create_recover_value_table_master({
namespaceName="namespace-0001",
name="recover-value-table-0001",
description=nil,
metadata=nil,
experienceModelId="experienceModelId-0001",
values={
30,
130,
230,
330,
430,
530,
630,
730,
830,
930,
1030,
1130,
1230,
1330,
1430,
1530,
1630,
1730,
1830,
1930,
2030,
2130,
2230,
2330,
2430,
2530,
2630,
2730,
2830,
2930,
3030,
3130,
3230,
3330,
3430,
3530,
3630,
3730,
3830,
3930,
4030,
4130,
4230,
4330,
4430,
4530,
4630,
4730,
4830,
4930,
5030,
5130,
5230,
5330,
5430,
5530,
5630,
5730,
5830,
5930,
6030,
6130,
6230,
6330,
6430,
6530,
6630,
6730,
6830,
6930,
7030,
7130,
7230,
7330,
7430,
7530,
7630,
7730,
7830,
7930,
8030,
8130,
8230,
8330,
8430,
8530,
8630,
8730,
8830,
8930,
9030,
9130,
9230,
9330,
9430,
9530,
9630,
9730,
9830,
9930
},
})
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('stamina')
api_result_handler = client.create_recover_value_table_master_async({
namespaceName="namespace-0001",
name="recover-value-table-0001",
description=nil,
metadata=nil,
experienceModelId="experienceModelId-0001",
values={
30,
130,
230,
330,
430,
530,
630,
730,
830,
930,
1030,
1130,
1230,
1330,
1430,
1530,
1630,
1730,
1830,
1930,
2030,
2130,
2230,
2330,
2430,
2530,
2630,
2730,
2830,
2930,
3030,
3130,
3230,
3330,
3430,
3530,
3630,
3730,
3830,
3930,
4030,
4130,
4230,
4330,
4430,
4530,
4630,
4730,
4830,
4930,
5030,
5130,
5230,
5330,
5430,
5530,
5630,
5730,
5830,
5930,
6030,
6130,
6230,
6330,
6430,
6530,
6630,
6730,
6830,
6930,
7030,
7130,
7230,
7330,
7430,
7530,
7630,
7730,
7830,
7930,
8030,
8130,
8230,
8330,
8430,
8530,
8630,
8730,
8830,
8930,
9030,
9130,
9230,
9330,
9430,
9530,
9630,
9730,
9830,
9930
},
})
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;
getRecoverValueTableMaster
スタミナ回復量テーブルマスターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
recoverValueTableName | string | ✓ | ~ 128文字 | スタミナ回復量テーブル名 |
Result
型 | 説明 | |
---|---|---|
item | RecoverValueTableMaster | スタミナ回復量テーブルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.GetRecoverValueTableMaster(
&stamina.GetRecoverValueTableMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
RecoverValueTableName: pointy.String("recover-value-table-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetRecoverValueTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getRecoverValueTableMaster(
(new GetRecoverValueTableMasterRequest())
->withNamespaceName("namespace-0001")
->withRecoverValueTableName("recover-value-table-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetRecoverValueTableMasterRequest;
import io.gs2.stamina.result.GetRecoverValueTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
GetRecoverValueTableMasterResult result = client.getRecoverValueTableMaster(
new GetRecoverValueTableMasterRequest()
.withNamespaceName("namespace-0001")
.withRecoverValueTableName("recover-value-table-0001")
);
RecoverValueTableMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.GetRecoverValueTableMasterRequest;
using Gs2.Gs2Stamina.Result.GetRecoverValueTableMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.GetRecoverValueTableMasterResult> asyncResult = null;
yield return client.GetRecoverValueTableMaster(
new Gs2.Gs2Stamina.Request.GetRecoverValueTableMasterRequest()
.WithNamespaceName("namespace-0001")
.WithRecoverValueTableName("recover-value-table-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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.getRecoverValueTableMaster(
new Gs2Stamina.GetRecoverValueTableMasterRequest()
.withNamespaceName("namespace-0001")
.withRecoverValueTableName("recover-value-table-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.get_recover_value_table_master(
stamina.GetRecoverValueTableMasterRequest()
.with_namespace_name('namespace-0001')
.with_recover_value_table_name('recover-value-table-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_recover_value_table_master({
namespaceName="namespace-0001",
recoverValueTableName="recover-value-table-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('stamina')
api_result_handler = client.get_recover_value_table_master_async({
namespaceName="namespace-0001",
recoverValueTableName="recover-value-table-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;
updateRecoverValueTableMaster
スタミナ回復量テーブルマスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
recoverValueTableName | string | ✓ | ~ 128文字 | スタミナ回復量テーブル名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 128文字 | メタデータ | |||
experienceModelId | string | ✓ | ~ 1024文字 | 経験値モデルGRN | ||
values | List<int> | ✓ | 1 ~ 1024 items | ランク毎のスタミナ回復量テーブル |
Result
型 | 説明 | |
---|---|---|
item | RecoverValueTableMaster | 更新したスタミナ回復量テーブルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.UpdateRecoverValueTableMaster(
&stamina.UpdateRecoverValueTableMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
RecoverValueTableName: pointy.String("recover-value-table-0001"),
Description: pointy.String("description1"),
Metadata: nil,
ExperienceModelId: pointy.String("experienceModelId-1001"),
Values: []*int32{
pointy.Int32(30),
pointy.Int32(180),
pointy.Int32(330),
pointy.Int32(480),
pointy.Int32(630),
pointy.Int32(780),
pointy.Int32(930),
pointy.Int32(1080),
pointy.Int32(1230),
pointy.Int32(1380),
pointy.Int32(1530),
pointy.Int32(1680),
pointy.Int32(1830),
pointy.Int32(1980),
pointy.Int32(2130),
pointy.Int32(2280),
pointy.Int32(2430),
pointy.Int32(2580),
pointy.Int32(2730),
pointy.Int32(2880),
pointy.Int32(3030),
pointy.Int32(3180),
pointy.Int32(3330),
pointy.Int32(3480),
pointy.Int32(3630),
pointy.Int32(3780),
pointy.Int32(3930),
pointy.Int32(4080),
pointy.Int32(4230),
pointy.Int32(4380),
pointy.Int32(4530),
pointy.Int32(4680),
pointy.Int32(4830),
pointy.Int32(4980),
pointy.Int32(5130),
pointy.Int32(5280),
pointy.Int32(5430),
pointy.Int32(5580),
pointy.Int32(5730),
pointy.Int32(5880),
pointy.Int32(6030),
pointy.Int32(6180),
pointy.Int32(6330),
pointy.Int32(6480),
pointy.Int32(6630),
pointy.Int32(6780),
pointy.Int32(6930),
pointy.Int32(7080),
pointy.Int32(7230),
pointy.Int32(7380),
pointy.Int32(7530),
pointy.Int32(7680),
pointy.Int32(7830),
pointy.Int32(7980),
pointy.Int32(8130),
pointy.Int32(8280),
pointy.Int32(8430),
pointy.Int32(8580),
pointy.Int32(8730),
pointy.Int32(8880),
pointy.Int32(9030),
pointy.Int32(9180),
pointy.Int32(9330),
pointy.Int32(9480),
pointy.Int32(9630),
pointy.Int32(9780),
pointy.Int32(9930),
pointy.Int32(10080),
pointy.Int32(10230),
pointy.Int32(10380),
pointy.Int32(10530),
pointy.Int32(10680),
pointy.Int32(10830),
pointy.Int32(10980),
pointy.Int32(11130),
pointy.Int32(11280),
pointy.Int32(11430),
pointy.Int32(11580),
pointy.Int32(11730),
pointy.Int32(11880),
pointy.Int32(12030),
pointy.Int32(12180),
pointy.Int32(12330),
pointy.Int32(12480),
pointy.Int32(12630),
pointy.Int32(12780),
pointy.Int32(12930),
pointy.Int32(13080),
pointy.Int32(13230),
pointy.Int32(13380),
pointy.Int32(13530),
pointy.Int32(13680),
pointy.Int32(13830),
pointy.Int32(13980),
pointy.Int32(14130),
pointy.Int32(14280),
pointy.Int32(14430),
pointy.Int32(14580),
pointy.Int32(14730),
pointy.Int32(14880),
},
}
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateRecoverValueTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateRecoverValueTableMaster(
(new UpdateRecoverValueTableMasterRequest())
->withNamespaceName("namespace-0001")
->withRecoverValueTableName("recover-value-table-0001")
->withDescription("description1")
->withMetadata(null)
->withExperienceModelId("experienceModelId-1001")
->withValues([
30,
180,
330,
480,
630,
780,
930,
1080,
1230,
1380,
1530,
1680,
1830,
1980,
2130,
2280,
2430,
2580,
2730,
2880,
3030,
3180,
3330,
3480,
3630,
3780,
3930,
4080,
4230,
4380,
4530,
4680,
4830,
4980,
5130,
5280,
5430,
5580,
5730,
5880,
6030,
6180,
6330,
6480,
6630,
6780,
6930,
7080,
7230,
7380,
7530,
7680,
7830,
7980,
8130,
8280,
8430,
8580,
8730,
8880,
9030,
9180,
9330,
9480,
9630,
9780,
9930,
10080,
10230,
10380,
10530,
10680,
10830,
10980,
11130,
11280,
11430,
11580,
11730,
11880,
12030,
12180,
12330,
12480,
12630,
12780,
12930,
13080,
13230,
13380,
13530,
13680,
13830,
13980,
14130,
14280,
14430,
14580,
14730,
14880,
])
);
$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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateRecoverValueTableMasterRequest;
import io.gs2.stamina.result.UpdateRecoverValueTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
UpdateRecoverValueTableMasterResult result = client.updateRecoverValueTableMaster(
new UpdateRecoverValueTableMasterRequest()
.withNamespaceName("namespace-0001")
.withRecoverValueTableName("recover-value-table-0001")
.withDescription("description1")
.withMetadata(null)
.withExperienceModelId("experienceModelId-1001")
.withValues(Arrays.asList(
30,
180,
330,
480,
630,
780,
930,
1080,
1230,
1380,
1530,
1680,
1830,
1980,
2130,
2280,
2430,
2580,
2730,
2880,
3030,
3180,
3330,
3480,
3630,
3780,
3930,
4080,
4230,
4380,
4530,
4680,
4830,
4980,
5130,
5280,
5430,
5580,
5730,
5880,
6030,
6180,
6330,
6480,
6630,
6780,
6930,
7080,
7230,
7380,
7530,
7680,
7830,
7980,
8130,
8280,
8430,
8580,
8730,
8880,
9030,
9180,
9330,
9480,
9630,
9780,
9930,
10080,
10230,
10380,
10530,
10680,
10830,
10980,
11130,
11280,
11430,
11580,
11730,
11880,
12030,
12180,
12330,
12480,
12630,
12780,
12930,
13080,
13230,
13380,
13530,
13680,
13830,
13980,
14130,
14280,
14430,
14580,
14730,
14880
))
);
RecoverValueTableMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.UpdateRecoverValueTableMasterRequest;
using Gs2.Gs2Stamina.Result.UpdateRecoverValueTableMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.UpdateRecoverValueTableMasterResult> asyncResult = null;
yield return client.UpdateRecoverValueTableMaster(
new Gs2.Gs2Stamina.Request.UpdateRecoverValueTableMasterRequest()
.WithNamespaceName("namespace-0001")
.WithRecoverValueTableName("recover-value-table-0001")
.WithDescription("description1")
.WithMetadata(null)
.WithExperienceModelId("experienceModelId-1001")
.WithValues(new int[] {
30,
180,
330,
480,
630,
780,
930,
1080,
1230,
1380,
1530,
1680,
1830,
1980,
2130,
2280,
2430,
2580,
2730,
2880,
3030,
3180,
3330,
3480,
3630,
3780,
3930,
4080,
4230,
4380,
4530,
4680,
4830,
4980,
5130,
5280,
5430,
5580,
5730,
5880,
6030,
6180,
6330,
6480,
6630,
6780,
6930,
7080,
7230,
7380,
7530,
7680,
7830,
7980,
8130,
8280,
8430,
8580,
8730,
8880,
9030,
9180,
9330,
9480,
9630,
9780,
9930,
10080,
10230,
10380,
10530,
10680,
10830,
10980,
11130,
11280,
11430,
11580,
11730,
11880,
12030,
12180,
12330,
12480,
12630,
12780,
12930,
13080,
13230,
13380,
13530,
13680,
13830,
13980,
14130,
14280,
14430,
14580,
14730,
14880,
}),
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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.updateRecoverValueTableMaster(
new Gs2Stamina.UpdateRecoverValueTableMasterRequest()
.withNamespaceName("namespace-0001")
.withRecoverValueTableName("recover-value-table-0001")
.withDescription("description1")
.withMetadata(null)
.withExperienceModelId("experienceModelId-1001")
.withValues([
30,
180,
330,
480,
630,
780,
930,
1080,
1230,
1380,
1530,
1680,
1830,
1980,
2130,
2280,
2430,
2580,
2730,
2880,
3030,
3180,
3330,
3480,
3630,
3780,
3930,
4080,
4230,
4380,
4530,
4680,
4830,
4980,
5130,
5280,
5430,
5580,
5730,
5880,
6030,
6180,
6330,
6480,
6630,
6780,
6930,
7080,
7230,
7380,
7530,
7680,
7830,
7980,
8130,
8280,
8430,
8580,
8730,
8880,
9030,
9180,
9330,
9480,
9630,
9780,
9930,
10080,
10230,
10380,
10530,
10680,
10830,
10980,
11130,
11280,
11430,
11580,
11730,
11880,
12030,
12180,
12330,
12480,
12630,
12780,
12930,
13080,
13230,
13380,
13530,
13680,
13830,
13980,
14130,
14280,
14430,
14580,
14730,
14880,
])
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.update_recover_value_table_master(
stamina.UpdateRecoverValueTableMasterRequest()
.with_namespace_name('namespace-0001')
.with_recover_value_table_name('recover-value-table-0001')
.with_description('description1')
.with_metadata(None)
.with_experience_model_id('experienceModelId-1001')
.with_values([
30,
180,
330,
480,
630,
780,
930,
1080,
1230,
1380,
1530,
1680,
1830,
1980,
2130,
2280,
2430,
2580,
2730,
2880,
3030,
3180,
3330,
3480,
3630,
3780,
3930,
4080,
4230,
4380,
4530,
4680,
4830,
4980,
5130,
5280,
5430,
5580,
5730,
5880,
6030,
6180,
6330,
6480,
6630,
6780,
6930,
7080,
7230,
7380,
7530,
7680,
7830,
7980,
8130,
8280,
8430,
8580,
8730,
8880,
9030,
9180,
9330,
9480,
9630,
9780,
9930,
10080,
10230,
10380,
10530,
10680,
10830,
10980,
11130,
11280,
11430,
11580,
11730,
11880,
12030,
12180,
12330,
12480,
12630,
12780,
12930,
13080,
13230,
13380,
13530,
13680,
13830,
13980,
14130,
14280,
14430,
14580,
14730,
14880,
])
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.update_recover_value_table_master({
namespaceName="namespace-0001",
recoverValueTableName="recover-value-table-0001",
description="description1",
metadata=nil,
experienceModelId="experienceModelId-1001",
values={
30,
180,
330,
480,
630,
780,
930,
1080,
1230,
1380,
1530,
1680,
1830,
1980,
2130,
2280,
2430,
2580,
2730,
2880,
3030,
3180,
3330,
3480,
3630,
3780,
3930,
4080,
4230,
4380,
4530,
4680,
4830,
4980,
5130,
5280,
5430,
5580,
5730,
5880,
6030,
6180,
6330,
6480,
6630,
6780,
6930,
7080,
7230,
7380,
7530,
7680,
7830,
7980,
8130,
8280,
8430,
8580,
8730,
8880,
9030,
9180,
9330,
9480,
9630,
9780,
9930,
10080,
10230,
10380,
10530,
10680,
10830,
10980,
11130,
11280,
11430,
11580,
11730,
11880,
12030,
12180,
12330,
12480,
12630,
12780,
12930,
13080,
13230,
13380,
13530,
13680,
13830,
13980,
14130,
14280,
14430,
14580,
14730,
14880
},
})
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('stamina')
api_result_handler = client.update_recover_value_table_master_async({
namespaceName="namespace-0001",
recoverValueTableName="recover-value-table-0001",
description="description1",
metadata=nil,
experienceModelId="experienceModelId-1001",
values={
30,
180,
330,
480,
630,
780,
930,
1080,
1230,
1380,
1530,
1680,
1830,
1980,
2130,
2280,
2430,
2580,
2730,
2880,
3030,
3180,
3330,
3480,
3630,
3780,
3930,
4080,
4230,
4380,
4530,
4680,
4830,
4980,
5130,
5280,
5430,
5580,
5730,
5880,
6030,
6180,
6330,
6480,
6630,
6780,
6930,
7080,
7230,
7380,
7530,
7680,
7830,
7980,
8130,
8280,
8430,
8580,
8730,
8880,
9030,
9180,
9330,
9480,
9630,
9780,
9930,
10080,
10230,
10380,
10530,
10680,
10830,
10980,
11130,
11280,
11430,
11580,
11730,
11880,
12030,
12180,
12330,
12480,
12630,
12780,
12930,
13080,
13230,
13380,
13530,
13680,
13830,
13980,
14130,
14280,
14430,
14580,
14730,
14880
},
})
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;
deleteRecoverValueTableMaster
スタミナ回復量テーブルマスターを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
recoverValueTableName | string | ✓ | ~ 128文字 | スタミナ回復量テーブル名 |
Result
型 | 説明 | |
---|---|---|
item | RecoverValueTableMaster | 削除したスタミナ回復量テーブルマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DeleteRecoverValueTableMaster(
&stamina.DeleteRecoverValueTableMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
RecoverValueTableName: pointy.String("recover-value-table-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DeleteRecoverValueTableMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteRecoverValueTableMaster(
(new DeleteRecoverValueTableMasterRequest())
->withNamespaceName("namespace-0001")
->withRecoverValueTableName("recover-value-table-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DeleteRecoverValueTableMasterRequest;
import io.gs2.stamina.result.DeleteRecoverValueTableMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DeleteRecoverValueTableMasterResult result = client.deleteRecoverValueTableMaster(
new DeleteRecoverValueTableMasterRequest()
.withNamespaceName("namespace-0001")
.withRecoverValueTableName("recover-value-table-0001")
);
RecoverValueTableMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DeleteRecoverValueTableMasterRequest;
using Gs2.Gs2Stamina.Result.DeleteRecoverValueTableMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DeleteRecoverValueTableMasterResult> asyncResult = null;
yield return client.DeleteRecoverValueTableMaster(
new Gs2.Gs2Stamina.Request.DeleteRecoverValueTableMasterRequest()
.WithNamespaceName("namespace-0001")
.WithRecoverValueTableName("recover-value-table-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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.deleteRecoverValueTableMaster(
new Gs2Stamina.DeleteRecoverValueTableMasterRequest()
.withNamespaceName("namespace-0001")
.withRecoverValueTableName("recover-value-table-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.delete_recover_value_table_master(
stamina.DeleteRecoverValueTableMasterRequest()
.with_namespace_name('namespace-0001')
.with_recover_value_table_name('recover-value-table-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.delete_recover_value_table_master({
namespaceName="namespace-0001",
recoverValueTableName="recover-value-table-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('stamina')
api_result_handler = client.delete_recover_value_table_master_async({
namespaceName="namespace-0001",
recoverValueTableName="recover-value-table-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;
exportMaster
現在有効なスタミナマスターのマスターデータをエクスポート
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | CurrentStaminaMaster | 現在有効なスタミナマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.ExportMaster(
&stamina.ExportMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\ExportMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->exportMaster(
(new ExportMasterRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.ExportMasterRequest;
import io.gs2.stamina.result.ExportMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
ExportMasterResult result = client.exportMaster(
new ExportMasterRequest()
.withNamespaceName("namespace-0001")
);
CurrentStaminaMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.ExportMasterRequest;
using Gs2.Gs2Stamina.Result.ExportMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
new Gs2.Gs2Stamina.Request.ExportMasterRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.exportMaster(
new Gs2Stamina.ExportMasterRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.export_master(
stamina.ExportMasterRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.export_master({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.export_master_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getCurrentStaminaMaster
現在有効なスタミナマスターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | CurrentStaminaMaster | 現在有効なスタミナマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.GetCurrentStaminaMaster(
&stamina.GetCurrentStaminaMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetCurrentStaminaMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCurrentStaminaMaster(
(new GetCurrentStaminaMasterRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetCurrentStaminaMasterRequest;
import io.gs2.stamina.result.GetCurrentStaminaMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
GetCurrentStaminaMasterResult result = client.getCurrentStaminaMaster(
new GetCurrentStaminaMasterRequest()
.withNamespaceName("namespace-0001")
);
CurrentStaminaMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.GetCurrentStaminaMasterRequest;
using Gs2.Gs2Stamina.Result.GetCurrentStaminaMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.GetCurrentStaminaMasterResult> asyncResult = null;
yield return client.GetCurrentStaminaMaster(
new Gs2.Gs2Stamina.Request.GetCurrentStaminaMasterRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.getCurrentStaminaMaster(
new Gs2Stamina.GetCurrentStaminaMasterRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.get_current_stamina_master(
stamina.GetCurrentStaminaMasterRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_current_stamina_master({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.get_current_stamina_master_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
preUpdateCurrentStaminaMaster
現在有効なマスターデータを更新(3フェーズ版)
1MBを超えるマスターデータをアップロードする場合は、3フェーズで更新を行います。
- このAPIを実行し、アップロード用のトークンとURLを取得します。
- 取得したURLに対して、マスターデータをアップロードします。
- UpdateCurrentModelMaster にアップロードに使用したトークンを渡して実行し、マスターデータを反映します。
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
uploadToken | string | アップロード後に結果を反映する際に使用するトークン |
uploadUrl | string | アップロード処理の実行に使用するURL |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.PreUpdateCurrentStaminaMaster(
&stamina.PreUpdateCurrentStaminaMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\PreUpdateCurrentStaminaMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->preUpdateCurrentStaminaMaster(
(new PreUpdateCurrentStaminaMasterRequest())
->withNamespaceName("namespace-0001")
);
$uploadToken = $result->getUploadToken();
$uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.PreUpdateCurrentStaminaMasterRequest;
import io.gs2.stamina.result.PreUpdateCurrentStaminaMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
PreUpdateCurrentStaminaMasterResult result = client.preUpdateCurrentStaminaMaster(
new PreUpdateCurrentStaminaMasterRequest()
.withNamespaceName("namespace-0001")
);
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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.PreUpdateCurrentStaminaMasterRequest;
using Gs2.Gs2Stamina.Result.PreUpdateCurrentStaminaMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.PreUpdateCurrentStaminaMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentStaminaMaster(
new Gs2.Gs2Stamina.Request.PreUpdateCurrentStaminaMasterRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.preUpdateCurrentStaminaMaster(
new Gs2Stamina.PreUpdateCurrentStaminaMasterRequest()
.withNamespaceName("namespace-0001")
);
const uploadToken = result.getUploadToken();
const uploadUrl = result.getUploadUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.pre_update_current_stamina_master(
stamina.PreUpdateCurrentStaminaMasterRequest()
.with_namespace_name('namespace-0001')
)
upload_token = result.upload_token
upload_url = result.upload_url
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.pre_update_current_stamina_master({
namespaceName="namespace-0001",
})
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('stamina')
api_result_handler = client.pre_update_current_stamina_master_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
updateCurrentStaminaMaster
現在有効なスタミナマスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||||||||
mode | 文字列列挙型 enum { “direct”, “preUpload” } | ✓ | “direct” | ~ 128文字 | 更新モード
| |||||||
settings | string | {mode} == “direct” | ✓ | ~ 5242880文字 | マスターデータ mode が “direct” であれば必須 | |||||||
uploadToken | string | {mode} == “preUpload” | ✓ | ~ 1024文字 | プレアップロードで取得したトークン mode が “preUpload” であれば必須 |
Result
型 | 説明 | |
---|---|---|
item | CurrentStaminaMaster | 更新した現在有効なスタミナマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.UpdateCurrentStaminaMaster(
&stamina.UpdateCurrentStaminaMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Mode: nil,
Settings: pointy.String("{\n \"version\": \"2019-02-14\",\n \"staminaModels\": [\n {\n \"name\": \"quest\",\n \"metadata\": \"QUEST\",\n \"recoverIntervalMinutes\": 15,\n \"recoverValue\": 1,\n \"initialCapacity\": 50,\n \"isOverflow\": true,\n \"maxCapacity\": 999,\n \"maxStaminaTable\": {\n \"name\": \"playerLevel\",\n \"metadata\": \"PLAYER_LEVEL\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 128,\n 129\n ]\n },\n \"recoverIntervalTable\": {\n \"name\": \"staminaRecoverInterval\",\n \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119\n ]\n },\n \"recoverValueTable\": {\n \"name\": \"staminaRecoverValue\",\n \"metadata\": \"STAMINA_RECOVER_VALUE\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109\n ]\n }\n },\n {\n \"name\": \"raidBattle\",\n \"metadata\": \"RAID_BATTLE\",\n \"recoverIntervalMinutes\": 60,\n \"recoverValue\": 1,\n \"initialCapacity\": 10,\n \"isOverflow\": false\n },\n {\n \"name\": \"special\",\n \"metadata\": \"SPECIAL\",\n \"recoverIntervalMinutes\": 30,\n \"recoverValue\": 3,\n \"initialCapacity\": 100,\n \"isOverflow\": true,\n \"maxCapacity\": 999,\n \"maxStaminaTable\": {\n \"name\": \"special\",\n \"metadata\": \"SPECIAL\",\n \"experienceModelId\": \"special\",\n \"values\": [\n 102,\n 104,\n 106,\n 108,\n 110,\n 112,\n 114,\n 116,\n 118,\n 120,\n 122,\n 124,\n 126,\n 128,\n 130,\n 132,\n 134,\n 136,\n 138,\n 140,\n 142,\n 144,\n 146,\n 148,\n 150,\n 152,\n 154,\n 156,\n 158,\n 160,\n 162,\n 164,\n 166,\n 168,\n 170,\n 172,\n 174,\n 176,\n 178,\n 180,\n 182,\n 184,\n 186,\n 188,\n 190,\n 192,\n 194,\n 196,\n 198,\n 200,\n 202,\n 204,\n 206,\n 208,\n 210,\n 212,\n 214,\n 216,\n 218,\n 220,\n 222,\n 224,\n 226,\n 228,\n 230,\n 232,\n 234,\n 236,\n 238,\n 240,\n 242,\n 244,\n 246,\n 248,\n 250,\n 252,\n 254,\n 256,\n 258\n ]\n }\n }\n ]\n}"),
UploadToken: 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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateCurrentStaminaMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentStaminaMaster(
(new UpdateCurrentStaminaMasterRequest())
->withNamespaceName("namespace-0001")
->withMode(null)
->withSettings("{\n \"version\": \"2019-02-14\",\n \"staminaModels\": [\n {\n \"name\": \"quest\",\n \"metadata\": \"QUEST\",\n \"recoverIntervalMinutes\": 15,\n \"recoverValue\": 1,\n \"initialCapacity\": 50,\n \"isOverflow\": true,\n \"maxCapacity\": 999,\n \"maxStaminaTable\": {\n \"name\": \"playerLevel\",\n \"metadata\": \"PLAYER_LEVEL\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 128,\n 129\n ]\n },\n \"recoverIntervalTable\": {\n \"name\": \"staminaRecoverInterval\",\n \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119\n ]\n },\n \"recoverValueTable\": {\n \"name\": \"staminaRecoverValue\",\n \"metadata\": \"STAMINA_RECOVER_VALUE\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109\n ]\n }\n },\n {\n \"name\": \"raidBattle\",\n \"metadata\": \"RAID_BATTLE\",\n \"recoverIntervalMinutes\": 60,\n \"recoverValue\": 1,\n \"initialCapacity\": 10,\n \"isOverflow\": false\n },\n {\n \"name\": \"special\",\n \"metadata\": \"SPECIAL\",\n \"recoverIntervalMinutes\": 30,\n \"recoverValue\": 3,\n \"initialCapacity\": 100,\n \"isOverflow\": true,\n \"maxCapacity\": 999,\n \"maxStaminaTable\": {\n \"name\": \"special\",\n \"metadata\": \"SPECIAL\",\n \"experienceModelId\": \"special\",\n \"values\": [\n 102,\n 104,\n 106,\n 108,\n 110,\n 112,\n 114,\n 116,\n 118,\n 120,\n 122,\n 124,\n 126,\n 128,\n 130,\n 132,\n 134,\n 136,\n 138,\n 140,\n 142,\n 144,\n 146,\n 148,\n 150,\n 152,\n 154,\n 156,\n 158,\n 160,\n 162,\n 164,\n 166,\n 168,\n 170,\n 172,\n 174,\n 176,\n 178,\n 180,\n 182,\n 184,\n 186,\n 188,\n 190,\n 192,\n 194,\n 196,\n 198,\n 200,\n 202,\n 204,\n 206,\n 208,\n 210,\n 212,\n 214,\n 216,\n 218,\n 220,\n 222,\n 224,\n 226,\n 228,\n 230,\n 232,\n 234,\n 236,\n 238,\n 240,\n 242,\n 244,\n 246,\n 248,\n 250,\n 252,\n 254,\n 256,\n 258\n ]\n }\n }\n ]\n}")
->withUploadToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateCurrentStaminaMasterRequest;
import io.gs2.stamina.result.UpdateCurrentStaminaMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
UpdateCurrentStaminaMasterResult result = client.updateCurrentStaminaMaster(
new UpdateCurrentStaminaMasterRequest()
.withNamespaceName("namespace-0001")
.withMode(null)
.withSettings("{\n \"version\": \"2019-02-14\",\n \"staminaModels\": [\n {\n \"name\": \"quest\",\n \"metadata\": \"QUEST\",\n \"recoverIntervalMinutes\": 15,\n \"recoverValue\": 1,\n \"initialCapacity\": 50,\n \"isOverflow\": true,\n \"maxCapacity\": 999,\n \"maxStaminaTable\": {\n \"name\": \"playerLevel\",\n \"metadata\": \"PLAYER_LEVEL\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 128,\n 129\n ]\n },\n \"recoverIntervalTable\": {\n \"name\": \"staminaRecoverInterval\",\n \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119\n ]\n },\n \"recoverValueTable\": {\n \"name\": \"staminaRecoverValue\",\n \"metadata\": \"STAMINA_RECOVER_VALUE\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109\n ]\n }\n },\n {\n \"name\": \"raidBattle\",\n \"metadata\": \"RAID_BATTLE\",\n \"recoverIntervalMinutes\": 60,\n \"recoverValue\": 1,\n \"initialCapacity\": 10,\n \"isOverflow\": false\n },\n {\n \"name\": \"special\",\n \"metadata\": \"SPECIAL\",\n \"recoverIntervalMinutes\": 30,\n \"recoverValue\": 3,\n \"initialCapacity\": 100,\n \"isOverflow\": true,\n \"maxCapacity\": 999,\n \"maxStaminaTable\": {\n \"name\": \"special\",\n \"metadata\": \"SPECIAL\",\n \"experienceModelId\": \"special\",\n \"values\": [\n 102,\n 104,\n 106,\n 108,\n 110,\n 112,\n 114,\n 116,\n 118,\n 120,\n 122,\n 124,\n 126,\n 128,\n 130,\n 132,\n 134,\n 136,\n 138,\n 140,\n 142,\n 144,\n 146,\n 148,\n 150,\n 152,\n 154,\n 156,\n 158,\n 160,\n 162,\n 164,\n 166,\n 168,\n 170,\n 172,\n 174,\n 176,\n 178,\n 180,\n 182,\n 184,\n 186,\n 188,\n 190,\n 192,\n 194,\n 196,\n 198,\n 200,\n 202,\n 204,\n 206,\n 208,\n 210,\n 212,\n 214,\n 216,\n 218,\n 220,\n 222,\n 224,\n 226,\n 228,\n 230,\n 232,\n 234,\n 236,\n 238,\n 240,\n 242,\n 244,\n 246,\n 248,\n 250,\n 252,\n 254,\n 256,\n 258\n ]\n }\n }\n ]\n}")
.withUploadToken(null)
);
CurrentStaminaMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.UpdateCurrentStaminaMasterRequest;
using Gs2.Gs2Stamina.Result.UpdateCurrentStaminaMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.UpdateCurrentStaminaMasterResult> asyncResult = null;
yield return client.UpdateCurrentStaminaMaster(
new Gs2.Gs2Stamina.Request.UpdateCurrentStaminaMasterRequest()
.WithNamespaceName("namespace-0001")
.WithMode(null)
.WithSettings("{\n \"version\": \"2019-02-14\",\n \"staminaModels\": [\n {\n \"name\": \"quest\",\n \"metadata\": \"QUEST\",\n \"recoverIntervalMinutes\": 15,\n \"recoverValue\": 1,\n \"initialCapacity\": 50,\n \"isOverflow\": true,\n \"maxCapacity\": 999,\n \"maxStaminaTable\": {\n \"name\": \"playerLevel\",\n \"metadata\": \"PLAYER_LEVEL\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 128,\n 129\n ]\n },\n \"recoverIntervalTable\": {\n \"name\": \"staminaRecoverInterval\",\n \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119\n ]\n },\n \"recoverValueTable\": {\n \"name\": \"staminaRecoverValue\",\n \"metadata\": \"STAMINA_RECOVER_VALUE\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109\n ]\n }\n },\n {\n \"name\": \"raidBattle\",\n \"metadata\": \"RAID_BATTLE\",\n \"recoverIntervalMinutes\": 60,\n \"recoverValue\": 1,\n \"initialCapacity\": 10,\n \"isOverflow\": false\n },\n {\n \"name\": \"special\",\n \"metadata\": \"SPECIAL\",\n \"recoverIntervalMinutes\": 30,\n \"recoverValue\": 3,\n \"initialCapacity\": 100,\n \"isOverflow\": true,\n \"maxCapacity\": 999,\n \"maxStaminaTable\": {\n \"name\": \"special\",\n \"metadata\": \"SPECIAL\",\n \"experienceModelId\": \"special\",\n \"values\": [\n 102,\n 104,\n 106,\n 108,\n 110,\n 112,\n 114,\n 116,\n 118,\n 120,\n 122,\n 124,\n 126,\n 128,\n 130,\n 132,\n 134,\n 136,\n 138,\n 140,\n 142,\n 144,\n 146,\n 148,\n 150,\n 152,\n 154,\n 156,\n 158,\n 160,\n 162,\n 164,\n 166,\n 168,\n 170,\n 172,\n 174,\n 176,\n 178,\n 180,\n 182,\n 184,\n 186,\n 188,\n 190,\n 192,\n 194,\n 196,\n 198,\n 200,\n 202,\n 204,\n 206,\n 208,\n 210,\n 212,\n 214,\n 216,\n 218,\n 220,\n 222,\n 224,\n 226,\n 228,\n 230,\n 232,\n 234,\n 236,\n 238,\n 240,\n 242,\n 244,\n 246,\n 248,\n 250,\n 252,\n 254,\n 256,\n 258\n ]\n }\n }\n ]\n}")
.WithUploadToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.updateCurrentStaminaMaster(
new Gs2Stamina.UpdateCurrentStaminaMasterRequest()
.withNamespaceName("namespace-0001")
.withMode(null)
.withSettings("{\n \"version\": \"2019-02-14\",\n \"staminaModels\": [\n {\n \"name\": \"quest\",\n \"metadata\": \"QUEST\",\n \"recoverIntervalMinutes\": 15,\n \"recoverValue\": 1,\n \"initialCapacity\": 50,\n \"isOverflow\": true,\n \"maxCapacity\": 999,\n \"maxStaminaTable\": {\n \"name\": \"playerLevel\",\n \"metadata\": \"PLAYER_LEVEL\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 128,\n 129\n ]\n },\n \"recoverIntervalTable\": {\n \"name\": \"staminaRecoverInterval\",\n \"metadata\": \"STAMINA_RECOVER_INTERVAL\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119\n ]\n },\n \"recoverValueTable\": {\n \"name\": \"staminaRecoverValue\",\n \"metadata\": \"STAMINA_RECOVER_VALUE\",\n \"experienceModelId\": \"playerLevel\",\n \"values\": [\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109\n ]\n }\n },\n {\n \"name\": \"raidBattle\",\n \"metadata\": \"RAID_BATTLE\",\n \"recoverIntervalMinutes\": 60,\n \"recoverValue\": 1,\n \"initialCapacity\": 10,\n \"isOverflow\": false\n },\n {\n \"name\": \"special\",\n \"metadata\": \"SPECIAL\",\n \"recoverIntervalMinutes\": 30,\n \"recoverValue\": 3,\n \"initialCapacity\": 100,\n \"isOverflow\": true,\n \"maxCapacity\": 999,\n \"maxStaminaTable\": {\n \"name\": \"special\",\n \"metadata\": \"SPECIAL\",\n \"experienceModelId\": \"special\",\n \"values\": [\n 102,\n 104,\n 106,\n 108,\n 110,\n 112,\n 114,\n 116,\n 118,\n 120,\n 122,\n 124,\n 126,\n 128,\n 130,\n 132,\n 134,\n 136,\n 138,\n 140,\n 142,\n 144,\n 146,\n 148,\n 150,\n 152,\n 154,\n 156,\n 158,\n 160,\n 162,\n 164,\n 166,\n 168,\n 170,\n 172,\n 174,\n 176,\n 178,\n 180,\n 182,\n 184,\n 186,\n 188,\n 190,\n 192,\n 194,\n 196,\n 198,\n 200,\n 202,\n 204,\n 206,\n 208,\n 210,\n 212,\n 214,\n 216,\n 218,\n 220,\n 222,\n 224,\n 226,\n 228,\n 230,\n 232,\n 234,\n 236,\n 238,\n 240,\n 242,\n 244,\n 246,\n 248,\n 250,\n 252,\n 254,\n 256,\n 258\n ]\n }\n }\n ]\n}")
.withUploadToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.update_current_stamina_master(
stamina.UpdateCurrentStaminaMasterRequest()
.with_namespace_name('namespace-0001')
.with_mode(None)
.with_settings('{\n "version": "2019-02-14",\n "staminaModels": [\n {\n "name": "quest",\n "metadata": "QUEST",\n "recoverIntervalMinutes": 15,\n "recoverValue": 1,\n "initialCapacity": 50,\n "isOverflow": true,\n "maxCapacity": 999,\n "maxStaminaTable": {\n "name": "playerLevel",\n "metadata": "PLAYER_LEVEL",\n "experienceModelId": "playerLevel",\n "values": [\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 128,\n 129\n ]\n },\n "recoverIntervalTable": {\n "name": "staminaRecoverInterval",\n "metadata": "STAMINA_RECOVER_INTERVAL",\n "experienceModelId": "playerLevel",\n "values": [\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119\n ]\n },\n "recoverValueTable": {\n "name": "staminaRecoverValue",\n "metadata": "STAMINA_RECOVER_VALUE",\n "experienceModelId": "playerLevel",\n "values": [\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109\n ]\n }\n },\n {\n "name": "raidBattle",\n "metadata": "RAID_BATTLE",\n "recoverIntervalMinutes": 60,\n "recoverValue": 1,\n "initialCapacity": 10,\n "isOverflow": false\n },\n {\n "name": "special",\n "metadata": "SPECIAL",\n "recoverIntervalMinutes": 30,\n "recoverValue": 3,\n "initialCapacity": 100,\n "isOverflow": true,\n "maxCapacity": 999,\n "maxStaminaTable": {\n "name": "special",\n "metadata": "SPECIAL",\n "experienceModelId": "special",\n "values": [\n 102,\n 104,\n 106,\n 108,\n 110,\n 112,\n 114,\n 116,\n 118,\n 120,\n 122,\n 124,\n 126,\n 128,\n 130,\n 132,\n 134,\n 136,\n 138,\n 140,\n 142,\n 144,\n 146,\n 148,\n 150,\n 152,\n 154,\n 156,\n 158,\n 160,\n 162,\n 164,\n 166,\n 168,\n 170,\n 172,\n 174,\n 176,\n 178,\n 180,\n 182,\n 184,\n 186,\n 188,\n 190,\n 192,\n 194,\n 196,\n 198,\n 200,\n 202,\n 204,\n 206,\n 208,\n 210,\n 212,\n 214,\n 216,\n 218,\n 220,\n 222,\n 224,\n 226,\n 228,\n 230,\n 232,\n 234,\n 236,\n 238,\n 240,\n 242,\n 244,\n 246,\n 248,\n 250,\n 252,\n 254,\n 256,\n 258\n ]\n }\n }\n ]\n}')
.with_upload_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.update_current_stamina_master({
namespaceName="namespace-0001",
mode=nil,
settings="{\n "version": "2019-02-14",\n "staminaModels": [\n {\n "name": "quest",\n "metadata": "QUEST",\n "recoverIntervalMinutes": 15,\n "recoverValue": 1,\n "initialCapacity": 50,\n "isOverflow": true,\n "maxCapacity": 999,\n "maxStaminaTable": {\n "name": "playerLevel",\n "metadata": "PLAYER_LEVEL",\n "experienceModelId": "playerLevel",\n "values": [\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 128,\n 129\n ]\n },\n "recoverIntervalTable": {\n "name": "staminaRecoverInterval",\n "metadata": "STAMINA_RECOVER_INTERVAL",\n "experienceModelId": "playerLevel",\n "values": [\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119\n ]\n },\n "recoverValueTable": {\n "name": "staminaRecoverValue",\n "metadata": "STAMINA_RECOVER_VALUE",\n "experienceModelId": "playerLevel",\n "values": [\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109\n ]\n }\n },\n {\n "name": "raidBattle",\n "metadata": "RAID_BATTLE",\n "recoverIntervalMinutes": 60,\n "recoverValue": 1,\n "initialCapacity": 10,\n "isOverflow": false\n },\n {\n "name": "special",\n "metadata": "SPECIAL",\n "recoverIntervalMinutes": 30,\n "recoverValue": 3,\n "initialCapacity": 100,\n "isOverflow": true,\n "maxCapacity": 999,\n "maxStaminaTable": {\n "name": "special",\n "metadata": "SPECIAL",\n "experienceModelId": "special",\n "values": [\n 102,\n 104,\n 106,\n 108,\n 110,\n 112,\n 114,\n 116,\n 118,\n 120,\n 122,\n 124,\n 126,\n 128,\n 130,\n 132,\n 134,\n 136,\n 138,\n 140,\n 142,\n 144,\n 146,\n 148,\n 150,\n 152,\n 154,\n 156,\n 158,\n 160,\n 162,\n 164,\n 166,\n 168,\n 170,\n 172,\n 174,\n 176,\n 178,\n 180,\n 182,\n 184,\n 186,\n 188,\n 190,\n 192,\n 194,\n 196,\n 198,\n 200,\n 202,\n 204,\n 206,\n 208,\n 210,\n 212,\n 214,\n 216,\n 218,\n 220,\n 222,\n 224,\n 226,\n 228,\n 230,\n 232,\n 234,\n 236,\n 238,\n 240,\n 242,\n 244,\n 246,\n 248,\n 250,\n 252,\n 254,\n 256,\n 258\n ]\n }\n }\n ]\n}",
uploadToken=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('stamina')
api_result_handler = client.update_current_stamina_master_async({
namespaceName="namespace-0001",
mode=nil,
settings="{\n "version": "2019-02-14",\n "staminaModels": [\n {\n "name": "quest",\n "metadata": "QUEST",\n "recoverIntervalMinutes": 15,\n "recoverValue": 1,\n "initialCapacity": 50,\n "isOverflow": true,\n "maxCapacity": 999,\n "maxStaminaTable": {\n "name": "playerLevel",\n "metadata": "PLAYER_LEVEL",\n "experienceModelId": "playerLevel",\n "values": [\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 128,\n 129\n ]\n },\n "recoverIntervalTable": {\n "name": "staminaRecoverInterval",\n "metadata": "STAMINA_RECOVER_INTERVAL",\n "experienceModelId": "playerLevel",\n "values": [\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119\n ]\n },\n "recoverValueTable": {\n "name": "staminaRecoverValue",\n "metadata": "STAMINA_RECOVER_VALUE",\n "experienceModelId": "playerLevel",\n "values": [\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109\n ]\n }\n },\n {\n "name": "raidBattle",\n "metadata": "RAID_BATTLE",\n "recoverIntervalMinutes": 60,\n "recoverValue": 1,\n "initialCapacity": 10,\n "isOverflow": false\n },\n {\n "name": "special",\n "metadata": "SPECIAL",\n "recoverIntervalMinutes": 30,\n "recoverValue": 3,\n "initialCapacity": 100,\n "isOverflow": true,\n "maxCapacity": 999,\n "maxStaminaTable": {\n "name": "special",\n "metadata": "SPECIAL",\n "experienceModelId": "special",\n "values": [\n 102,\n 104,\n 106,\n 108,\n 110,\n 112,\n 114,\n 116,\n 118,\n 120,\n 122,\n 124,\n 126,\n 128,\n 130,\n 132,\n 134,\n 136,\n 138,\n 140,\n 142,\n 144,\n 146,\n 148,\n 150,\n 152,\n 154,\n 156,\n 158,\n 160,\n 162,\n 164,\n 166,\n 168,\n 170,\n 172,\n 174,\n 176,\n 178,\n 180,\n 182,\n 184,\n 186,\n 188,\n 190,\n 192,\n 194,\n 196,\n 198,\n 200,\n 202,\n 204,\n 206,\n 208,\n 210,\n 212,\n 214,\n 216,\n 218,\n 220,\n 222,\n 224,\n 226,\n 228,\n 230,\n 232,\n 234,\n 236,\n 238,\n 240,\n 242,\n 244,\n 246,\n 248,\n 250,\n 252,\n 254,\n 256,\n 258\n ]\n }\n }\n ]\n}",
uploadToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateCurrentStaminaMasterFromGitHub
現在有効なスタミナマスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
checkoutSetting | GitHubCheckoutSetting | ✓ | GitHubからマスターデータをチェックアウトしてくる設定 |
Result
型 | 説明 | |
---|---|---|
item | CurrentStaminaMaster | 更新した現在有効なスタミナマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.UpdateCurrentStaminaMasterFromGitHub(
&stamina.UpdateCurrentStaminaMasterFromGitHubRequest {
NamespaceName: pointy.String("namespace-0001"),
CheckoutSetting: &stamina.GitHubCheckoutSetting{
ApiKeyId: pointy.String("apiKeyId-0001"),
RepositoryName: pointy.String("gs2io/master-data"),
SourcePath: pointy.String("path/to/file.json"),
ReferenceType: pointy.String("branch"),
BranchName: pointy.String("develop"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateCurrentStaminaMasterFromGitHubRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentStaminaMasterFromGitHub(
(new UpdateCurrentStaminaMasterFromGitHubRequest())
->withNamespaceName("namespace-0001")
->withCheckoutSetting((new GitHubCheckoutSetting())
->withApiKeyId("apiKeyId-0001")
->withRepositoryName("gs2io/master-data")
->withSourcePath("path/to/file.json")
->withReferenceType("branch")
->withBranchName("develop")
)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateCurrentStaminaMasterFromGitHubRequest;
import io.gs2.stamina.result.UpdateCurrentStaminaMasterFromGitHubResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
UpdateCurrentStaminaMasterFromGitHubResult result = client.updateCurrentStaminaMasterFromGitHub(
new UpdateCurrentStaminaMasterFromGitHubRequest()
.withNamespaceName("namespace-0001")
.withCheckoutSetting(new GitHubCheckoutSetting()
.withApiKeyId("apiKeyId-0001")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
CurrentStaminaMaster 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.UpdateCurrentStaminaMasterFromGitHubRequest;
using Gs2.Gs2Stamina.Result.UpdateCurrentStaminaMasterFromGitHubResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.UpdateCurrentStaminaMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentStaminaMasterFromGitHub(
new Gs2.Gs2Stamina.Request.UpdateCurrentStaminaMasterFromGitHubRequest()
.WithNamespaceName("namespace-0001")
.WithCheckoutSetting(new Gs2.Gs2Stamina.Model.GitHubCheckoutSetting()
.WithApiKeyId("apiKeyId-0001")
.WithRepositoryName("gs2io/master-data")
.WithSourcePath("path/to/file.json")
.WithReferenceType("branch")
.WithBranchName("develop")
),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.updateCurrentStaminaMasterFromGitHub(
new Gs2Stamina.UpdateCurrentStaminaMasterFromGitHubRequest()
.withNamespaceName("namespace-0001")
.withCheckoutSetting(new Gs2Stamina.model.GitHubCheckoutSetting()
.withApiKeyId("apiKeyId-0001")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.update_current_stamina_master_from_git_hub(
stamina.UpdateCurrentStaminaMasterFromGitHubRequest()
.with_namespace_name('namespace-0001')
.with_checkout_setting(stamina.GitHubCheckoutSetting()
.with_api_key_id('apiKeyId-0001')
.with_repository_name('gs2io/master-data')
.with_source_path('path/to/file.json')
.with_reference_type('branch')
.with_branch_name('develop')
)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.update_current_stamina_master_from_git_hub({
namespaceName="namespace-0001",
checkoutSetting={
api_key_id="apiKeyId-0001",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('stamina')
api_result_handler = client.update_current_stamina_master_from_git_hub_async({
namespaceName="namespace-0001",
checkoutSetting={
api_key_id="apiKeyId-0001",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
describeStaminaModels
スタミナモデルの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
items | List<StaminaModel> | スタミナモデルのリスト |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DescribeStaminaModels(
&stamina.DescribeStaminaModelsRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeStaminaModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeStaminaModels(
(new DescribeStaminaModelsRequest())
->withNamespaceName("namespace-0001")
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeStaminaModelsRequest;
import io.gs2.stamina.result.DescribeStaminaModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DescribeStaminaModelsResult result = client.describeStaminaModels(
new DescribeStaminaModelsRequest()
.withNamespaceName("namespace-0001")
);
List<StaminaModel> 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DescribeStaminaModelsRequest;
using Gs2.Gs2Stamina.Result.DescribeStaminaModelsResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DescribeStaminaModelsResult> asyncResult = null;
yield return client.DescribeStaminaModels(
new Gs2.Gs2Stamina.Request.DescribeStaminaModelsRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.describeStaminaModels(
new Gs2Stamina.DescribeStaminaModelsRequest()
.withNamespaceName("namespace-0001")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.describe_stamina_models(
stamina.DescribeStaminaModelsRequest()
.with_namespace_name('namespace-0001')
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.describe_stamina_models({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('stamina')
api_result_handler = client.describe_stamina_models_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
getStaminaModel
スタミナモデルを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデル名 |
Result
型 | 説明 | |
---|---|---|
item | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.GetStaminaModel(
&stamina.GetStaminaModelRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetStaminaModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getStaminaModel(
(new GetStaminaModelRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetStaminaModelRequest;
import io.gs2.stamina.result.GetStaminaModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
GetStaminaModelResult result = client.getStaminaModel(
new GetStaminaModelRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
);
StaminaModel 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.GetStaminaModelRequest;
using Gs2.Gs2Stamina.Result.GetStaminaModelResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.GetStaminaModelResult> asyncResult = null;
yield return client.GetStaminaModel(
new Gs2.Gs2Stamina.Request.GetStaminaModelRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.getStaminaModel(
new Gs2Stamina.GetStaminaModelRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.get_stamina_model(
stamina.GetStaminaModelRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_stamina_model({
namespaceName="namespace-0001",
staminaName="stamina-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('stamina')
api_result_handler = client.get_stamina_model_async({
namespaceName="namespace-0001",
staminaName="stamina-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;
describeStaminas
スタミナ一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<Stamina> | スタミナのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DescribeStaminas(
&stamina.DescribeStaminasRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeStaminasRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeStaminas(
(new DescribeStaminasRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeStaminasRequest;
import io.gs2.stamina.result.DescribeStaminasResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DescribeStaminasResult result = client.describeStaminas(
new DescribeStaminasRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
List<Stamina> 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DescribeStaminasRequest;
using Gs2.Gs2Stamina.Result.DescribeStaminasResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DescribeStaminasResult> asyncResult = null;
yield return client.DescribeStaminas(
new Gs2.Gs2Stamina.Request.DescribeStaminasRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.describeStaminas(
new Gs2Stamina.DescribeStaminasRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.describe_staminas(
stamina.DescribeStaminasRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.describe_staminas({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')
api_result_handler = client.describe_staminas_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
describeStaminasByUserId
ユーザIDを指定してスタミナ一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | |
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
items | List<Stamina> | スタミナのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DescribeStaminasByUserId(
&stamina.DescribeStaminasByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DescribeStaminasByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeStaminasByUserId(
(new DescribeStaminasByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DescribeStaminasByUserIdRequest;
import io.gs2.stamina.result.DescribeStaminasByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DescribeStaminasByUserIdResult result = client.describeStaminasByUserId(
new DescribeStaminasByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<Stamina> 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DescribeStaminasByUserIdRequest;
using Gs2.Gs2Stamina.Result.DescribeStaminasByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DescribeStaminasByUserIdResult> asyncResult = null;
yield return client.DescribeStaminasByUserId(
new Gs2.Gs2Stamina.Request.DescribeStaminasByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.describeStaminasByUserId(
new Gs2Stamina.DescribeStaminasByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.describe_staminas_by_user_id(
stamina.DescribeStaminasByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.describe_staminas_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('stamina')
api_result_handler = client.describe_staminas_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
getStamina
スタミナを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
accessToken | string | ✓ | ~ 128文字 | アクセストークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.GetStamina(
&stamina.GetStaminaRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
AccessToken: pointy.String("accessToken-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetStaminaRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getStamina(
(new GetStaminaRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withAccessToken("accessToken-0001")
);
$item = $result->getItem();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetStaminaRequest;
import io.gs2.stamina.result.GetStaminaResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
GetStaminaResult result = client.getStamina(
new GetStaminaRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withAccessToken("accessToken-0001")
);
Stamina item = result.getItem();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.GetStaminaRequest;
using Gs2.Gs2Stamina.Result.GetStaminaResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.GetStaminaResult> asyncResult = null;
yield return client.GetStamina(
new Gs2.Gs2Stamina.Request.GetStaminaRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithAccessToken("accessToken-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.getStamina(
new Gs2Stamina.GetStaminaRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withAccessToken("accessToken-0001")
);
const item = result.getItem();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.get_stamina(
stamina.GetStaminaRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_access_token('accessToken-0001')
)
item = result.item
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_stamina({
namespaceName="namespace-0001",
staminaName="stamina-0001",
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;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.get_stamina_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
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;
staminaModel = result.staminaModel;
getStaminaByUserId
ユーザIDを指定してスタミナを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.GetStaminaByUserId(
&stamina.GetStaminaByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\GetStaminaByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getStaminaByUserId(
(new GetStaminaByUserIdRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.GetStaminaByUserIdRequest;
import io.gs2.stamina.result.GetStaminaByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
GetStaminaByUserIdResult result = client.getStaminaByUserId(
new GetStaminaByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
Stamina item = result.getItem();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.GetStaminaByUserIdRequest;
using Gs2.Gs2Stamina.Result.GetStaminaByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.GetStaminaByUserIdResult> asyncResult = null;
yield return client.GetStaminaByUserId(
new Gs2.Gs2Stamina.Request.GetStaminaByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.getStaminaByUserId(
new Gs2Stamina.GetStaminaByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.get_stamina_by_user_id(
stamina.GetStaminaByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_user_id('user-0001')
.with_time_offset_token(None)
)
item = result.item
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.get_stamina_by_user_id({
namespaceName="namespace-0001",
staminaName="stamina-0001",
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;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.get_stamina_by_user_id_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
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;
staminaModel = result.staminaModel;
updateStaminaByUserId
ユーザIDを指定してスタミナを作成・更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
value | int | ✓ | ~ 2147483646 | スタミナ値 | ||
maxValue | int | ✓ | 1 ~ 2147483646 | スタミナの最大値 | ||
recoverIntervalMinutes | int | 1 ~ 2147483646 | スタミナの回復間隔(分) | |||
recoverValue | int | 1 ~ 2147483646 | スタミナの回復量 | |||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.UpdateStaminaByUserId(
&stamina.UpdateStaminaByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
UserId: pointy.String("user-0001"),
Value: pointy.Int32(50),
MaxValue: pointy.Int32(100),
RecoverIntervalMinutes: nil,
RecoverValue: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\UpdateStaminaByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateStaminaByUserId(
(new UpdateStaminaByUserIdRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withUserId("user-0001")
->withValue(50)
->withMaxValue(100)
->withRecoverIntervalMinutes(null)
->withRecoverValue(null)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.UpdateStaminaByUserIdRequest;
import io.gs2.stamina.result.UpdateStaminaByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
UpdateStaminaByUserIdResult result = client.updateStaminaByUserId(
new UpdateStaminaByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withValue(50)
.withMaxValue(100)
.withRecoverIntervalMinutes(null)
.withRecoverValue(null)
.withTimeOffsetToken(null)
);
Stamina item = result.getItem();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.UpdateStaminaByUserIdRequest;
using Gs2.Gs2Stamina.Result.UpdateStaminaByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.UpdateStaminaByUserIdResult> asyncResult = null;
yield return client.UpdateStaminaByUserId(
new Gs2.Gs2Stamina.Request.UpdateStaminaByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithUserId("user-0001")
.WithValue(50)
.WithMaxValue(100)
.WithRecoverIntervalMinutes(null)
.WithRecoverValue(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.updateStaminaByUserId(
new Gs2Stamina.UpdateStaminaByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withValue(50)
.withMaxValue(100)
.withRecoverIntervalMinutes(null)
.withRecoverValue(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.update_stamina_by_user_id(
stamina.UpdateStaminaByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_user_id('user-0001')
.with_value(50)
.with_max_value(100)
.with_recover_interval_minutes(None)
.with_recover_value(None)
.with_time_offset_token(None)
)
item = result.item
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.update_stamina_by_user_id({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
value=50,
maxValue=100,
recoverIntervalMinutes=nil,
recoverValue=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;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.update_stamina_by_user_id_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
value=50,
maxValue=100,
recoverIntervalMinutes=nil,
recoverValue=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;
staminaModel = result.staminaModel;
consumeStamina
スタミナを消費
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
consumeValue | int | ✓ | 1 ~ 2147483646 | 消費するスタミナ量 |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.ConsumeStamina(
&stamina.ConsumeStaminaRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
AccessToken: pointy.String("accessToken-0001"),
ConsumeValue: pointy.Int32(50),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\ConsumeStaminaRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->consumeStamina(
(new ConsumeStaminaRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withAccessToken("accessToken-0001")
->withConsumeValue(50)
);
$item = $result->getItem();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.ConsumeStaminaRequest;
import io.gs2.stamina.result.ConsumeStaminaResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
ConsumeStaminaResult result = client.consumeStamina(
new ConsumeStaminaRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withAccessToken("accessToken-0001")
.withConsumeValue(50)
);
Stamina item = result.getItem();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.ConsumeStaminaRequest;
using Gs2.Gs2Stamina.Result.ConsumeStaminaResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.ConsumeStaminaResult> asyncResult = null;
yield return client.ConsumeStamina(
new Gs2.Gs2Stamina.Request.ConsumeStaminaRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithAccessToken("accessToken-0001")
.WithConsumeValue(50),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.consumeStamina(
new Gs2Stamina.ConsumeStaminaRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withAccessToken("accessToken-0001")
.withConsumeValue(50)
);
const item = result.getItem();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.consume_stamina(
stamina.ConsumeStaminaRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_access_token('accessToken-0001')
.with_consume_value(50)
)
item = result.item
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.consume_stamina({
namespaceName="namespace-0001",
staminaName="stamina-0001",
accessToken="accessToken-0001",
consumeValue=50,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.consume_stamina_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
accessToken="accessToken-0001",
consumeValue=50,
})
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;
staminaModel = result.staminaModel;
consumeStaminaByUserId
ユーザIDを指定してスタミナを消費
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
consumeValue | int | ✓ | 1 ~ 2147483646 | 消費するスタミナ量 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.ConsumeStaminaByUserId(
&stamina.ConsumeStaminaByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
UserId: pointy.String("user-0001"),
ConsumeValue: pointy.Int32(50),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\ConsumeStaminaByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->consumeStaminaByUserId(
(new ConsumeStaminaByUserIdRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withUserId("user-0001")
->withConsumeValue(50)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.ConsumeStaminaByUserIdRequest;
import io.gs2.stamina.result.ConsumeStaminaByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
ConsumeStaminaByUserIdResult result = client.consumeStaminaByUserId(
new ConsumeStaminaByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withConsumeValue(50)
.withTimeOffsetToken(null)
);
Stamina item = result.getItem();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.ConsumeStaminaByUserIdRequest;
using Gs2.Gs2Stamina.Result.ConsumeStaminaByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.ConsumeStaminaByUserIdResult> asyncResult = null;
yield return client.ConsumeStaminaByUserId(
new Gs2.Gs2Stamina.Request.ConsumeStaminaByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithUserId("user-0001")
.WithConsumeValue(50)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.consumeStaminaByUserId(
new Gs2Stamina.ConsumeStaminaByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withConsumeValue(50)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.consume_stamina_by_user_id(
stamina.ConsumeStaminaByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_user_id('user-0001')
.with_consume_value(50)
.with_time_offset_token(None)
)
item = result.item
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.consume_stamina_by_user_id({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
consumeValue=50,
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;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.consume_stamina_by_user_id_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
consumeValue=50,
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;
staminaModel = result.staminaModel;
applyStamina
現在のスタミナの自然回復量を適用
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
accessToken | string | ✓ | ~ 128文字 | アクセストークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.ApplyStamina(
&stamina.ApplyStaminaRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
AccessToken: pointy.String("accessToken-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\ApplyStaminaRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->applyStamina(
(new ApplyStaminaRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withAccessToken("accessToken-0001")
);
$item = $result->getItem();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.ApplyStaminaRequest;
import io.gs2.stamina.result.ApplyStaminaResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
ApplyStaminaResult result = client.applyStamina(
new ApplyStaminaRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withAccessToken("accessToken-0001")
);
Stamina item = result.getItem();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.ApplyStaminaRequest;
using Gs2.Gs2Stamina.Result.ApplyStaminaResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.ApplyStaminaResult> asyncResult = null;
yield return client.ApplyStamina(
new Gs2.Gs2Stamina.Request.ApplyStaminaRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithAccessToken("accessToken-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.applyStamina(
new Gs2Stamina.ApplyStaminaRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withAccessToken("accessToken-0001")
);
const item = result.getItem();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.apply_stamina(
stamina.ApplyStaminaRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_access_token('accessToken-0001')
)
item = result.item
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.apply_stamina({
namespaceName="namespace-0001",
staminaName="stamina-0001",
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;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.apply_stamina_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
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;
staminaModel = result.staminaModel;
applyStaminaByUserId
ユーザIDを指定して現在のスタミナの自然回復量を適用
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.ApplyStaminaByUserId(
&stamina.ApplyStaminaByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\ApplyStaminaByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->applyStaminaByUserId(
(new ApplyStaminaByUserIdRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.ApplyStaminaByUserIdRequest;
import io.gs2.stamina.result.ApplyStaminaByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
ApplyStaminaByUserIdResult result = client.applyStaminaByUserId(
new ApplyStaminaByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
Stamina item = result.getItem();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.ApplyStaminaByUserIdRequest;
using Gs2.Gs2Stamina.Result.ApplyStaminaByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.ApplyStaminaByUserIdResult> asyncResult = null;
yield return client.ApplyStaminaByUserId(
new Gs2.Gs2Stamina.Request.ApplyStaminaByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.applyStaminaByUserId(
new Gs2Stamina.ApplyStaminaByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.apply_stamina_by_user_id(
stamina.ApplyStaminaByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_user_id('user-0001')
.with_time_offset_token(None)
)
item = result.item
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.apply_stamina_by_user_id({
namespaceName="namespace-0001",
staminaName="stamina-0001",
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;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.apply_stamina_by_user_id_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
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;
staminaModel = result.staminaModel;
recoverStaminaByUserId
ユーザIDを指定してスタミナを回復
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
recoverValue | int | ✓ | 1 ~ 2147483646 | スタミナの回復量 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
overflowValue | int | スタミナ値の上限を超えて受け取れずに GS2-Inbox に転送したスタミナ値 |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.RecoverStaminaByUserId(
&stamina.RecoverStaminaByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
UserId: pointy.String("user-0001"),
RecoverValue: pointy.Int32(50),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
overflowValue := result.OverflowValue
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\RecoverStaminaByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->recoverStaminaByUserId(
(new RecoverStaminaByUserIdRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withUserId("user-0001")
->withRecoverValue(50)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$staminaModel = $result->getStaminaModel();
$overflowValue = $result->getOverflowValue();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.RecoverStaminaByUserIdRequest;
import io.gs2.stamina.result.RecoverStaminaByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
RecoverStaminaByUserIdResult result = client.recoverStaminaByUserId(
new RecoverStaminaByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withRecoverValue(50)
.withTimeOffsetToken(null)
);
Stamina item = result.getItem();
StaminaModel staminaModel = result.getStaminaModel();
int overflowValue = result.getOverflowValue();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.RecoverStaminaByUserIdRequest;
using Gs2.Gs2Stamina.Result.RecoverStaminaByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.RecoverStaminaByUserIdResult> asyncResult = null;
yield return client.RecoverStaminaByUserId(
new Gs2.Gs2Stamina.Request.RecoverStaminaByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithUserId("user-0001")
.WithRecoverValue(50)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
var overflowValue = result.OverflowValue;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.recoverStaminaByUserId(
new Gs2Stamina.RecoverStaminaByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withRecoverValue(50)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const staminaModel = result.getStaminaModel();
const overflowValue = result.getOverflowValue();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.recover_stamina_by_user_id(
stamina.RecoverStaminaByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_user_id('user-0001')
.with_recover_value(50)
.with_time_offset_token(None)
)
item = result.item
stamina_model = result.stamina_model
overflow_value = result.overflow_value
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.recover_stamina_by_user_id({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
recoverValue=50,
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;
staminaModel = result.staminaModel;
overflowValue = result.overflowValue;
client = gs2('stamina')
api_result_handler = client.recover_stamina_by_user_id_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
recoverValue=50,
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;
staminaModel = result.staminaModel;
overflowValue = result.overflowValue;
raiseMaxValueByUserId
ユーザIDを指定してスタミナの最大値を加算
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
raiseValue | int | ✓ | ~ 2147483646 | 上昇する最大スタミナ量 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.RaiseMaxValueByUserId(
&stamina.RaiseMaxValueByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
UserId: pointy.String("user-0001"),
RaiseValue: pointy.Int32(10),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\RaiseMaxValueByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->raiseMaxValueByUserId(
(new RaiseMaxValueByUserIdRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withUserId("user-0001")
->withRaiseValue(10)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.RaiseMaxValueByUserIdRequest;
import io.gs2.stamina.result.RaiseMaxValueByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
RaiseMaxValueByUserIdResult result = client.raiseMaxValueByUserId(
new RaiseMaxValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withRaiseValue(10)
.withTimeOffsetToken(null)
);
Stamina item = result.getItem();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.RaiseMaxValueByUserIdRequest;
using Gs2.Gs2Stamina.Result.RaiseMaxValueByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.RaiseMaxValueByUserIdResult> asyncResult = null;
yield return client.RaiseMaxValueByUserId(
new Gs2.Gs2Stamina.Request.RaiseMaxValueByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithUserId("user-0001")
.WithRaiseValue(10)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.raiseMaxValueByUserId(
new Gs2Stamina.RaiseMaxValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withRaiseValue(10)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.raise_max_value_by_user_id(
stamina.RaiseMaxValueByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_user_id('user-0001')
.with_raise_value(10)
.with_time_offset_token(None)
)
item = result.item
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.raise_max_value_by_user_id({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
raiseValue=10,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.raise_max_value_by_user_id_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
raiseValue=10,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
decreaseMaxValue
スタミナの最大値の減算
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
decreaseValue | int | ✓ | ~ 2147483646 | 減算する最大スタミナ量 |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DecreaseMaxValue(
&stamina.DecreaseMaxValueRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
AccessToken: pointy.String("accessToken-0001"),
DecreaseValue: pointy.Int32(10),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DecreaseMaxValueRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->decreaseMaxValue(
(new DecreaseMaxValueRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withAccessToken("accessToken-0001")
->withDecreaseValue(10)
);
$item = $result->getItem();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DecreaseMaxValueRequest;
import io.gs2.stamina.result.DecreaseMaxValueResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DecreaseMaxValueResult result = client.decreaseMaxValue(
new DecreaseMaxValueRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withAccessToken("accessToken-0001")
.withDecreaseValue(10)
);
Stamina item = result.getItem();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DecreaseMaxValueRequest;
using Gs2.Gs2Stamina.Result.DecreaseMaxValueResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DecreaseMaxValueResult> asyncResult = null;
yield return client.DecreaseMaxValue(
new Gs2.Gs2Stamina.Request.DecreaseMaxValueRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithAccessToken("accessToken-0001")
.WithDecreaseValue(10),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.decreaseMaxValue(
new Gs2Stamina.DecreaseMaxValueRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withAccessToken("accessToken-0001")
.withDecreaseValue(10)
);
const item = result.getItem();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.decrease_max_value(
stamina.DecreaseMaxValueRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_access_token('accessToken-0001')
.with_decrease_value(10)
)
item = result.item
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.decrease_max_value({
namespaceName="namespace-0001",
staminaName="stamina-0001",
accessToken="accessToken-0001",
decreaseValue=10,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.decrease_max_value_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
accessToken="accessToken-0001",
decreaseValue=10,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
decreaseMaxValueByUserId
ユーザIDを指定してスタミナの最大値の減算
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
decreaseValue | int | ✓ | ~ 2147483646 | 減算する最大スタミナ量 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DecreaseMaxValueByUserId(
&stamina.DecreaseMaxValueByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
UserId: pointy.String("user-0001"),
DecreaseValue: pointy.Int32(10),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DecreaseMaxValueByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->decreaseMaxValueByUserId(
(new DecreaseMaxValueByUserIdRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withUserId("user-0001")
->withDecreaseValue(10)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DecreaseMaxValueByUserIdRequest;
import io.gs2.stamina.result.DecreaseMaxValueByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DecreaseMaxValueByUserIdResult result = client.decreaseMaxValueByUserId(
new DecreaseMaxValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withDecreaseValue(10)
.withTimeOffsetToken(null)
);
Stamina item = result.getItem();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DecreaseMaxValueByUserIdRequest;
using Gs2.Gs2Stamina.Result.DecreaseMaxValueByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DecreaseMaxValueByUserIdResult> asyncResult = null;
yield return client.DecreaseMaxValueByUserId(
new Gs2.Gs2Stamina.Request.DecreaseMaxValueByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithUserId("user-0001")
.WithDecreaseValue(10)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.decreaseMaxValueByUserId(
new Gs2Stamina.DecreaseMaxValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withDecreaseValue(10)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.decrease_max_value_by_user_id(
stamina.DecreaseMaxValueByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_user_id('user-0001')
.with_decrease_value(10)
.with_time_offset_token(None)
)
item = result.item
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.decrease_max_value_by_user_id({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
decreaseValue=10,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.decrease_max_value_by_user_id_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
decreaseValue=10,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
setMaxValueByUserId
ユーザIDを指定してスタミナの最大値を更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
maxValue | int | ✓ | 1 ~ 2147483646 | スタミナの最大値 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
old | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.SetMaxValueByUserId(
&stamina.SetMaxValueByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
UserId: pointy.String("user-0001"),
MaxValue: pointy.Int32(100),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\SetMaxValueByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->setMaxValueByUserId(
(new SetMaxValueByUserIdRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withUserId("user-0001")
->withMaxValue(100)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$old = $result->getOld();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.SetMaxValueByUserIdRequest;
import io.gs2.stamina.result.SetMaxValueByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
SetMaxValueByUserIdResult result = client.setMaxValueByUserId(
new SetMaxValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withMaxValue(100)
.withTimeOffsetToken(null)
);
Stamina item = result.getItem();
Stamina old = result.getOld();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.SetMaxValueByUserIdRequest;
using Gs2.Gs2Stamina.Result.SetMaxValueByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.SetMaxValueByUserIdResult> asyncResult = null;
yield return client.SetMaxValueByUserId(
new Gs2.Gs2Stamina.Request.SetMaxValueByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithUserId("user-0001")
.WithMaxValue(100)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.setMaxValueByUserId(
new Gs2Stamina.SetMaxValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withMaxValue(100)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const old = result.getOld();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.set_max_value_by_user_id(
stamina.SetMaxValueByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_user_id('user-0001')
.with_max_value(100)
.with_time_offset_token(None)
)
item = result.item
old = result.old
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.set_max_value_by_user_id({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
maxValue=100,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.set_max_value_by_user_id_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
maxValue=100,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
setRecoverIntervalByUserId
ユーザIDを指定してスタミナの回復間隔(分)を更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
recoverIntervalMinutes | int | ✓ | 1 ~ 2147483646 | スタミナの回復間隔(分) | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
old | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.SetRecoverIntervalByUserId(
&stamina.SetRecoverIntervalByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
UserId: pointy.String("user-0001"),
RecoverIntervalMinutes: pointy.Int32(10),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\SetRecoverIntervalByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->setRecoverIntervalByUserId(
(new SetRecoverIntervalByUserIdRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withUserId("user-0001")
->withRecoverIntervalMinutes(10)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$old = $result->getOld();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.SetRecoverIntervalByUserIdRequest;
import io.gs2.stamina.result.SetRecoverIntervalByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
SetRecoverIntervalByUserIdResult result = client.setRecoverIntervalByUserId(
new SetRecoverIntervalByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withRecoverIntervalMinutes(10)
.withTimeOffsetToken(null)
);
Stamina item = result.getItem();
Stamina old = result.getOld();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.SetRecoverIntervalByUserIdRequest;
using Gs2.Gs2Stamina.Result.SetRecoverIntervalByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.SetRecoverIntervalByUserIdResult> asyncResult = null;
yield return client.SetRecoverIntervalByUserId(
new Gs2.Gs2Stamina.Request.SetRecoverIntervalByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithUserId("user-0001")
.WithRecoverIntervalMinutes(10)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.setRecoverIntervalByUserId(
new Gs2Stamina.SetRecoverIntervalByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withRecoverIntervalMinutes(10)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const old = result.getOld();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.set_recover_interval_by_user_id(
stamina.SetRecoverIntervalByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_user_id('user-0001')
.with_recover_interval_minutes(10)
.with_time_offset_token(None)
)
item = result.item
old = result.old
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.set_recover_interval_by_user_id({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
recoverIntervalMinutes=10,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.set_recover_interval_by_user_id_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
recoverIntervalMinutes=10,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
setRecoverValueByUserId
ユーザIDを指定してスタミナの回復量を設定
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
recoverValue | int | ✓ | 1 ~ 2147483646 | スタミナの回復量 | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
old | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.SetRecoverValueByUserId(
&stamina.SetRecoverValueByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
UserId: pointy.String("user-0001"),
RecoverValue: pointy.Int32(50),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\SetRecoverValueByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->setRecoverValueByUserId(
(new SetRecoverValueByUserIdRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withUserId("user-0001")
->withRecoverValue(50)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$old = $result->getOld();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.SetRecoverValueByUserIdRequest;
import io.gs2.stamina.result.SetRecoverValueByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
SetRecoverValueByUserIdResult result = client.setRecoverValueByUserId(
new SetRecoverValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withRecoverValue(50)
.withTimeOffsetToken(null)
);
Stamina item = result.getItem();
Stamina old = result.getOld();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.SetRecoverValueByUserIdRequest;
using Gs2.Gs2Stamina.Result.SetRecoverValueByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.SetRecoverValueByUserIdResult> asyncResult = null;
yield return client.SetRecoverValueByUserId(
new Gs2.Gs2Stamina.Request.SetRecoverValueByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithUserId("user-0001")
.WithRecoverValue(50)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.setRecoverValueByUserId(
new Gs2Stamina.SetRecoverValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withRecoverValue(50)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const old = result.getOld();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.set_recover_value_by_user_id(
stamina.SetRecoverValueByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_user_id('user-0001')
.with_recover_value(50)
.with_time_offset_token(None)
)
item = result.item
old = result.old
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.set_recover_value_by_user_id({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
recoverValue=50,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.set_recover_value_by_user_id_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
userId="user-0001",
recoverValue=50,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
setMaxValueByStatus
スタミナの最大値をGS2-Experienceのステータスを使用して更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
keyId | string | ✓ | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024文字 | 暗号鍵GRN | |
signedStatusBody | string | ✓ | ~ 524288文字 | 署名対象の GS2-Experience ステータスのボディ | ||
signedStatusSignature | string | ✓ | ~ 128文字 | GS2-Experience ステータスの署名 |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
old | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.SetMaxValueByStatus(
&stamina.SetMaxValueByStatusRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
AccessToken: pointy.String("accessToken-0001"),
KeyId: pointy.String("key-0001"),
SignedStatusBody: pointy.String("statusBody..."),
SignedStatusSignature: pointy.String("statusSignature..."),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\SetMaxValueByStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->setMaxValueByStatus(
(new SetMaxValueByStatusRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withAccessToken("accessToken-0001")
->withKeyId("key-0001")
->withSignedStatusBody("statusBody...")
->withSignedStatusSignature("statusSignature...")
);
$item = $result->getItem();
$old = $result->getOld();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.SetMaxValueByStatusRequest;
import io.gs2.stamina.result.SetMaxValueByStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
SetMaxValueByStatusResult result = client.setMaxValueByStatus(
new SetMaxValueByStatusRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withAccessToken("accessToken-0001")
.withKeyId("key-0001")
.withSignedStatusBody("statusBody...")
.withSignedStatusSignature("statusSignature...")
);
Stamina item = result.getItem();
Stamina old = result.getOld();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.SetMaxValueByStatusRequest;
using Gs2.Gs2Stamina.Result.SetMaxValueByStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.SetMaxValueByStatusResult> asyncResult = null;
yield return client.SetMaxValueByStatus(
new Gs2.Gs2Stamina.Request.SetMaxValueByStatusRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithAccessToken("accessToken-0001")
.WithKeyId("key-0001")
.WithSignedStatusBody("statusBody...")
.WithSignedStatusSignature("statusSignature..."),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.setMaxValueByStatus(
new Gs2Stamina.SetMaxValueByStatusRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withAccessToken("accessToken-0001")
.withKeyId("key-0001")
.withSignedStatusBody("statusBody...")
.withSignedStatusSignature("statusSignature...")
);
const item = result.getItem();
const old = result.getOld();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.set_max_value_by_status(
stamina.SetMaxValueByStatusRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_access_token('accessToken-0001')
.with_key_id('key-0001')
.with_signed_status_body('statusBody...')
.with_signed_status_signature('statusSignature...')
)
item = result.item
old = result.old
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.set_max_value_by_status({
namespaceName="namespace-0001",
staminaName="stamina-0001",
accessToken="accessToken-0001",
keyId="key-0001",
signedStatusBody="statusBody...",
signedStatusSignature="statusSignature...",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.set_max_value_by_status_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
accessToken="accessToken-0001",
keyId="key-0001",
signedStatusBody="statusBody...",
signedStatusSignature="statusSignature...",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
setRecoverIntervalByStatus
スタミナの最大値をGS2-Experienceのステータスを使用して更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
keyId | string | ✓ | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024文字 | 暗号鍵GRN | |
signedStatusBody | string | ✓ | ~ 524288文字 | 署名対象の GS2-Experience ステータスのボディ | ||
signedStatusSignature | string | ✓ | ~ 128文字 | GS2-Experience ステータスの署名 |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
old | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.SetRecoverIntervalByStatus(
&stamina.SetRecoverIntervalByStatusRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
AccessToken: pointy.String("accessToken-0001"),
KeyId: pointy.String("key-0001"),
SignedStatusBody: pointy.String("statusBody..."),
SignedStatusSignature: pointy.String("statusSignature..."),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\SetRecoverIntervalByStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->setRecoverIntervalByStatus(
(new SetRecoverIntervalByStatusRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withAccessToken("accessToken-0001")
->withKeyId("key-0001")
->withSignedStatusBody("statusBody...")
->withSignedStatusSignature("statusSignature...")
);
$item = $result->getItem();
$old = $result->getOld();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.SetRecoverIntervalByStatusRequest;
import io.gs2.stamina.result.SetRecoverIntervalByStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
SetRecoverIntervalByStatusResult result = client.setRecoverIntervalByStatus(
new SetRecoverIntervalByStatusRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withAccessToken("accessToken-0001")
.withKeyId("key-0001")
.withSignedStatusBody("statusBody...")
.withSignedStatusSignature("statusSignature...")
);
Stamina item = result.getItem();
Stamina old = result.getOld();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.SetRecoverIntervalByStatusRequest;
using Gs2.Gs2Stamina.Result.SetRecoverIntervalByStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.SetRecoverIntervalByStatusResult> asyncResult = null;
yield return client.SetRecoverIntervalByStatus(
new Gs2.Gs2Stamina.Request.SetRecoverIntervalByStatusRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithAccessToken("accessToken-0001")
.WithKeyId("key-0001")
.WithSignedStatusBody("statusBody...")
.WithSignedStatusSignature("statusSignature..."),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.setRecoverIntervalByStatus(
new Gs2Stamina.SetRecoverIntervalByStatusRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withAccessToken("accessToken-0001")
.withKeyId("key-0001")
.withSignedStatusBody("statusBody...")
.withSignedStatusSignature("statusSignature...")
);
const item = result.getItem();
const old = result.getOld();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.set_recover_interval_by_status(
stamina.SetRecoverIntervalByStatusRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_access_token('accessToken-0001')
.with_key_id('key-0001')
.with_signed_status_body('statusBody...')
.with_signed_status_signature('statusSignature...')
)
item = result.item
old = result.old
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.set_recover_interval_by_status({
namespaceName="namespace-0001",
staminaName="stamina-0001",
accessToken="accessToken-0001",
keyId="key-0001",
signedStatusBody="statusBody...",
signedStatusSignature="statusSignature...",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.set_recover_interval_by_status_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
accessToken="accessToken-0001",
keyId="key-0001",
signedStatusBody="statusBody...",
signedStatusSignature="statusSignature...",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
setRecoverValueByStatus
スタミナの回復量をGS2-Experienceのステータスを使用して更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
keyId | string | ✓ | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024文字 | 暗号鍵GRN | |
signedStatusBody | string | ✓ | ~ 524288文字 | 署名対象の GS2-Experience ステータスのボディ | ||
signedStatusSignature | string | ✓ | ~ 128文字 | GS2-Experience ステータスの署名 |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
old | Stamina | スタミナ |
staminaModel | StaminaModel | スタミナモデル |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.SetRecoverValueByStatus(
&stamina.SetRecoverValueByStatusRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
AccessToken: pointy.String("accessToken-0001"),
KeyId: pointy.String("key-0001"),
SignedStatusBody: pointy.String("statusBody..."),
SignedStatusSignature: pointy.String("statusSignature..."),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
old := result.Old
staminaModel := result.StaminaModel
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\SetRecoverValueByStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->setRecoverValueByStatus(
(new SetRecoverValueByStatusRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->withAccessToken("accessToken-0001")
->withKeyId("key-0001")
->withSignedStatusBody("statusBody...")
->withSignedStatusSignature("statusSignature...")
);
$item = $result->getItem();
$old = $result->getOld();
$staminaModel = $result->getStaminaModel();
} 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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.SetRecoverValueByStatusRequest;
import io.gs2.stamina.result.SetRecoverValueByStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
SetRecoverValueByStatusResult result = client.setRecoverValueByStatus(
new SetRecoverValueByStatusRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withAccessToken("accessToken-0001")
.withKeyId("key-0001")
.withSignedStatusBody("statusBody...")
.withSignedStatusSignature("statusSignature...")
);
Stamina item = result.getItem();
Stamina old = result.getOld();
StaminaModel staminaModel = result.getStaminaModel();
} 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.SetRecoverValueByStatusRequest;
using Gs2.Gs2Stamina.Result.SetRecoverValueByStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.SetRecoverValueByStatusResult> asyncResult = null;
yield return client.SetRecoverValueByStatus(
new Gs2.Gs2Stamina.Request.SetRecoverValueByStatusRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.WithAccessToken("accessToken-0001")
.WithKeyId("key-0001")
.WithSignedStatusBody("statusBody...")
.WithSignedStatusSignature("statusSignature..."),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;
var staminaModel = result.StaminaModel;
import Gs2Core from '@/gs2/core';
import * as Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.setRecoverValueByStatus(
new Gs2Stamina.SetRecoverValueByStatusRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withAccessToken("accessToken-0001")
.withKeyId("key-0001")
.withSignedStatusBody("statusBody...")
.withSignedStatusSignature("statusSignature...")
);
const item = result.getItem();
const old = result.getOld();
const staminaModel = result.getStaminaModel();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.set_recover_value_by_status(
stamina.SetRecoverValueByStatusRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_access_token('accessToken-0001')
.with_key_id('key-0001')
.with_signed_status_body('statusBody...')
.with_signed_status_signature('statusSignature...')
)
item = result.item
old = result.old
stamina_model = result.stamina_model
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.set_recover_value_by_status({
namespaceName="namespace-0001",
staminaName="stamina-0001",
accessToken="accessToken-0001",
keyId="key-0001",
signedStatusBody="statusBody...",
signedStatusSignature="statusSignature...",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
client = gs2('stamina')
api_result_handler = client.set_recover_value_by_status_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
accessToken="accessToken-0001",
keyId="key-0001",
signedStatusBody="statusBody...",
signedStatusSignature="statusSignature...",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;
deleteStaminaByUserId
ユーザIDを指定してスタミナを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | 削除したスタミナ |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.DeleteStaminaByUserId(
&stamina.DeleteStaminaByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
StaminaName: pointy.String("stamina-0001"),
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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DeleteStaminaByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteStaminaByUserId(
(new DeleteStaminaByUserIdRequest())
->withNamespaceName("namespace-0001")
->withStaminaName("stamina-0001")
->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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DeleteStaminaByUserIdRequest;
import io.gs2.stamina.result.DeleteStaminaByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
DeleteStaminaByUserIdResult result = client.deleteStaminaByUserId(
new DeleteStaminaByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
Stamina 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DeleteStaminaByUserIdRequest;
using Gs2.Gs2Stamina.Result.DeleteStaminaByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.DeleteStaminaByUserIdResult> asyncResult = null;
yield return client.DeleteStaminaByUserId(
new Gs2.Gs2Stamina.Request.DeleteStaminaByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithStaminaName("stamina-0001")
.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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.deleteStaminaByUserId(
new Gs2Stamina.DeleteStaminaByUserIdRequest()
.withNamespaceName("namespace-0001")
.withStaminaName("stamina-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.delete_stamina_by_user_id(
stamina.DeleteStaminaByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_stamina_name('stamina-0001')
.with_user_id('user-0001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.delete_stamina_by_user_id({
namespaceName="namespace-0001",
staminaName="stamina-0001",
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('stamina')
api_result_handler = client.delete_stamina_by_user_id_async({
namespaceName="namespace-0001",
staminaName="stamina-0001",
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;
verifyStaminaValue
スタミナ現在値を検証
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||||||||||||||||
accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||||||||||||||||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||||||||||||||||
verifyType | 文字列列挙型 enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | ~ 128文字 | 検証の種類
| ||||||||||||||||
value | int | ✓ | ~ 2147483646 | 現在値 | ||||||||||||||||
multiplyValueSpecifyingQuantity | bool | ✓ | true | 数量指定した際に、検証に使用する値も乗算するか |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.VerifyStaminaValue(
&stamina.VerifyStaminaValueRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
StaminaName: pointy.String("stamina-0001"),
VerifyType: pointy.String("less"),
Value: pointy.Int32(10),
MultiplyValueSpecifyingQuantity: 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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaValueRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyStaminaValue(
(new VerifyStaminaValueRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withStaminaName("stamina-0001")
->withVerifyType("less")
->withValue(10)
->withMultiplyValueSpecifyingQuantity(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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaValueRequest;
import io.gs2.stamina.result.VerifyStaminaValueResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
VerifyStaminaValueResult result = client.verifyStaminaValue(
new VerifyStaminaValueRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
);
Stamina 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.VerifyStaminaValueRequest;
using Gs2.Gs2Stamina.Result.VerifyStaminaValueResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaValueResult> asyncResult = null;
yield return client.VerifyStaminaValue(
new Gs2.Gs2Stamina.Request.VerifyStaminaValueRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithStaminaName("stamina-0001")
.WithVerifyType("less")
.WithValue(10)
.WithMultiplyValueSpecifyingQuantity(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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.verifyStaminaValue(
new Gs2Stamina.VerifyStaminaValueRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.verify_stamina_value(
stamina.VerifyStaminaValueRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_stamina_name('stamina-0001')
.with_verify_type('less')
.with_value(10)
.with_multiply_value_specifying_quantity(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.verify_stamina_value({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=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('stamina')
api_result_handler = client.verify_stamina_value_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
verifyStaminaValueByUserId
ユーザーIDを指定してスタミナ現在値を検証
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||||||||||||||||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||||||||||||||||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||||||||||||||||
verifyType | 文字列列挙型 enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | ~ 128文字 | 検証の種類
| ||||||||||||||||
value | int | ✓ | ~ 2147483646 | 現在値 | ||||||||||||||||
multiplyValueSpecifyingQuantity | bool | ✓ | true | 数量指定した際に、検証に使用する値も乗算するか | ||||||||||||||||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.VerifyStaminaValueByUserId(
&stamina.VerifyStaminaValueByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
StaminaName: pointy.String("stamina-0001"),
VerifyType: pointy.String("less"),
Value: pointy.Int32(10),
MultiplyValueSpecifyingQuantity: 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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaValueByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyStaminaValueByUserId(
(new VerifyStaminaValueByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withStaminaName("stamina-0001")
->withVerifyType("less")
->withValue(10)
->withMultiplyValueSpecifyingQuantity(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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaValueByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaValueByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
VerifyStaminaValueByUserIdResult result = client.verifyStaminaValueByUserId(
new VerifyStaminaValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
Stamina 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.VerifyStaminaValueByUserIdRequest;
using Gs2.Gs2Stamina.Result.VerifyStaminaValueByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaValueByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaValueByUserId(
new Gs2.Gs2Stamina.Request.VerifyStaminaValueByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithStaminaName("stamina-0001")
.WithVerifyType("less")
.WithValue(10)
.WithMultiplyValueSpecifyingQuantity(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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.verifyStaminaValueByUserId(
new Gs2Stamina.VerifyStaminaValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.verify_stamina_value_by_user_id(
stamina.VerifyStaminaValueByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_stamina_name('stamina-0001')
.with_verify_type('less')
.with_value(10)
.with_multiply_value_specifying_quantity(None)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.verify_stamina_value_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=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('stamina')
api_result_handler = client.verify_stamina_value_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
verifyStaminaMaxValue
スタミナ最大値を検証
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||||||||||||||||
accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||||||||||||||||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||||||||||||||||
verifyType | 文字列列挙型 enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | ~ 128文字 | 検証の種類
| ||||||||||||||||
value | int | ✓ | ~ 2147483646 | 最大値 | ||||||||||||||||
multiplyValueSpecifyingQuantity | bool | ✓ | true | 数量指定した際に、検証に使用する値も乗算するか |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.VerifyStaminaMaxValue(
&stamina.VerifyStaminaMaxValueRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
StaminaName: pointy.String("stamina-0001"),
VerifyType: pointy.String("less"),
Value: pointy.Int32(10),
MultiplyValueSpecifyingQuantity: 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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaMaxValueRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyStaminaMaxValue(
(new VerifyStaminaMaxValueRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withStaminaName("stamina-0001")
->withVerifyType("less")
->withValue(10)
->withMultiplyValueSpecifyingQuantity(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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaMaxValueRequest;
import io.gs2.stamina.result.VerifyStaminaMaxValueResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
VerifyStaminaMaxValueResult result = client.verifyStaminaMaxValue(
new VerifyStaminaMaxValueRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
);
Stamina 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.VerifyStaminaMaxValueRequest;
using Gs2.Gs2Stamina.Result.VerifyStaminaMaxValueResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaMaxValueResult> asyncResult = null;
yield return client.VerifyStaminaMaxValue(
new Gs2.Gs2Stamina.Request.VerifyStaminaMaxValueRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithStaminaName("stamina-0001")
.WithVerifyType("less")
.WithValue(10)
.WithMultiplyValueSpecifyingQuantity(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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.verifyStaminaMaxValue(
new Gs2Stamina.VerifyStaminaMaxValueRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.verify_stamina_max_value(
stamina.VerifyStaminaMaxValueRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_stamina_name('stamina-0001')
.with_verify_type('less')
.with_value(10)
.with_multiply_value_specifying_quantity(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.verify_stamina_max_value({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=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('stamina')
api_result_handler = client.verify_stamina_max_value_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
verifyStaminaMaxValueByUserId
ユーザーIDを指定してスタミナ最大値を検証
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||||||||||||||||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||||||||||||||||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||||||||||||||||
verifyType | 文字列列挙型 enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | ~ 128文字 | 検証の種類
| ||||||||||||||||
value | int | ✓ | ~ 2147483646 | 最大値 | ||||||||||||||||
multiplyValueSpecifyingQuantity | bool | ✓ | true | 数量指定した際に、検証に使用する値も乗算するか | ||||||||||||||||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.VerifyStaminaMaxValueByUserId(
&stamina.VerifyStaminaMaxValueByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
StaminaName: pointy.String("stamina-0001"),
VerifyType: pointy.String("less"),
Value: pointy.Int32(10),
MultiplyValueSpecifyingQuantity: 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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaMaxValueByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyStaminaMaxValueByUserId(
(new VerifyStaminaMaxValueByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withStaminaName("stamina-0001")
->withVerifyType("less")
->withValue(10)
->withMultiplyValueSpecifyingQuantity(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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaMaxValueByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaMaxValueByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
VerifyStaminaMaxValueByUserIdResult result = client.verifyStaminaMaxValueByUserId(
new VerifyStaminaMaxValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
Stamina 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.VerifyStaminaMaxValueByUserIdRequest;
using Gs2.Gs2Stamina.Result.VerifyStaminaMaxValueByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaMaxValueByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaMaxValueByUserId(
new Gs2.Gs2Stamina.Request.VerifyStaminaMaxValueByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithStaminaName("stamina-0001")
.WithVerifyType("less")
.WithValue(10)
.WithMultiplyValueSpecifyingQuantity(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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.verifyStaminaMaxValueByUserId(
new Gs2Stamina.VerifyStaminaMaxValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.verify_stamina_max_value_by_user_id(
stamina.VerifyStaminaMaxValueByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_stamina_name('stamina-0001')
.with_verify_type('less')
.with_value(10)
.with_multiply_value_specifying_quantity(None)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.verify_stamina_max_value_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=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('stamina')
api_result_handler = client.verify_stamina_max_value_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
verifyStaminaRecoverIntervalMinutes
スタミナ回復速度を検証
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||||||||||||||||
accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||||||||||||||||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||||||||||||||||
verifyType | 文字列列挙型 enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | ~ 128文字 | 検証の種類
| ||||||||||||||||
value | int | ✓ | ~ 2147483646 | 回復速度 | ||||||||||||||||
multiplyValueSpecifyingQuantity | bool | ✓ | true | 数量指定した際に、検証に使用する値も乗算するか |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.VerifyStaminaRecoverIntervalMinutes(
&stamina.VerifyStaminaRecoverIntervalMinutesRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
StaminaName: pointy.String("stamina-0001"),
VerifyType: pointy.String("less"),
Value: pointy.Int32(10),
MultiplyValueSpecifyingQuantity: 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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaRecoverIntervalMinutesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyStaminaRecoverIntervalMinutes(
(new VerifyStaminaRecoverIntervalMinutesRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withStaminaName("stamina-0001")
->withVerifyType("less")
->withValue(10)
->withMultiplyValueSpecifyingQuantity(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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaRecoverIntervalMinutesRequest;
import io.gs2.stamina.result.VerifyStaminaRecoverIntervalMinutesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
VerifyStaminaRecoverIntervalMinutesResult result = client.verifyStaminaRecoverIntervalMinutes(
new VerifyStaminaRecoverIntervalMinutesRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
);
Stamina 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.VerifyStaminaRecoverIntervalMinutesRequest;
using Gs2.Gs2Stamina.Result.VerifyStaminaRecoverIntervalMinutesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaRecoverIntervalMinutesResult> asyncResult = null;
yield return client.VerifyStaminaRecoverIntervalMinutes(
new Gs2.Gs2Stamina.Request.VerifyStaminaRecoverIntervalMinutesRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithStaminaName("stamina-0001")
.WithVerifyType("less")
.WithValue(10)
.WithMultiplyValueSpecifyingQuantity(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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.verifyStaminaRecoverIntervalMinutes(
new Gs2Stamina.VerifyStaminaRecoverIntervalMinutesRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.verify_stamina_recover_interval_minutes(
stamina.VerifyStaminaRecoverIntervalMinutesRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_stamina_name('stamina-0001')
.with_verify_type('less')
.with_value(10)
.with_multiply_value_specifying_quantity(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.verify_stamina_recover_interval_minutes({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=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('stamina')
api_result_handler = client.verify_stamina_recover_interval_minutes_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
verifyStaminaRecoverIntervalMinutesByUserId
ユーザーIDを指定してスタミナ回復速度を検証
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||||||||||||||||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||||||||||||||||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||||||||||||||||
verifyType | 文字列列挙型 enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | ~ 128文字 | 検証の種類
| ||||||||||||||||
value | int | ✓ | ~ 2147483646 | 回復速度 | ||||||||||||||||
multiplyValueSpecifyingQuantity | bool | ✓ | true | 数量指定した際に、検証に使用する値も乗算するか | ||||||||||||||||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.VerifyStaminaRecoverIntervalMinutesByUserId(
&stamina.VerifyStaminaRecoverIntervalMinutesByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
StaminaName: pointy.String("stamina-0001"),
VerifyType: pointy.String("less"),
Value: pointy.Int32(10),
MultiplyValueSpecifyingQuantity: 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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaRecoverIntervalMinutesByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyStaminaRecoverIntervalMinutesByUserId(
(new VerifyStaminaRecoverIntervalMinutesByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withStaminaName("stamina-0001")
->withVerifyType("less")
->withValue(10)
->withMultiplyValueSpecifyingQuantity(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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaRecoverIntervalMinutesByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaRecoverIntervalMinutesByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
VerifyStaminaRecoverIntervalMinutesByUserIdResult result = client.verifyStaminaRecoverIntervalMinutesByUserId(
new VerifyStaminaRecoverIntervalMinutesByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
Stamina 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.VerifyStaminaRecoverIntervalMinutesByUserIdRequest;
using Gs2.Gs2Stamina.Result.VerifyStaminaRecoverIntervalMinutesByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaRecoverIntervalMinutesByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaRecoverIntervalMinutesByUserId(
new Gs2.Gs2Stamina.Request.VerifyStaminaRecoverIntervalMinutesByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithStaminaName("stamina-0001")
.WithVerifyType("less")
.WithValue(10)
.WithMultiplyValueSpecifyingQuantity(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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.verifyStaminaRecoverIntervalMinutesByUserId(
new Gs2Stamina.VerifyStaminaRecoverIntervalMinutesByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.verify_stamina_recover_interval_minutes_by_user_id(
stamina.VerifyStaminaRecoverIntervalMinutesByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_stamina_name('stamina-0001')
.with_verify_type('less')
.with_value(10)
.with_multiply_value_specifying_quantity(None)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.verify_stamina_recover_interval_minutes_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=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('stamina')
api_result_handler = client.verify_stamina_recover_interval_minutes_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
verifyStaminaRecoverValue
スタミナ回復量を検証
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||||||||||||||||
accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||||||||||||||||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||||||||||||||||
verifyType | 文字列列挙型 enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | ~ 128文字 | 検証の種類
| ||||||||||||||||
value | int | ✓ | ~ 2147483646 | 回復量 | ||||||||||||||||
multiplyValueSpecifyingQuantity | bool | ✓ | true | 数量指定した際に、検証に使用する値も乗算するか |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.VerifyStaminaRecoverValue(
&stamina.VerifyStaminaRecoverValueRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
StaminaName: pointy.String("stamina-0001"),
VerifyType: pointy.String("less"),
Value: pointy.Int32(10),
MultiplyValueSpecifyingQuantity: 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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaRecoverValueRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyStaminaRecoverValue(
(new VerifyStaminaRecoverValueRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withStaminaName("stamina-0001")
->withVerifyType("less")
->withValue(10)
->withMultiplyValueSpecifyingQuantity(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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaRecoverValueRequest;
import io.gs2.stamina.result.VerifyStaminaRecoverValueResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
VerifyStaminaRecoverValueResult result = client.verifyStaminaRecoverValue(
new VerifyStaminaRecoverValueRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
);
Stamina 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.VerifyStaminaRecoverValueRequest;
using Gs2.Gs2Stamina.Result.VerifyStaminaRecoverValueResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaRecoverValueResult> asyncResult = null;
yield return client.VerifyStaminaRecoverValue(
new Gs2.Gs2Stamina.Request.VerifyStaminaRecoverValueRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithStaminaName("stamina-0001")
.WithVerifyType("less")
.WithValue(10)
.WithMultiplyValueSpecifyingQuantity(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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.verifyStaminaRecoverValue(
new Gs2Stamina.VerifyStaminaRecoverValueRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.verify_stamina_recover_value(
stamina.VerifyStaminaRecoverValueRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_stamina_name('stamina-0001')
.with_verify_type('less')
.with_value(10)
.with_multiply_value_specifying_quantity(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.verify_stamina_recover_value({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=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('stamina')
api_result_handler = client.verify_stamina_recover_value_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
verifyStaminaRecoverValueByUserId
ユーザーIDを指定してスタミナ回復量を検証
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||||||||||||||||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||||||||||||||||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||||||||||||||||
verifyType | 文字列列挙型 enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | ~ 128文字 | 検証の種類
| ||||||||||||||||
value | int | ✓ | ~ 2147483646 | 回復量 | ||||||||||||||||
multiplyValueSpecifyingQuantity | bool | ✓ | true | 数量指定した際に、検証に使用する値も乗算するか | ||||||||||||||||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.VerifyStaminaRecoverValueByUserId(
&stamina.VerifyStaminaRecoverValueByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
StaminaName: pointy.String("stamina-0001"),
VerifyType: pointy.String("less"),
Value: pointy.Int32(10),
MultiplyValueSpecifyingQuantity: 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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaRecoverValueByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyStaminaRecoverValueByUserId(
(new VerifyStaminaRecoverValueByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withStaminaName("stamina-0001")
->withVerifyType("less")
->withValue(10)
->withMultiplyValueSpecifyingQuantity(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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaRecoverValueByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaRecoverValueByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
VerifyStaminaRecoverValueByUserIdResult result = client.verifyStaminaRecoverValueByUserId(
new VerifyStaminaRecoverValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
Stamina 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.VerifyStaminaRecoverValueByUserIdRequest;
using Gs2.Gs2Stamina.Result.VerifyStaminaRecoverValueByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaRecoverValueByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaRecoverValueByUserId(
new Gs2.Gs2Stamina.Request.VerifyStaminaRecoverValueByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithStaminaName("stamina-0001")
.WithVerifyType("less")
.WithValue(10)
.WithMultiplyValueSpecifyingQuantity(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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.verifyStaminaRecoverValueByUserId(
new Gs2Stamina.VerifyStaminaRecoverValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.verify_stamina_recover_value_by_user_id(
stamina.VerifyStaminaRecoverValueByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_stamina_name('stamina-0001')
.with_verify_type('less')
.with_value(10)
.with_multiply_value_specifying_quantity(None)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.verify_stamina_recover_value_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=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('stamina')
api_result_handler = client.verify_stamina_recover_value_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
verifyStaminaOverflowValue
スタミナのオーバーフロー量を検証
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||||||||||||||||
accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||||||||||||||||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||||||||||||||||
verifyType | 文字列列挙型 enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | ~ 128文字 | 検証の種類
| ||||||||||||||||
value | int | ✓ | ~ 2147483646 | オーバーフロー量 | ||||||||||||||||
multiplyValueSpecifyingQuantity | bool | ✓ | true | 数量指定した際に、検証に使用する値も乗算するか |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.VerifyStaminaOverflowValue(
&stamina.VerifyStaminaOverflowValueRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
StaminaName: pointy.String("stamina-0001"),
VerifyType: pointy.String("less"),
Value: pointy.Int32(10),
MultiplyValueSpecifyingQuantity: 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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaOverflowValueRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyStaminaOverflowValue(
(new VerifyStaminaOverflowValueRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withStaminaName("stamina-0001")
->withVerifyType("less")
->withValue(10)
->withMultiplyValueSpecifyingQuantity(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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaOverflowValueRequest;
import io.gs2.stamina.result.VerifyStaminaOverflowValueResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
VerifyStaminaOverflowValueResult result = client.verifyStaminaOverflowValue(
new VerifyStaminaOverflowValueRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
);
Stamina 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.VerifyStaminaOverflowValueRequest;
using Gs2.Gs2Stamina.Result.VerifyStaminaOverflowValueResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaOverflowValueResult> asyncResult = null;
yield return client.VerifyStaminaOverflowValue(
new Gs2.Gs2Stamina.Request.VerifyStaminaOverflowValueRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithStaminaName("stamina-0001")
.WithVerifyType("less")
.WithValue(10)
.WithMultiplyValueSpecifyingQuantity(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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.verifyStaminaOverflowValue(
new Gs2Stamina.VerifyStaminaOverflowValueRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.verify_stamina_overflow_value(
stamina.VerifyStaminaOverflowValueRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_stamina_name('stamina-0001')
.with_verify_type('less')
.with_value(10)
.with_multiply_value_specifying_quantity(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.verify_stamina_overflow_value({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=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('stamina')
api_result_handler = client.verify_stamina_overflow_value_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
verifyStaminaOverflowValueByUserId
ユーザーIDを指定してスタミナオーバーフロー量を検証
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||||||||||||||||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||||||||||||||||
staminaName | string | ✓ | ~ 128文字 | スタミナモデルの名前 | ||||||||||||||||
verifyType | 文字列列挙型 enum { “less”, “lessEqual”, “greater”, “greaterEqual”, “equal”, “notEqual” } | ✓ | ~ 128文字 | 検証の種類
| ||||||||||||||||
value | int | ✓ | ~ 2147483646 | オーバーフロー量 | ||||||||||||||||
multiplyValueSpecifyingQuantity | bool | ✓ | true | 数量指定した際に、検証に使用する値も乗算するか | ||||||||||||||||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
item | Stamina | スタミナ |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/stamina"
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 := stamina.Gs2StaminaRestClient{
Session: &session,
}
result, err := client.VerifyStaminaOverflowValueByUserId(
&stamina.VerifyStaminaOverflowValueByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
StaminaName: pointy.String("stamina-0001"),
VerifyType: pointy.String("less"),
Value: pointy.Int32(10),
MultiplyValueSpecifyingQuantity: 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\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\VerifyStaminaOverflowValueByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyStaminaOverflowValueByUserId(
(new VerifyStaminaOverflowValueByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withStaminaName("stamina-0001")
->withVerifyType("less")
->withValue(10)
->withMultiplyValueSpecifyingQuantity(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.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.VerifyStaminaOverflowValueByUserIdRequest;
import io.gs2.stamina.result.VerifyStaminaOverflowValueByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);
try {
VerifyStaminaOverflowValueByUserIdResult result = client.verifyStaminaOverflowValueByUserId(
new VerifyStaminaOverflowValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
Stamina 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.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.VerifyStaminaOverflowValueByUserIdRequest;
using Gs2.Gs2Stamina.Result.VerifyStaminaOverflowValueByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2StaminaRestClient(session);
AsyncResult<Gs2.Gs2Stamina.Result.VerifyStaminaOverflowValueByUserIdResult> asyncResult = null;
yield return client.VerifyStaminaOverflowValueByUserId(
new Gs2.Gs2Stamina.Request.VerifyStaminaOverflowValueByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithStaminaName("stamina-0001")
.WithVerifyType("less")
.WithValue(10)
.WithMultiplyValueSpecifyingQuantity(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 Gs2Stamina from '@/gs2/stamina';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Stamina.Gs2StaminaRestClient(session);
try {
const result = await client.verifyStaminaOverflowValueByUserId(
new Gs2Stamina.VerifyStaminaOverflowValueByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withStaminaName("stamina-0001")
.withVerifyType("less")
.withValue(10)
.withMultiplyValueSpecifyingQuantity(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import stamina
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = stamina.Gs2StaminaRestClient(session)
try:
result = client.verify_stamina_overflow_value_by_user_id(
stamina.VerifyStaminaOverflowValueByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_stamina_name('stamina-0001')
.with_verify_type('less')
.with_value(10)
.with_multiply_value_specifying_quantity(None)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('stamina')
api_result = client.verify_stamina_overflow_value_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=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('stamina')
api_result_handler = client.verify_stamina_overflow_value_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
staminaName="stamina-0001",
verifyType="less",
value=10,
multiplyValueSpecifyingQuantity=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;