GS2-Stamina SDK API リファレンス

モデル

Namespace

ネームスペース

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

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

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字ネームスペースGRN
namestring~ 128文字ネームスペース名
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~ 128文字ネームスペース名
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~ 128文字ネームスペース名

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~ 128文字ネームスペース名

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~ 128文字ネームスペース名
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~ 128文字ネームスペース名

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~ 128文字ネームスペース名
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~ 128文字ネームスペース名
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~ 128文字ネームスペース名
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~ 128文字ネームスペース名
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~ 128文字ネームスペース名
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~ 128文字ネームスペース名
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~ 128文字ネームスペース名
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,