GS2-Stamina SDK API リファレンス

モデル

Namespace

ネームスペース

ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。 GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。

そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字ネームスペースGRN
namestring~ 32文字ネームスペース名
descriptionstring~ 1024文字説明文
overflowTriggerScriptstring~ 1024文字回復処理時にあふれたスタミナに対して処理をする GS2-Script
logSettingLogSettingログの出力設定
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

StaminaModelMaster

スタミナマスター

スタミナの最大値や、回復間隔、回復量といったパラメータを定義できます。 GS2-Experience と連動させて、最大値や回復量をコントロールすることもできます。

有効化条件必須デフォルト値の制限説明
staminaModelIdstring~ 1024文字スタミナモデルマスターGRN
namestring~ 128文字スタミナモデル名
metadatastring~ 128文字メタデータ
descriptionstring~ 1024文字説明文
recoverIntervalMinutesint~ 2147483646スタミナを回復する速度(分)
recoverValueint1~ 2147483646時間経過後に回復する量
initialCapacityint~ 2147483646スタミナの最大値の初期値
isOverflowbool最大値を超えて回復するか
maxCapacityint{isOverflow}~ 2147483646溢れた状況での最大値
maxStaminaTableNamestring~ 128文字GS2-Experience のランクによって最大スタミナ値を決定するスタミナ最大値テーブル名
recoverIntervalTableNamestring~ 128文字GS2-Experience のランクによってスタミナの回復間隔を決定する回復間隔テーブル名
recoverValueTableNamestring~ 128文字GS2-Experience のランクによってスタミナの回復量を決定する回復量テーブル名
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

MaxStaminaTableMaster

スタミナ最大値テーブルマスター

GS2-Experience のランクごとにスタミナの最大値を定義するエンティティです。

有効化条件必須デフォルト値の制限説明
maxStaminaTableIdstring~ 1024文字スタミナの最大値テーブルマスターGRN
namestring~ 128文字最大スタミナ値テーブル名
metadatastring~ 128文字メタデータ
descriptionstring~ 1024文字説明文
experienceModelIdstring~ 1024文字経験値モデルGRN
valuesList<int>1 ~ 1024 itemsランク毎のスタミナの最大値テーブル
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

RecoverIntervalTableMaster

スタミナ回復間隔テーブルマスター

GS2-Experience のランクごとにスタミナの回復間隔を定義するエンティティです。

有効化条件必須デフォルト値の制限説明
recoverIntervalTableIdstring~ 1024文字スタミナ回復間隔テーブルマスターGRN
namestring~ 128文字スタミナ回復間隔テーブル名
metadatastring~ 128文字メタデータ
descriptionstring~ 1024文字説明文
experienceModelIdstring~ 1024文字経験値モデルGRN
valuesList<int>1 ~ 1024 itemsランク毎のスタミナ回復間隔テーブル
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

RecoverValueTableMaster

スタミナ回復量テーブルマスター

GS2-Experience のランクごとにスタミナの回復量を定義するエンティティです。

有効化条件必須デフォルト値の制限説明
recoverValueTableIdstring~ 1024文字スタミナ回復量テーブルマスターGRN
namestring~ 128文字スタミナ回復量テーブル名
metadatastring~ 128文字メタデータ
descriptionstring~ 1024文字説明文
experienceModelIdstring~ 1024文字経験値モデルGRN
valuesList<int>1 ~ 1024 itemsランク毎のスタミナ回復量テーブル
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

CurrentStaminaMaster

現在有効なマスターデータ

GS2ではマスターデータの管理にJSON形式のファイルを使用します。 ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。

JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。

JSONファイルの形式についてはドキュメントを参照ください。

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字現在有効なスタミナマスターGRN
settingsstring~ 5242880文字マスターデータ

StaminaModel

スタミナモデル

スタミナの最大値や、回復間隔、回復量といったパラメータを定義できます。 GS2-Experience と連動させて、最大値や回復量をコントロールすることもできます。

有効化条件必須デフォルト値の制限説明
staminaModelIdstring~ 1024文字スタミナモデルGRN
namestring~ 128文字スタミナモデル名
metadatastring~ 128文字メタデータ
recoverIntervalMinutesint~ 2147483646スタミナを回復する速度(分)
recoverValueint1~ 2147483646時間経過後に回復する量
initialCapacityint~ 2147483646スタミナの最大値の初期値
isOverflowbool最大値を超えて回復するか
maxCapacityint{isOverflow}~ 2147483646溢れた状況での最大値
maxStaminaTableMaxStaminaTableGS2-Experience と連携する際に使用するスタミナ最大値テーブル
recoverIntervalTableRecoverIntervalTableGS2-Experience と連携する際に使用する回復間隔テーブル
recoverValueTableRecoverValueTableGS2-Experience と連携する際に使用する回復量テーブル

MaxStaminaTable

スタミナ最大値テーブル

GS2-Experience のランクごとにスタミナの最大値を定義するエンティティです。

有効化条件必須デフォルト値の制限説明
namestring~ 128文字最大スタミナ値テーブル名
metadatastring~ 128文字メタデータ
experienceModelIdstring~ 1024文字経験値モデルGRN
valuesList<int>1 ~ 1024 itemsランク毎のスタミナの最大値テーブル

RecoverIntervalTable

スタミナ回復間隔テーブル

GS2-Experience のランクごとにスタミナの回復間隔を定義するエンティティです。

有効化条件必須デフォルト値の制限説明
namestring~ 128文字スタミナ回復間隔テーブル名
metadatastring~ 128文字メタデータ
experienceModelIdstring~ 1024文字経験値モデルGRN
valuesList<int>1 ~ 1024 itemsランク毎のスタミナ回復間隔テーブル

RecoverValueTable

スタミナ回復量テーブル

GS2-Experience のランクごとにスタミナの回復量を定義するエンティティです。

有効化条件必須デフォルト値の制限説明
namestring~ 128文字スタミナ回復量テーブル名
metadatastring~ 128文字メタデータ
experienceModelIdstring~ 1024文字経験値モデルGRN
valuesList<int>1 ~ 1024 itemsランク毎のスタミナ回復量テーブル

Stamina

スタミナ

スタミナとは現実時間の時間経過で回復するポイントです。 一般的にこのスタミナを消費してゲームをプレイできるようにすることで、プレイヤーの1日のプレイ回数を制限し、ゲームの進行速度をゲーム提供側がコントロールする目的で使用されます。

有効化条件必須デフォルト値の制限説明
staminaIdstring~ 1024文字スタミナGRN
staminaNamestring~ 128文字スタミナモデルの名前
userIdstring~ 128文字ユーザーID
valueint~ 2147483646スタミナ値
maxValueint1 ~ 2147483646スタミナの最大値
recoverIntervalMinutesint1 ~ 2147483646スタミナの回復間隔(分)
recoverValueint1 ~ 2147483646スタミナの回復量
overflowValueint~ 2147483646スタミナの最大値を超えて格納されているスタミナ値
nextRecoverAtlong次回スタミナが回復する時間
lastRecoveredAtlong作成日時
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

GitHubCheckoutSetting

GitHubからマスターデータをチェックアウトする設定

有効化条件必須デフォルト値の制限説明
apiKeyIdstring~ 1024文字GitHub のAPIキーGRN
repositoryNamestring~ 1024文字リポジトリ名
sourcePathstring~ 1024文字ソースコードのファイルパス
referenceTypeenum [
“commit_hash”,
“branch”,
“tag”
]
~ 128文字コードの取得元
commitHashstring{referenceType} == “commit_hash”~ 1024文字コミットハッシュ
branchNamestring{referenceType} == “branch”~ 1024文字ブランチ名
tagNamestring{referenceType} == “tag”~ 1024文字タグ名

LogSetting

ログの書き出し設定

ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用されるログ名前空間の識別子(Namespace ID)を保持します。 ログ名前空間IDは、ログデータを集約し、保存する対象の GS2-Log の名前空間を指定します。 この設定を通じて、この名前空間以下のAPIリクエスト・レスポンスログデータが対象の GS2-Log へ出力されるようになります。 GS2-Log にはリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。

有効化条件必須デフォルト値の制限説明
loggingNamespaceIdstring~ 1024文字ネームスペースGRN

ScriptSetting

スクリプト設定

GS2 ではマイクロサービスのイベントに関連づけて、カスタムスクリプトを実行することができます。 このモデルは、スクリプトの実行をトリガーするための設定を保持します。

スクリプトの実行方式は大きく2種類あり、それは「同期実行」と「非同期実行」です。 同期実行は、スクリプトの実行が完了するまで処理がブロックされます。 かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることができます。

一方、非同期実行は、スクリプトの実行が完了するまで処理がブロックされません。 かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることはできません。 しかし、非同期実行は、スクリプトの実行が完了するまで処理がブロックされないため、APIの応答に影響を与えないため、原則非同期実行を使用することをおすすめします。

非同期実行には実行方式が2種類あり、GS2-Script と Amazon EventBridge があります。 Amazon EventBridge を使用することで、Lua 以外の言語で処理を記述することができます。

有効化条件必須デフォルト値の制限説明
triggerScriptIdstring~ 1024文字スクリプトGRN
doneTriggerTargetTypeenum [
“none”,
“gs2_script”,
“aws”
]
“none”~ 128文字完了通知の通知先
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024文字スクリプトGRN
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024文字ネームスペースGRN

メソッド

describeNamespaces

ネームスペースの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<Namespace>ネームスペースのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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;

createNamespace

ネームスペースを新規作成

Request

有効化条件必須デフォルト値の制限説明
namestring~ 32文字ネームスペース名
descriptionstring~ 1024文字説明文
overflowTriggerScriptstring~ 1024文字回復処理時にあふれたスタミナに対して処理をする GS2-Script
logSettingLogSettingログの出力設定

Result

説明
itemNamespace作成したネームスペース

実装例

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("namespace1"),
        Description: nil,
        OverflowTriggerScript: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script"),
        LogSetting: &stamina.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(self::namespace1)
            ->withDescription(null)
            ->withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script")
            ->withLogSetting((new \Gs2\Stamina\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
            .withDescription(null)
            .withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script")
            .withLogSetting(new io.gs2.stamina.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.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("namespace1")
        .WithDescription(null)
        .WithOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script")
        .WithLogSetting(new Gs2.Gs2Stamina.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
            .withDescription(null)
            .withOverflowTriggerScript("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script")
            .withLogSetting(new Gs2Stamina.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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(self.hash1)
            .with_description(None)
            .with_overflow_trigger_script('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script')
            .with_log_setting(
                stamina.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.create_namespace({
    name="namespace1",
    description=nil,
    overflowTriggerScript="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script",
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getNamespaceStatus

ネームスペースの状態を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名

Result

説明
statusstring

実装例

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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(self::namespace1)
    );
    $status = $result->getStatus();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.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("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
    );
    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(self.hash1)
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.get_namespace_status({
    namespaceName="namespace1",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
status = result.status;

getNamespace

ネームスペースを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名

Result

説明
itemNamespaceネームスペース

実装例

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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.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("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
    );
    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(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.get_namespace({
    namespaceName="namespace1",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

updateNamespace

ネームスペースを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
descriptionstring~ 1024文字説明文
overflowTriggerScriptstring~ 1024文字回復処理時にあふれたスタミナに対して処理をする GS2-Script
logSettingLogSettingログの出力設定

Result

説明
itemNamespace更新したネームスペース

実装例

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("namespace1"),
        Description: pointy.String("description1"),
        OverflowTriggerScript: nil,
        LogSetting: &stamina.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(self::namespace1)
            ->withDescription("description1")
            ->withOverflowTriggerScript(null)
            ->withLogSetting((new \Gs2\Stamina\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
            .withDescription("description1")
            .withOverflowTriggerScript(null)
            .withLogSetting(new io.gs2.stamina.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.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("namespace1")
        .WithDescription("description1")
        .WithOverflowTriggerScript(null)
        .WithLogSetting(new Gs2.Gs2Stamina.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
            .withDescription("description1")
            .withOverflowTriggerScript(null)
            .withLogSetting(new Gs2Stamina.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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(self.hash1)
            .with_description('description1')
            .with_overflow_trigger_script(None)
            .with_log_setting(
                stamina.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.update_namespace({
    namespaceName="namespace1",
    description="description1",
    overflowTriggerScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

deleteNamespace

ネームスペースを削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名

Result

説明
itemNamespace削除したネームスペース

実装例

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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.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("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
    );
    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(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.delete_namespace({
    namespaceName="namespace1",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

dumpUserDataByUserId

指定したユーザーIDに紐づくデータのダンプを取得

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 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

checkDumpUserDataByUserId

指定したユーザーIDに紐づくデータのダンプが完了しているか確認

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
urlstring出力データの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;

cleanUserDataByUserId

指定したユーザーIDに紐づくデータのダンプを取得

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 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

checkCleanUserDataByUserId

指定したユーザーIDに紐づくデータのダンプが完了しているか確認

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 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

prepareImportUserDataByUserId

指定したユーザーIDに紐づくデータのインポートを開始

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
uploadTokenstringアップロード後に結果を反映する際に使用するトークン
uploadUrlstringユーザーデータアップロード処理の実行に使用する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;

importUserDataByUserId

指定したユーザーIDに紐づくデータのインポートを開始

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
uploadTokenstring~ 1024文字アップロード準備で受け取ったトークン
timeOffsetTokenstring~ 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

checkImportUserDataByUserId

指定したユーザーIDに紐づくデータのインポートが完了しているか確認

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
uploadTokenstring~ 1024文字アップロード準備で受け取ったトークン
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
urlstring出力ログの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;

describeStaminaModelMasters

スタミナモデルマスターの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<StaminaModelMaster>スタミナモデルマスターのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(self::namespace1)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
            .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("namespace1")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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(self.hash1)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.describe_stamina_model_masters({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createStaminaModelMaster

スタミナモデルマスターを新規作成

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
namestring~ 128文字スタミナモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
recoverIntervalMinutesint~ 2147483646スタミナを回復する速度(分)
recoverValueint1~ 2147483646時間経過後に回復する量
initialCapacityint~ 2147483646スタミナの最大値の初期値
isOverflowbool最大値を超えて回復するか
maxCapacityint{isOverflow}~ 2147483646溢れた状況での最大値
maxStaminaTableNamestring~ 128文字GS2-Experience のランクによって最大スタミナ値を決定するスタミナ最大値テーブル名
recoverIntervalTableNamestring~ 128文字GS2-Experience のランクによってスタミナの回復間隔を決定する回復間隔テーブル名
recoverValueTableNamestring~ 128文字GS2-Experience のランクによってスタミナの回復量を決定する回復量テーブル名

Result

説明
itemStaminaModelMaster作成したスタミナモデルマスター

実装例

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("namespace1"),
        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("$maxStaminaTable1.name"),
        RecoverIntervalTableName: pointy.String("$recoverIntervalTable1.name"),
        RecoverValueTableName: pointy.String("$recoverValueTable1.name"),
    }
)
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(self::namespace1)
            ->withName("stamina-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withRecoverIntervalMinutes(15)
            ->withRecoverValue(null)
            ->withInitialCapacity(50)
            ->withIsOverflow(False)
            ->withMaxCapacity(null)
            ->withMaxStaminaTableName(self::$maxStaminaTable1.name)
            ->withRecoverIntervalTableName(self::$recoverIntervalTable1.name)
            ->withRecoverValueTableName(self::$recoverValueTable1.name)
    );
    $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("namespace1")
            .withName("stamina-0001")
            .withDescription(null)
            .withMetadata(null)
            .withRecoverIntervalMinutes(15)
            .withRecoverValue(null)
            .withInitialCapacity(50)
            .withIsOverflow(false)
            .withMaxCapacity(null)
            .withMaxStaminaTableName("$maxStaminaTable1.name")
            .withRecoverIntervalTableName("$recoverIntervalTable1.name")
            .withRecoverValueTableName("$recoverValueTable1.name")
    );
    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("namespace1")
        .WithName("stamina-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithRecoverIntervalMinutes(15)
        .WithRecoverValue(null)
        .WithInitialCapacity(50)
        .WithIsOverflow(false)
        .WithMaxCapacity(null)
        .WithMaxStaminaTableName("$maxStaminaTable1.name")
        .WithRecoverIntervalTableName("$recoverIntervalTable1.name")
        .WithRecoverValueTableName("$recoverValueTable1.name"),
    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("namespace1")
            .withName("stamina-0001")
            .withDescription(null)
            .withMetadata(null)
            .withRecoverIntervalMinutes(15)
            .withRecoverValue(null)
            .withInitialCapacity(50)
            .withIsOverflow(false)
            .withMaxCapacity(null)
            .withMaxStaminaTableName("$maxStaminaTable1.name")
            .withRecoverIntervalTableName("$recoverIntervalTable1.name")
            .withRecoverValueTableName("$recoverValueTable1.name")
    );
    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(self.hash1)
            .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(self.max_stamina_table1.name)
            .with_recover_interval_table_name(self.recover_interval_table1.name)
            .with_recover_value_table_name(self.recover_value_table1.name)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.create_stamina_model_master({
    namespaceName="namespace1",
    name="stamina-0001",
    description=nil,
    metadata=nil,
    recoverIntervalMinutes=15,
    recoverValue=nil,
    initialCapacity=50,
    isOverflow=false,
    maxCapacity=nil,
    maxStaminaTableName="$maxStaminaTable1.name",
    recoverIntervalTableName="$recoverIntervalTable1.name",
    recoverValueTableName="$recoverValueTable1.name",
})

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

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデル名

Result

説明
itemStaminaModelMasterスタミナモデルマスター

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

updateStaminaModelMaster

スタミナモデルマスターを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
recoverIntervalMinutesint~ 2147483646スタミナを回復する速度(分)
recoverValueint1~ 2147483646時間経過後に回復する量
initialCapacityint~ 2147483646スタミナの最大値の初期値
isOverflowbool最大値を超えて回復するか
maxCapacityint{isOverflow}~ 2147483646溢れた状況での最大値
maxStaminaTableNamestring~ 128文字GS2-Experience のランクによって最大スタミナ値を決定するスタミナ最大値テーブル名
recoverIntervalTableNamestring~ 128文字GS2-Experience のランクによってスタミナの回復間隔を決定する回復間隔テーブル名
recoverValueTableNamestring~ 128文字GS2-Experience のランクによってスタミナの回復量を決定する回復量テーブル名

Result

説明
itemStaminaModelMaster更新したスタミナモデルマスター

実装例

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("namespace1"),
        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("$maxStaminaTable2.name"),
        RecoverIntervalTableName: pointy.String("$recoverIntervalTable2.name"),
        RecoverValueTableName: pointy.String("$recoverValueTable2.name"),
    }
)
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(self::namespace1)
            ->withStaminaName("stamina-0001")
            ->withDescription("description1")
            ->withMetadata("STAMINA_MODEL_MASTER_0001")
            ->withRecoverIntervalMinutes(20)
            ->withRecoverValue(2)
            ->withInitialCapacity(60)
            ->withIsOverflow(True)
            ->withMaxCapacity(999)
            ->withMaxStaminaTableName(self::$maxStaminaTable2.name)
            ->withRecoverIntervalTableName(self::$recoverIntervalTable2.name)
            ->withRecoverValueTableName(self::$recoverValueTable2.name)
    );
    $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("namespace1")
            .withStaminaName("stamina-0001")
            .withDescription("description1")
            .withMetadata("STAMINA_MODEL_MASTER_0001")
            .withRecoverIntervalMinutes(20)
            .withRecoverValue(2)
            .withInitialCapacity(60)
            .withIsOverflow(true)
            .withMaxCapacity(999)
            .withMaxStaminaTableName("$maxStaminaTable2.name")
            .withRecoverIntervalTableName("$recoverIntervalTable2.name")
            .withRecoverValueTableName("$recoverValueTable2.name")
    );
    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("namespace1")
        .WithStaminaName("stamina-0001")
        .WithDescription("description1")
        .WithMetadata("STAMINA_MODEL_MASTER_0001")
        .WithRecoverIntervalMinutes(20)
        .WithRecoverValue(2)
        .WithInitialCapacity(60)
        .WithIsOverflow(true)
        .WithMaxCapacity(999)
        .WithMaxStaminaTableName("$maxStaminaTable2.name")
        .WithRecoverIntervalTableName("$recoverIntervalTable2.name")
        .WithRecoverValueTableName("$recoverValueTable2.name"),
    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("namespace1")
            .withStaminaName("stamina-0001")
            .withDescription("description1")
            .withMetadata("STAMINA_MODEL_MASTER_0001")
            .withRecoverIntervalMinutes(20)
            .withRecoverValue(2)
            .withInitialCapacity(60)
            .withIsOverflow(true)
            .withMaxCapacity(999)
            .withMaxStaminaTableName("$maxStaminaTable2.name")
            .withRecoverIntervalTableName("$recoverIntervalTable2.name")
            .withRecoverValueTableName("$recoverValueTable2.name")
    );
    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(self.hash1)
            .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(self.max_stamina_table2.name)
            .with_recover_interval_table_name(self.recover_interval_table2.name)
            .with_recover_value_table_name(self.recover_value_table2.name)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.update_stamina_model_master({
    namespaceName="namespace1",
    staminaName="stamina-0001",
    description="description1",
    metadata="STAMINA_MODEL_MASTER_0001",
    recoverIntervalMinutes=20,
    recoverValue=2,
    initialCapacity=60,
    isOverflow=true,
    maxCapacity=999,
    maxStaminaTableName="$maxStaminaTable2.name",
    recoverIntervalTableName="$recoverIntervalTable2.name",
    recoverValueTableName="$recoverValueTable2.name",
})

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

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデル名

Result

説明
itemStaminaModelMaster削除したスタミナモデルマスター

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

describeMaxStaminaTableMasters

スタミナの最大値テーブルマスターの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<MaxStaminaTableMaster>スタミナの最大値テーブルマスターのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(self::namespace1)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
            .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("namespace1")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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(self.hash1)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.describe_max_stamina_table_masters({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createMaxStaminaTableMaster

スタミナの最大値テーブルマスターを新規作成

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
namestring~ 128文字最大スタミナ値テーブル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
experienceModelIdstring~ 1024文字経験値モデルGRN
valuesList<int>1 ~ 1024 itemsランク毎のスタミナの最大値テーブル

Result

説明
itemMaxStaminaTableMaster作成したスタミナの最大値テーブルマスター

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

getMaxStaminaTableMaster

スタミナの最大値テーブルマスターを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
maxStaminaTableNamestring~ 128文字最大スタミナ値テーブル名

Result

説明
itemMaxStaminaTableMasterスタミナの最大値テーブルマスター

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

updateMaxStaminaTableMaster

スタミナの最大値テーブルマスターを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
maxStaminaTableNamestring~ 128文字最大スタミナ値テーブル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
experienceModelIdstring~ 1024文字経験値モデルGRN
valuesList<int>1 ~ 1024 itemsランク毎のスタミナの最大値テーブル

Result

説明
itemMaxStaminaTableMaster更新したスタミナの最大値テーブルマスター

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

deleteMaxStaminaTableMaster

スタミナの最大値テーブルマスターを削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
maxStaminaTableNamestring~ 128文字最大スタミナ値テーブル名

Result

説明
itemMaxStaminaTableMaster削除したスタミナの最大値テーブルマスター

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

describeRecoverIntervalTableMasters

スタミナ回復間隔テーブルマスターの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<RecoverIntervalTableMaster>スタミナ回復間隔テーブルマスターのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(self::namespace1)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
            .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("namespace1")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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(self.hash1)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.describe_recover_interval_table_masters({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createRecoverIntervalTableMaster

スタミナ回復間隔テーブルマスターを新規作成

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
namestring~ 128文字スタミナ回復間隔テーブル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
experienceModelIdstring~ 1024文字経験値モデルGRN
valuesList<int>1 ~ 1024 itemsランク毎のスタミナ回復間隔テーブル

Result

説明
itemRecoverIntervalTableMaster作成したスタミナ回復間隔テーブルマスター

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

getRecoverIntervalTableMaster

スタミナ回復間隔テーブルマスターを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
recoverIntervalTableNamestring~ 128文字スタミナ回復間隔テーブル名

Result

説明
itemRecoverIntervalTableMasterスタミナ回復間隔テーブルマスター

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

updateRecoverIntervalTableMaster

スタミナ回復間隔テーブルマスターを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
recoverIntervalTableNamestring~ 128文字スタミナ回復間隔テーブル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
experienceModelIdstring~ 1024文字経験値モデルGRN
valuesList<int>1 ~ 1024 itemsランク毎のスタミナ回復間隔テーブル

Result

説明
itemRecoverIntervalTableMaster更新したスタミナ回復間隔テーブルマスター

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

deleteRecoverIntervalTableMaster

スタミナ回復間隔テーブルマスターを削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
recoverIntervalTableNamestring~ 128文字スタミナ回復間隔テーブル名

Result

説明
itemRecoverIntervalTableMaster削除したスタミナ回復間隔テーブルマスター

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

describeRecoverValueTableMasters

スタミナ回復量テーブルマスターの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<RecoverValueTableMaster>スタミナ回復量テーブルマスターのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(self::namespace1)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
            .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("namespace1")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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(self.hash1)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.describe_recover_value_table_masters({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createRecoverValueTableMaster

スタミナ回復量テーブルマスターを新規作成

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
namestring~ 128文字スタミナ回復量テーブル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
experienceModelIdstring~ 1024文字経験値モデルGRN
valuesList<int>1 ~ 1024 itemsランク毎のスタミナ回復量テーブル

Result

説明
itemRecoverValueTableMaster作成したスタミナ回復量テーブルマスター

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

getRecoverValueTableMaster

スタミナ回復量テーブルマスターを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
recoverValueTableNamestring~ 128文字スタミナ回復量テーブル名

Result

説明
itemRecoverValueTableMasterスタミナ回復量テーブルマスター

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

updateRecoverValueTableMaster

スタミナ回復量テーブルマスターを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
recoverValueTableNamestring~ 128文字スタミナ回復量テーブル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
experienceModelIdstring~ 1024文字経験値モデルGRN
valuesList<int>1 ~ 1024 itemsランク毎のスタミナ回復量テーブル

Result

説明
itemRecoverValueTableMaster更新したスタミナ回復量テーブルマスター

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

deleteRecoverValueTableMaster

スタミナ回復量テーブルマスターを削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
recoverValueTableNamestring~ 128文字スタミナ回復量テーブル名

Result

説明
itemRecoverValueTableMaster削除したスタミナ回復量テーブルマスター

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

exportMaster

現在有効なスタミナマスターのマスターデータをエクスポート

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名

Result

説明
itemCurrentStaminaMaster現在有効なスタミナマスター

実装例

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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
    );
    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("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
    );
    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(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.export_master({
    namespaceName="namespace1",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getCurrentStaminaMaster

現在有効なスタミナマスターを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名

Result

説明
itemCurrentStaminaMaster現在有効なスタミナマスター

実装例

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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
    );
    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("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
    );
    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(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.get_current_stamina_master({
    namespaceName="namespace1",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

updateCurrentStaminaMaster

現在有効なスタミナマスターを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
settingsstring~ 5242880文字マスターデータ

Result

説明
itemCurrentStaminaMaster更新した現在有効なスタミナマスター

実装例

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("namespace1"),
        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}"),
    }
)
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(self::namespace1)
            ->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}")
    );
    $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("namespace1")
            .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}")
    );
    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("namespace1")
        .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}"),
    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("namespace1")
            .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}")
    );
    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(self.hash1)
            .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}')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.update_current_stamina_master({
    namespaceName="namespace1",
    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}",
})

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

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
checkoutSettingGitHubCheckoutSettingGitHubからマスターデータをチェックアウトしてくる設定

Result

説明
itemCurrentStaminaMaster更新した現在有効なスタミナマスター

実装例

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("namespace1"),
        CheckoutSetting: &stamina.GitHubCheckoutSetting{
            ApiKeyId: pointy.String("$gitHubApiKey1.apiKeyId"),
            RepositoryName: pointy.String("gs2io/master-data"),
            SourcePath: pointy.String("path/to/file.json"),
            ReferenceType: pointy.String("branch"),
            BranchName: pointy.String("develop"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(self::namespace1)
            ->withCheckoutSetting((new GitHubCheckoutSetting())
                ->withApiKeyId(self::$gitHubApiKey1.apiKeyId)
                ->withRepositoryName("gs2io/master-data")
                ->withSourcePath("path/to/file.json")
                ->withReferenceType("branch")
                ->withBranchName("develop")
            )
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("$gitHubApiKey1.apiKeyId")
                .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("namespace1")
        .WithCheckoutSetting(new Gs2.Gs2Stamina.Model.GitHubCheckoutSetting()
            .WithApiKeyId("$gitHubApiKey1.apiKeyId")
            .WithRepositoryName("gs2io/master-data")
            .WithSourcePath("path/to/file.json")
            .WithReferenceType("branch")
            .WithBranchName("develop")
        ),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
            .withCheckoutSetting(new Gs2Stamina.model.GitHubCheckoutSetting()
                .withApiKeyId("$gitHubApiKey1.apiKeyId")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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(self.hash1)
            .with_checkout_setting(stamina.GitHubCheckoutSetting()
                .with_api_key_id(self.git_hub_api_key1.api_key_id)
                .with_repository_name('gs2io/master-data')
                .with_source_path('path/to/file.json')
                .with_reference_type('branch')
                .with_branch_name('develop')
            )
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.update_current_stamina_master_from_git_hub({
    namespaceName="namespace1",
    checkoutSetting={
        api_key_id="$gitHubApiKey1.apiKeyId",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

describeStaminaModels

スタミナモデルの一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名

Result

説明
itemsList<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("namespace2"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(self::namespace2)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace2")
    );
    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("namespace2"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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("namespace2")
    );
    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(self.hash2)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.describe_stamina_models({
    namespaceName="namespace2",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;

getStaminaModel

スタミナモデルを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデル名

Result

説明
itemStaminaModelスタミナモデル

実装例

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("namespace2"),
        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(self::namespace2)
            ->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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .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="namespace2",
    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;

describeStaminas

スタミナ一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
accessTokenstring~ 128文字ユーザーID
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数

Result

説明
itemsList<Stamina>スタミナのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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("namespace1"),
        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(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.describe_staminas({
    namespaceName="namespace1",
    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;

describeStaminasByUserId

ユーザIDを指定してスタミナ一覧を取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
userIdstring~ 128文字ユーザーID
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 1000データの取得件数
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemsList<Stamina>スタミナのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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("namespace2"),
        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(self::namespace2)
            ->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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .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="namespace2",
    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;

getStamina

スタミナを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
accessTokenstring~ 128文字ユーザーID

Result

説明
itemStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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("namespace1"),
        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(self::namespace1)
            ->withStaminaName("stamina-0001")
            ->withAccessToken(self::$accessToken0001)
    );
    $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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .with_stamina_name('stamina-0001')
            .with_access_token(self.access_token_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="namespace1",
    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;

getStaminaByUserId

ユーザIDを指定してスタミナを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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("namespace2"),
        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(self::namespace2)
            ->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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .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="namespace2",
    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;

updateStaminaByUserId

ユーザIDを指定してスタミナを作成・更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
userIdstring~ 128文字ユーザーID
valueint~ 2147483646スタミナ値
maxValueint1 ~ 2147483646スタミナの最大値
recoverIntervalMinutesint1 ~ 2147483646スタミナの回復間隔(分)
recoverValueint1 ~ 2147483646スタミナの回復量
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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("namespace2"),
        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(self::namespace2)
            ->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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .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="namespace2",
    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;

consumeStamina

スタミナを消費

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
accessTokenstring~ 128文字ユーザーID
consumeValueint1 ~ 2147483646消費するスタミナ量

Result

説明
itemStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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("namespace2"),
        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(self::namespace2)
            ->withStaminaName("stamina-0001")
            ->withAccessToken(self::$accessToken0001)
            ->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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .with_stamina_name('stamina-0001')
            .with_access_token(self.access_token_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="namespace2",
    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;

consumeStaminaByUserId

ユーザIDを指定してスタミナを消費

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
userIdstring~ 128文字ユーザーID
consumeValueint1 ~ 2147483646消費するスタミナ量
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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("namespace2"),
        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(self::namespace2)
            ->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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .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="namespace2",
    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;

recoverStaminaByUserId

ユーザIDを指定してスタミナを回復

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
userIdstring~ 128文字ユーザーID
recoverValueint1 ~ 2147483646スタミナの回復量
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemStaminaスタミナ
staminaModelStaminaModelスタミナモデル
overflowValueintスタミナ値の上限を超えて受け取れずに 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("namespace2"),
        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(self::namespace2)
            ->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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .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="namespace2",
    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;

raiseMaxValueByUserId

ユーザIDを指定してスタミナの最大値を加算

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
userIdstring~ 128文字ユーザーID
raiseValueint~ 2147483646上昇する最大スタミナ量
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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("namespace2"),
        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(self::namespace2)
            ->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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .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="namespace2",
    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;

decreaseMaxValueByUserId

ユーザIDを指定してスタミナの最大値を減算

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
userIdstring~ 128文字ユーザーID
decreaseValueint~ 2147483646減算する最大スタミナ量
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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("namespace2"),
        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(self::namespace2)
            ->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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .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="namespace2",
    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;

setMaxValueByUserId

ユーザIDを指定してスタミナの最大値を更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
userIdstring~ 128文字ユーザーID
maxValueint1 ~ 2147483646スタミナの最大値
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemStaminaスタミナ
oldStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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("namespace2"),
        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(self::namespace2)
            ->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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .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="namespace2",
    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;

setRecoverIntervalByUserId

ユーザIDを指定してスタミナの回復間隔(分)を更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
userIdstring~ 128文字ユーザーID
recoverIntervalMinutesint1 ~ 2147483646スタミナの回復間隔(分)
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemStaminaスタミナ
oldStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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("namespace2"),
        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(self::namespace2)
            ->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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .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="namespace2",
    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;

setRecoverValueByUserId

ユーザIDを指定してスタミナの回復量を設定

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
userIdstring~ 128文字ユーザーID
recoverValueint1 ~ 2147483646スタミナの回復量
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemStaminaスタミナ
oldStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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("namespace2"),
        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(self::namespace2)
            ->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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .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="namespace2",
    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;

setMaxValueByStatus

スタミナの最大値をGS2-Experienceのステータスを使用して更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
accessTokenstring~ 128文字ユーザーID
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024文字暗号鍵GRN
signedStatusBodystring~ 1048576文字署名対象の GS2-Experience ステータスのボディ
signedStatusSignaturestring~ 128文字GS2-Experience ステータスの署名

Result

説明
itemStaminaスタミナ
oldStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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("namespace2"),
        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(self::namespace2)
            ->withStaminaName("stamina-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withKeyId(self::key-0001)
            ->withSignedStatusBody(self::$statusBody)
            ->withSignedStatusSignature(self::$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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .with_stamina_name('stamina-0001')
            .with_access_token(self.access_token_0001)
            .with_key_id(self.key1.key_id)
            .with_signed_status_body(self.status_body)
            .with_signed_status_signature(self.status_signature)
    )
    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="namespace2",
    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;

setRecoverIntervalByStatus

スタミナの最大値をGS2-Experienceのステータスを使用して更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
accessTokenstring~ 128文字ユーザーID
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024文字暗号鍵GRN
signedStatusBodystring~ 1048576文字署名対象の GS2-Experience ステータスのボディ
signedStatusSignaturestring~ 128文字GS2-Experience ステータスの署名

Result

説明
itemStaminaスタミナ
oldStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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("namespace2"),
        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(self::namespace2)
            ->withStaminaName("stamina-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withKeyId(self::key-0001)
            ->withSignedStatusBody(self::$statusBody)
            ->withSignedStatusSignature(self::$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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .with_stamina_name('stamina-0001')
            .with_access_token(self.access_token_0001)
            .with_key_id(self.key1.key_id)
            .with_signed_status_body(self.status_body)
            .with_signed_status_signature(self.status_signature)
    )
    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="namespace2",
    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;

setRecoverValueByStatus

スタミナの回復量をGS2-Experienceのステータスを使用して更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
accessTokenstring~ 128文字ユーザーID
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024文字暗号鍵GRN
signedStatusBodystring~ 1048576文字署名対象の GS2-Experience ステータスのボディ
signedStatusSignaturestring~ 128文字GS2-Experience ステータスの署名

Result

説明
itemStaminaスタミナ
oldStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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("namespace2"),
        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(self::namespace2)
            ->withStaminaName("stamina-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withKeyId(self::key-0001)
            ->withSignedStatusBody(self::$statusBody)
            ->withSignedStatusSignature(self::$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("namespace2")
            .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("namespace2")
        .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("namespace2")
            .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(self.hash2)
            .with_stamina_name('stamina-0001')
            .with_access_token(self.access_token_0001)
            .with_key_id(self.key1.key_id)
            .with_signed_status_body(self.status_body)
            .with_signed_status_signature(self.status_signature)
    )
    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="namespace2",
    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;

deleteStaminaByUserId

ユーザIDを指定してスタミナを削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
staminaNamestring~ 128文字スタミナモデルの名前
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemStamina削除したスタミナ

実装例

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("namespace1"),
        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(self::namespace1)
            ->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("namespace1")
            .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("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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="namespace1",
    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;

recoverStaminaByStampSheet

スタンプシートを使用してスタミナを回復

Request

有効化条件必須デフォルト値の制限説明
stampSheetstring~ 5242880文字スタンプシート
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
itemStaminaスタミナ
staminaModelStaminaModelスタミナモデル
overflowValueintスタミナ値の上限を超えて受け取れずに 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.RecoverStaminaByStampSheet(
    &stamina.RecoverStaminaByStampSheetRequest {
        StampSheet: pointy.String("stampSheet"),
        KeyId: pointy.String("key-0001"),
    }
)
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\RecoverStaminaByStampSheetRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->recoverStaminaByStampSheet(
        (new RecoverStaminaByStampSheetRequest())
            ->withStampSheet(self::stampSheet)
            ->withKeyId(self::key-0001)
    );
    $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.RecoverStaminaByStampSheetRequest;
import io.gs2.stamina.result.RecoverStaminaByStampSheetResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    RecoverStaminaByStampSheetResult result = client.recoverStaminaByStampSheet(
        new RecoverStaminaByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    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.RecoverStaminaByStampSheetRequest;
using Gs2.Gs2Stamina.Result.RecoverStaminaByStampSheetResult;

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.RecoverStaminaByStampSheetResult> asyncResult = null;
yield return client.RecoverStaminaByStampSheet(
    new Gs2.Gs2Stamina.Request.RecoverStaminaByStampSheetRequest()
        .WithStampSheet("stampSheet")
        .WithKeyId("key-0001"),
    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.recoverStaminaByStampSheet(
        new Gs2Stamina.RecoverStaminaByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    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_stamp_sheet(
        stamina.RecoverStaminaByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    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_stamp_sheet({
    stampSheet="stampSheet",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
overflowValue = result.overflowValue;

raiseMaxValueByStampSheet

スタンプシートを使用してスタミナの最大値を加算

Request

有効化条件必須デフォルト値の制限説明
stampSheetstring~ 5242880文字スタンプシート
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
itemStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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.RaiseMaxValueByStampSheet(
    &stamina.RaiseMaxValueByStampSheetRequest {
        StampSheet: pointy.String("stampSheet"),
        KeyId: pointy.String("key-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\RaiseMaxValueByStampSheetRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->raiseMaxValueByStampSheet(
        (new RaiseMaxValueByStampSheetRequest())
            ->withStampSheet(self::stampSheet)
            ->withKeyId(self::key-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.RaiseMaxValueByStampSheetRequest;
import io.gs2.stamina.result.RaiseMaxValueByStampSheetResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    RaiseMaxValueByStampSheetResult result = client.raiseMaxValueByStampSheet(
        new RaiseMaxValueByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-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.RaiseMaxValueByStampSheetRequest;
using Gs2.Gs2Stamina.Result.RaiseMaxValueByStampSheetResult;

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.RaiseMaxValueByStampSheetResult> asyncResult = null;
yield return client.RaiseMaxValueByStampSheet(
    new Gs2.Gs2Stamina.Request.RaiseMaxValueByStampSheetRequest()
        .WithStampSheet("stampSheet")
        .WithKeyId("key-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.raiseMaxValueByStampSheet(
        new Gs2Stamina.RaiseMaxValueByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-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.raise_max_value_by_stamp_sheet(
        stamina.RaiseMaxValueByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    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_stamp_sheet({
    stampSheet="stampSheet",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;

decreaseMaxValueByStampTask

スタンプシートを使用してスタミナの最大値を減算

Request

有効化条件必須デフォルト値の制限説明
stampTaskstring~ 5242880文字スタンプタスク
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
itemStaminaスタミナ
staminaModelStaminaModelスタミナモデル
newContextStackstringスタンプタスクの実行結果を記録したコンテキスト

実装例

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.DecreaseMaxValueByStampTask(
    &stamina.DecreaseMaxValueByStampTaskRequest {
        StampTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\DecreaseMaxValueByStampTaskRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->decreaseMaxValueByStampTask(
        (new DecreaseMaxValueByStampTaskRequest())
            ->withStampTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.DecreaseMaxValueByStampTaskRequest;
import io.gs2.stamina.result.DecreaseMaxValueByStampTaskResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    DecreaseMaxValueByStampTaskResult result = client.decreaseMaxValueByStampTask(
        new DecreaseMaxValueByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.DecreaseMaxValueByStampTaskRequest;
using Gs2.Gs2Stamina.Result.DecreaseMaxValueByStampTaskResult;

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.DecreaseMaxValueByStampTaskResult> asyncResult = null;
yield return client.DecreaseMaxValueByStampTask(
    new Gs2.Gs2Stamina.Request.DecreaseMaxValueByStampTaskRequest()
        .WithStampTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
var newContextStack = result.NewContextStack;
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.decreaseMaxValueByStampTask(
        new Gs2Stamina.DecreaseMaxValueByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
    const newContextStack = result.getNewContextStack();
} 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_stamp_task(
        stamina.DecreaseMaxValueByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    stamina_model = result.stamina_model
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.decrease_max_value_by_stamp_task({
    stampTask="stampTask",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
newContextStack = result.newContextStack;

setMaxValueByStampSheet

スタンプシートを使用してスタミナの最大値を更新

Request

有効化条件必須デフォルト値の制限説明
stampSheetstring~ 5242880文字スタンプシート
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
itemStaminaスタミナ
oldStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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.SetMaxValueByStampSheet(
    &stamina.SetMaxValueByStampSheetRequest {
        StampSheet: pointy.String("stampSheet"),
        KeyId: pointy.String("key-0001"),
    }
)
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\SetMaxValueByStampSheetRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->setMaxValueByStampSheet(
        (new SetMaxValueByStampSheetRequest())
            ->withStampSheet(self::stampSheet)
            ->withKeyId(self::key-0001)
    );
    $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.SetMaxValueByStampSheetRequest;
import io.gs2.stamina.result.SetMaxValueByStampSheetResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    SetMaxValueByStampSheetResult result = client.setMaxValueByStampSheet(
        new SetMaxValueByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    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.SetMaxValueByStampSheetRequest;
using Gs2.Gs2Stamina.Result.SetMaxValueByStampSheetResult;

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.SetMaxValueByStampSheetResult> asyncResult = null;
yield return client.SetMaxValueByStampSheet(
    new Gs2.Gs2Stamina.Request.SetMaxValueByStampSheetRequest()
        .WithStampSheet("stampSheet")
        .WithKeyId("key-0001"),
    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.setMaxValueByStampSheet(
        new Gs2Stamina.SetMaxValueByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    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_stamp_sheet(
        stamina.SetMaxValueByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    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_stamp_sheet({
    stampSheet="stampSheet",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;

setRecoverIntervalByStampSheet

スタンプシートを使用してスタミナの最大値を更新

Request

有効化条件必須デフォルト値の制限説明
stampSheetstring~ 5242880文字スタンプシート
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
itemStaminaスタミナ
oldStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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.SetRecoverIntervalByStampSheet(
    &stamina.SetRecoverIntervalByStampSheetRequest {
        StampSheet: pointy.String("stampSheet"),
        KeyId: pointy.String("key-0001"),
    }
)
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\SetRecoverIntervalByStampSheetRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->setRecoverIntervalByStampSheet(
        (new SetRecoverIntervalByStampSheetRequest())
            ->withStampSheet(self::stampSheet)
            ->withKeyId(self::key-0001)
    );
    $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.SetRecoverIntervalByStampSheetRequest;
import io.gs2.stamina.result.SetRecoverIntervalByStampSheetResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    SetRecoverIntervalByStampSheetResult result = client.setRecoverIntervalByStampSheet(
        new SetRecoverIntervalByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    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.SetRecoverIntervalByStampSheetRequest;
using Gs2.Gs2Stamina.Result.SetRecoverIntervalByStampSheetResult;

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.SetRecoverIntervalByStampSheetResult> asyncResult = null;
yield return client.SetRecoverIntervalByStampSheet(
    new Gs2.Gs2Stamina.Request.SetRecoverIntervalByStampSheetRequest()
        .WithStampSheet("stampSheet")
        .WithKeyId("key-0001"),
    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.setRecoverIntervalByStampSheet(
        new Gs2Stamina.SetRecoverIntervalByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    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_stamp_sheet(
        stamina.SetRecoverIntervalByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    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_stamp_sheet({
    stampSheet="stampSheet",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;

setRecoverValueByStampSheet

スタンプシートを使用してスタミナの回復量を更新

Request

有効化条件必須デフォルト値の制限説明
stampSheetstring~ 5242880文字スタンプシート
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
itemStaminaスタミナ
oldStaminaスタミナ
staminaModelStaminaModelスタミナモデル

実装例

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.SetRecoverValueByStampSheet(
    &stamina.SetRecoverValueByStampSheetRequest {
        StampSheet: pointy.String("stampSheet"),
        KeyId: pointy.String("key-0001"),
    }
)
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\SetRecoverValueByStampSheetRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->setRecoverValueByStampSheet(
        (new SetRecoverValueByStampSheetRequest())
            ->withStampSheet(self::stampSheet)
            ->withKeyId(self::key-0001)
    );
    $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.SetRecoverValueByStampSheetRequest;
import io.gs2.stamina.result.SetRecoverValueByStampSheetResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    SetRecoverValueByStampSheetResult result = client.setRecoverValueByStampSheet(
        new SetRecoverValueByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    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.SetRecoverValueByStampSheetRequest;
using Gs2.Gs2Stamina.Result.SetRecoverValueByStampSheetResult;

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.SetRecoverValueByStampSheetResult> asyncResult = null;
yield return client.SetRecoverValueByStampSheet(
    new Gs2.Gs2Stamina.Request.SetRecoverValueByStampSheetRequest()
        .WithStampSheet("stampSheet")
        .WithKeyId("key-0001"),
    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.setRecoverValueByStampSheet(
        new Gs2Stamina.SetRecoverValueByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    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_stamp_sheet(
        stamina.SetRecoverValueByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    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_stamp_sheet({
    stampSheet="stampSheet",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
old = result.old;
staminaModel = result.staminaModel;

consumeStaminaByStampTask

スタンプタスクを使用してスタミナを消費

Request

有効化条件必須デフォルト値の制限説明
stampTaskstring~ 5242880文字スタンプタスク
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
itemStaminaスタミナ
staminaModelStaminaModelスタミナモデル
newContextStackstringスタンプタスクの実行結果を記録したコンテキスト

実装例

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.ConsumeStaminaByStampTask(
    &stamina.ConsumeStaminaByStampTaskRequest {
        StampTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
staminaModel := result.StaminaModel
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Stamina\Gs2StaminaRestClient;
use Gs2\Stamina\Request\ConsumeStaminaByStampTaskRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->consumeStaminaByStampTask(
        (new ConsumeStaminaByStampTaskRequest())
            ->withStampTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $item = $result->getItem();
    $staminaModel = $result->getStaminaModel();
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.stamina.rest.Gs2StaminaRestClient;
import io.gs2.stamina.request.ConsumeStaminaByStampTaskRequest;
import io.gs2.stamina.result.ConsumeStaminaByStampTaskResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2StaminaRestClient client = new Gs2StaminaRestClient(session);

try {
    ConsumeStaminaByStampTaskResult result = client.consumeStaminaByStampTask(
        new ConsumeStaminaByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    Stamina item = result.getItem();
    StaminaModel staminaModel = result.getStaminaModel();
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Stamina.Gs2StaminaRestClient;
using Gs2.Gs2Stamina.Request.ConsumeStaminaByStampTaskRequest;
using Gs2.Gs2Stamina.Result.ConsumeStaminaByStampTaskResult;

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.ConsumeStaminaByStampTaskResult> asyncResult = null;
yield return client.ConsumeStaminaByStampTask(
    new Gs2.Gs2Stamina.Request.ConsumeStaminaByStampTaskRequest()
        .WithStampTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var staminaModel = result.StaminaModel;
var newContextStack = result.NewContextStack;
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.consumeStaminaByStampTask(
        new Gs2Stamina.ConsumeStaminaByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    const item = result.getItem();
    const staminaModel = result.getStaminaModel();
    const newContextStack = result.getNewContextStack();
} 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_stamp_task(
        stamina.ConsumeStaminaByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    stamina_model = result.stamina_model
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('stamina')

api_result = client.consume_stamina_by_stamp_task({
    stampTask="stampTask",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
staminaModel = result.staminaModel;
newContextStack = result.newContextStack;