GS2-Inventory SDK API リファレンス

モデル

Namespace

ネームスペース

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

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

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字ネームスペースGRN
namestring~ 128文字ネームスペース名
descriptionstring~ 1024文字説明文
acquireScriptScriptSettingアイテムを入手したときに実行するスクリプト
overflowScriptScriptSetting入手上限に当たって入手できなかったときに実行するスクリプト
consumeScriptScriptSettingアイテムを消費するときに実行するスクリプト
simpleItemAcquireScriptScriptSettingシンプルアイテムを入手したときに実行するスクリプト
simpleItemConsumeScriptScriptSettingシンプルアイテムを消費するときに実行するスクリプト
bigItemAcquireScriptScriptSetting巨大アイテムを入手したときに実行するスクリプト
bigItemConsumeScriptScriptSetting巨大アイテムを消費するときに実行するスクリプト
logSettingLogSettingログの出力設定
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

InventoryModelMaster

インベントリモデルマスター

インベントリはゲームプレイヤーが所有しているアイテムを格納する鞄のようなものです。
インベントリには容量が設定でき、容量を超えては所有できません。

有効化条件必須デフォルト値の制限説明
inventoryModelIdstring~ 1024文字インベントリモデルマスターGRN
namestring~ 128文字インベントリモデル名
metadatastring~ 128文字メタデータ
descriptionstring~ 1024文字説明文
initialCapacityint~ 2147483646初期サイズ
maxCapacityint~ 2147483646最大サイズ
protectReferencedItemboolfalse参照元が登録されているアイテムセットは削除できなくする
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

InventoryModel

インベントリモデル

インベントリはゲームプレイヤーが所有しているアイテムを格納するカバンのようなものです。
インベントリには容量が設定でき、容量を超えては所有できません。

有効化条件必須デフォルト値の制限説明
inventoryModelIdstring~ 1024文字インベントリモデルGRN
namestring~ 128文字インベントリモデル名
metadatastring~ 128文字メタデータ
initialCapacityint~ 2147483646初期サイズ
maxCapacityint~ 2147483646最大サイズ
protectReferencedItembool?false参照元が登録されているアイテムセットは削除できなくする
itemModelsList<ItemModel>1 ~ 1000 itemsインベントリに格納可能なアイテムモデル一覧

ItemModelMaster

アイテムモデルマスター

アイテムは ポーション×99 のようにインベントリの1容量に対して複数所有できます。
1容量で複数所有している状態を アイテムをスタック する。と呼び、アイテムごとにスタックできる最大数量を指定できます。

スタックできる最大数量に達したとき、新しくインベントリの容量を確保して所有することができるか、入手することが出来なくなるかをアイテムごとに設定できます。

有効化条件必須デフォルト値の制限説明
itemModelIdstring~ 1024文字アイテムモデルマスターGRN
inventoryNamestring~ 128文字インベントリモデル名
namestring~ 128文字アイテムモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
stackingLimitlong1 ~ 9223372036854775805スタック可能な最大数量
allowMultipleStacksboolスタック可能な最大数量を超えた時複数枠にアイテムを保管することを許すか
sortValueint~ 2147483646表示順番
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

ItemModel

アイテムモデル

アイテムは ポーション×99 のようにインベントリの1容量に対して複数所有できます。
1容量で複数所有している状態を アイテムをスタック する。と呼び、アイテムごとにスタックできる最大数量を指定できます。

スタックできる最大数量に達したとき、新しくインベントリの容量を確保して所有することができるか、入手することが出来なくなるかをアイテムごとに設定できます。

有効化条件必須デフォルト値の制限説明
itemModelIdstring~ 1024文字アイテムモデルGRN
namestring~ 128文字アイテムモデル名
metadatastring~ 128文字メタデータ
stackingLimitlong1 ~ 9223372036854775805スタック可能な最大数量
allowMultipleStacksboolスタック可能な最大数量を超えた時複数枠にアイテムを保管することを許すか
sortValueint~ 2147483646表示順番

SimpleInventoryModelMaster

シンプルインベントリモデル

通常の InventoryModel では、インベントリ内に格納できるアイテムの容量制限ができました。
しかし、シンプルインベントリ ではそのような機能はなく、単純にアイテムの所持数量を保持するのみとなります。

ただし、シンプルインベントリでは、複数のアイテムの増減処理を1回の処理で実行可能なAPIが利用できます。

有効化条件必須デフォルト値の制限説明
inventoryModelIdstring~ 1024文字シンプルインベントリモデルマスターGRN
namestring~ 128文字シンプルインベントリモデル名
metadatastring~ 128文字メタデータ
descriptionstring~ 1024文字説明文
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

SimpleInventoryModel

シンプルインベントリモデル

通常の InventoryModel では、インベントリ内に格納できるアイテムの容量制限ができました。
しかし、シンプルインベントリ ではそのような機能はなく、単純にアイテムの所持数量を保持するのみとなります。

ただし、シンプルインベントリでは、複数のアイテムの増減処理を1回の処理で実行可能なAPIが利用できます。

有効化条件必須デフォルト値の制限説明
inventoryModelIdstring~ 1024文字シンプルインベントリモデルGRN
namestring~ 128文字シンプルインベントリモデル名
metadatastring~ 128文字メタデータ
simpleItemModelsList<SimpleItemModel>1 ~ 1000 itemsインベントリに格納可能なシンプルアイテムモデル一覧

SimpleItemModelMaster

シンプルアイテムモデルマスター

通常の ItemModel では、スタックできる数量の最大値を設定でき、一定数を超える場合は複数のスタックに分けるような実装が可能でした。
しかし、シンプルアイテム ではそのような機能はなく、単純にアイテムの所持数量を保持するのみとなります。

有効化条件必須デフォルト値の制限説明
itemModelIdstring~ 1024文字シンプルアイテムモデルマスターGRN
namestring~ 128文字シンプルアイテムモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

SimpleItemModel

シンプルアイテムモデル

通常の ItemModel では、スタックできる数量の最大値を設定でき、一定数を超える場合は複数のスタックに分けるような実装が可能でした。
しかし、シンプルアイテム ではそのような機能はなく、単純にアイテムの所持数量を保持するのみとなります。

有効化条件必須デフォルト値の制限説明
itemModelIdstring~ 1024文字シンプルアイテムモデルGRN
namestring~ 128文字シンプルアイテムモデル名
metadatastring~ 128文字メタデータ

BigInventoryModelMaster

巨大インベントリモデル

通常の InventoryModel や SimpleInventoryModel では、インベントリに格納できるアイテムの数は 64bit 整数値の範囲に限られました。
インフレ系ゲームでは、もっと広い値の範囲を必要とする場合があります。

巨大インベントリモデルでは、インベントリに格納できるアイテムの数には1024桁の整数値を持たせることができます。

有効化条件必須デフォルト値の制限説明
inventoryModelIdstring~ 1024文字巨大インベントリモデルマスターGRN
namestring~ 128文字巨大インベントリモデル名
metadatastring~ 128文字メタデータ
descriptionstring~ 1024文字説明文
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

BigInventoryModel

巨大インベントリモデル

通常の InventoryModel や SimpleInventoryModel では、インベントリに格納できるアイテムの数は 64bit 整数値の範囲に限られました。
インフレ系ゲームでは、もっと広い値の範囲を必要とする場合があります。

巨大インベントリモデルでは、インベントリに格納できるアイテムの数には1024桁の整数値を持たせることができます。

有効化条件必須デフォルト値の制限説明
inventoryModelIdstring~ 1024文字巨大インベントリモデルGRN
namestring~ 128文字巨大インベントリモデル名
metadatastring~ 128文字メタデータ
bigItemModelsList<BigItemModel>1 ~ 1000 itemsインベントリに格納可能な巨大アイテムモデル一覧

BigItemModelMaster

巨大アイテムモデルマスター

通常の ItemModel では、スタックできる数量の最大値を設定でき、一定数を超える場合は複数のスタックに分けるような実装が可能でした。
しかし、巨大アイテム ではそのような機能はなく、単純にアイテムの所持数量を保持するのみとなります。

有効化条件必須デフォルト値の制限説明
itemModelIdstring~ 1024文字巨大アイテムモデルマスターGRN
namestring~ 128文字巨大アイテムモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

BigItemModel

巨大アイテムモデル

通常の ItemModel では、スタックできる数量の最大値を設定でき、一定数を超える場合は複数のスタックに分けるような実装が可能でした。
しかし、巨大アイテム ではそのような機能はなく、単純にアイテムの所持数量を保持するのみとなります。

有効化条件必須デフォルト値の制限説明
itemModelIdstring~ 1024文字巨大アイテムモデルGRN
namestring~ 128文字巨大アイテムモデル名
metadatastring~ 128文字メタデータ

CurrentItemModelMaster

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

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

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

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

Inventory

インベントリ

インベントリはゲームプレイヤーが所有しているアイテムを格納するカバンのようなものです。
カバンには容量があり、プレイヤーごとに容量を拡張することができます。

有効化条件必須デフォルト値の制限説明
inventoryIdstring~ 1024文字インベントリGRN
inventoryNamestring~ 128文字インベントリモデル名
userIdstring~ 128文字ユーザーID
currentInventoryCapacityUsageint0~ 2147483646キャパシティ使用量
currentInventoryMaxCapacityint1 ~ 2147483646最大キャパシティ
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

ItemSet

アイテムセット

アイテムセットはゲームプレイヤーのインベントリー内に保存されている所有物を表しています。
アイテムモデルと所持数量を持ちます。

有効化条件必須デフォルト値の制限説明
itemSetIdstring~ 1024文字有効期限ごとのアイテム所持数量GRN
namestringUUID~ 36文字アイテムセットを識別する名前
inventoryNamestring~ 128文字インベントリモデルの名前
userIdstring~ 128文字ユーザーID
itemNamestring~ 128文字アイテムモデルの名前
countlong1 ~ 9223372036854775805所持数量
referenceOfList<string>[]~ 24 itemsこの所持品の参照元リスト
sortValueint~ 2147483646表示順番
expiresAtlong0有効期限 (UNIX時間 単位:ミリ秒)
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)

ReferenceOf

所持品の参照元

有効化条件必須デフォルト値の制限説明
referenceOfIdstring~ 1024文字参照GRN
namestring~ 128文字アイテムセットを識別する名前

SimpleInventory

シンプルインベントリ

シンプルインベントリはゲームプレイヤーが所有しているシンプルアイテムを格納するカバンのようなものです。
シンプルインベントリにはアイテム所持数の上限やインベントリの容量といった機能はありませんが、複数のアイテムをまとめて増減することができます。

有効化条件必須デフォルト値の制限説明
inventoryIdstring~ 1024文字シンプルインベントリGRN
inventoryNamestring~ 128文字シンプルインベントリモデル名
userIdstring~ 128文字ユーザーID
simpleItemsList<SimpleItem>~ 1000 itemsシンプルアイテム一覧
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

SimpleItem

シンプルアイテム

シンプルアイテムはゲームプレイヤーのインベントリー内に保存されている所有物を表しています。
シンプルアイテムモデル名と所持数量を持ちます。

有効化条件必須デフォルト値の制限説明
itemIdstring~ 1024文字アイテム所持数量GRN
userIdstring~ 128文字ユーザーID
itemNamestring~ 128文字シンプルアイテムモデルの名前
countlong1 ~ 9223372036854775805所持数量
revisionlong0~ 9223372036854775805リビジョン

BigInventory

巨大インベントリ

巨大インベントリはゲームプレイヤーが所有している巨大アイテムを格納するカバンのようなものです。
巨大インベントリはアイテムの所持数量をint64の範囲を超えて保持できるインベントリです。

有効化条件必須デフォルト値の制限説明
inventoryIdstring~ 1024文字巨大インベントリGRN
inventoryNamestring~ 128文字巨大インベントリモデル名
userIdstring~ 128文字ユーザーID
bigItemsList<BigItem>~ 1000 items巨大アイテム一覧
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)

BigItem

巨大アイテム

巨大アイテムはゲームプレイヤーの巨大インベントリー内に保存されている所有物を表しています。
巨大アイテムモデル名と、所持数量をint64の範囲を超えて保持できます。

有効化条件必須デフォルト値の制限説明
itemIdstring~ 1024文字アイテム所持数量GRN
userIdstring~ 128文字ユーザーID
itemNamestring~ 128文字巨大アイテムモデルの名前
countstring~ 1024文字所持数量
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
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文字タグ名

referenceType に指定する列挙型の定義

定義説明
commit_hashコミットハッシュ
branchブランチ
tagタグ

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

doneTriggerTargetType に指定する列挙型の定義

定義説明
noneなし
gs2_scriptGS2-Script
awsAmazon EventBridge

LogSetting

ログの書き出し設定

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

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

AcquireCount

シンプルアイテムの入手数量

有効化条件必須デフォルト値の制限説明
itemNamestring~ 128文字シンプルアイテムモデルの名前
countlong1 ~ 9223372036854775805入手する量

ConsumeCount

シンプルアイテムの消費数量

有効化条件必須デフォルト値の制限説明
itemNamestring~ 128文字シンプルアイテムモデルの名前
countlong1 ~ 9223372036854775805消費する量

HeldCount

シンプルアイテムの所持数量

有効化条件必須デフォルト値の制限説明
itemNamestring~ 128文字シンプルアイテムモデルの名前
countlong~ 9223372036854775805所持数量

メソッド

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/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeNamespacesRequest;
import io.gs2.inventory.result.DescribeNamespacesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeNamespacesRequest;
using Gs2.Gs2Inventory.Result.DescribeNamespacesResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.describeNamespaces(
        new Gs2Inventory.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 inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.describe_namespaces(
        inventory.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('inventory')

api_result = client.describe_namespaces({
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('inventory')

api_result_handler = client.describe_namespaces_async({
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

createNamespace

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

Request

有効化条件必須デフォルト値の制限説明
namestring~ 128文字ネームスペース名
descriptionstring~ 1024文字説明文
acquireScriptScriptSettingアイテムを入手したときに実行するスクリプト
overflowScriptScriptSetting入手上限に当たって入手できなかったときに実行するスクリプト
consumeScriptScriptSettingアイテムを消費するときに実行するスクリプト
simpleItemAcquireScriptScriptSettingシンプルアイテムを入手したときに実行するスクリプト
simpleItemConsumeScriptScriptSettingシンプルアイテムを消費するときに実行するスクリプト
bigItemAcquireScriptScriptSetting巨大アイテムを入手したときに実行するスクリプト
bigItemConsumeScriptScriptSetting巨大アイテムを消費するときに実行するスクリプト
logSettingLogSettingログの出力設定

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &inventory.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        AcquireScript: nil,
        OverflowScript: nil,
        ConsumeScript: nil,
        SimpleItemAcquireScript: nil,
        SimpleItemConsumeScript: nil,
        BigItemAcquireScript: nil,
        BigItemConsumeScript: nil,
        LogSetting: &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\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)
            ->withAcquireScript(null)
            ->withOverflowScript(null)
            ->withConsumeScript(null)
            ->withSimpleItemAcquireScript(null)
            ->withSimpleItemConsumeScript(null)
            ->withBigItemAcquireScript(null)
            ->withBigItemConsumeScript(null)
            ->withLogSetting((new \Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateNamespaceRequest;
import io.gs2.inventory.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withAcquireScript(null)
            .withOverflowScript(null)
            .withConsumeScript(null)
            .withSimpleItemAcquireScript(null)
            .withSimpleItemConsumeScript(null)
            .withBigItemAcquireScript(null)
            .withBigItemConsumeScript(null)
            .withLogSetting(new io.gs2.inventory.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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CreateNamespaceRequest;
using Gs2.Gs2Inventory.Result.CreateNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Inventory.Request.CreateNamespaceRequest()
        .WithName("namespace1")
        .WithDescription(null)
        .WithAcquireScript(null)
        .WithOverflowScript(null)
        .WithConsumeScript(null)
        .WithSimpleItemAcquireScript(null)
        .WithSimpleItemConsumeScript(null)
        .WithBigItemAcquireScript(null)
        .WithBigItemConsumeScript(null)
        .WithLogSetting(new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.createNamespace(
        new Gs2Inventory.CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withAcquireScript(null)
            .withOverflowScript(null)
            .withConsumeScript(null)
            .withSimpleItemAcquireScript(null)
            .withSimpleItemConsumeScript(null)
            .withBigItemAcquireScript(null)
            .withBigItemConsumeScript(null)
            .withLogSetting(new Gs2Inventory.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 inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.create_namespace(
        inventory.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_acquire_script(None)
            .with_overflow_script(None)
            .with_consume_script(None)
            .with_simple_item_acquire_script(None)
            .with_simple_item_consume_script(None)
            .with_big_item_acquire_script(None)
            .with_big_item_consume_script(None)
            .with_log_setting(
                inventory.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('inventory')

api_result = client.create_namespace({
    name="namespace1",
    description=nil,
    acquireScript=nil,
    overflowScript=nil,
    consumeScript=nil,
    simpleItemAcquireScript=nil,
    simpleItemConsumeScript=nil,
    bigItemAcquireScript=nil,
    bigItemConsumeScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

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

result = api_result.result
item = result.item;
client = gs2('inventory')

api_result_handler = client.create_namespace_async({
    name="namespace1",
    description=nil,
    acquireScript=nil,
    overflowScript=nil,
    consumeScript=nil,
    simpleItemAcquireScript=nil,
    simpleItemConsumeScript=nil,
    bigItemAcquireScript=nil,
    bigItemConsumeScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

getNamespaceStatus

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

Request

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

Result

説明
statusstring

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetNamespaceStatusRequest;
import io.gs2.inventory.result.GetNamespaceStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Inventory.Result.GetNamespaceStatusResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.getNamespaceStatus(
        new Gs2Inventory.GetNamespaceStatusRequest()
            .withNamespaceName("namespace1")
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.get_namespace_status(
        inventory.GetNamespaceStatusRequest()
            .with_namespace_name(self.hash1)
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

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

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

result = api_result.result
status = result.status;
client = gs2('inventory')

api_result_handler = client.get_namespace_status_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
status = result.status;

getNamespace

ネームスペースを取得

Request

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

Result

説明
itemNamespaceネームスペース

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetNamespaceRequest;
import io.gs2.inventory.result.GetNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetNamespaceRequest;
using Gs2.Gs2Inventory.Result.GetNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.getNamespace(
        new Gs2Inventory.GetNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.get_namespace(
        inventory.GetNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

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

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

result = api_result.result
item = result.item;
client = gs2('inventory')

api_result_handler = client.get_namespace_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

updateNamespace

ネームスペースを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
descriptionstring~ 1024文字説明文
acquireScriptScriptSettingアイテムを入手したときに実行するスクリプト
overflowScriptScriptSetting入手上限に当たって入手できなかったときに実行するスクリプト
consumeScriptScriptSettingアイテムを消費するときに実行するスクリプト
simpleItemAcquireScriptScriptSettingシンプルアイテムを入手したときに実行するスクリプト
simpleItemConsumeScriptScriptSettingシンプルアイテムを消費するときに実行するスクリプト
bigItemAcquireScriptScriptSetting巨大アイテムを入手したときに実行するスクリプト
bigItemConsumeScriptScriptSetting巨大アイテムを消費するときに実行するスクリプト
logSettingLogSettingログの出力設定

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &inventory.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        AcquireScript: &inventory.ScriptSetting{
            TriggerScriptId: pointy.String("script-1001"),
            DoneTriggerScriptId: pointy.String("script-1002"),
            DoneTriggerQueueNamespaceId: pointy.String("namespace-1001"),
        },
        OverflowScript: &inventory.ScriptSetting{
            DoneTriggerScriptId: pointy.String("script-1003"),
            DoneTriggerQueueNamespaceId: pointy.String("script-1004"),
        },
        ConsumeScript: &inventory.ScriptSetting{
            TriggerScriptId: pointy.String("script-1005"),
            DoneTriggerScriptId: pointy.String("script-1006"),
            DoneTriggerQueueNamespaceId: pointy.String("namespace-1001"),
        },
        SimpleItemAcquireScript: nil,
        SimpleItemConsumeScript: nil,
        BigItemAcquireScript: nil,
        BigItemConsumeScript: nil,
        LogSetting: &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\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")
            ->withAcquireScript((new \Gs2\Inventory\Model\ScriptSetting())
                ->withTriggerScriptId("script-1001")
                ->withDoneTriggerScriptId("script-1002")
                ->withDoneTriggerQueueNamespaceId("namespace-1001"))
            ->withOverflowScript((new \Gs2\Inventory\Model\ScriptSetting())
                ->withDoneTriggerScriptId("script-1003")
                ->withDoneTriggerQueueNamespaceId("script-1004"))
            ->withConsumeScript((new \Gs2\Inventory\Model\ScriptSetting())
                ->withTriggerScriptId("script-1005")
                ->withDoneTriggerScriptId("script-1006")
                ->withDoneTriggerQueueNamespaceId("namespace-1001"))
            ->withSimpleItemAcquireScript(null)
            ->withSimpleItemConsumeScript(null)
            ->withBigItemAcquireScript(null)
            ->withBigItemConsumeScript(null)
            ->withLogSetting((new \Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateNamespaceRequest;
import io.gs2.inventory.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withAcquireScript(new io.gs2.inventory.model.ScriptSetting()
                .withTriggerScriptId("script-1001")
                .withDoneTriggerScriptId("script-1002")
                .withDoneTriggerQueueNamespaceId("namespace-1001"))
            .withOverflowScript(new io.gs2.inventory.model.ScriptSetting()
                .withDoneTriggerScriptId("script-1003")
                .withDoneTriggerQueueNamespaceId("script-1004"))
            .withConsumeScript(new io.gs2.inventory.model.ScriptSetting()
                .withTriggerScriptId("script-1005")
                .withDoneTriggerScriptId("script-1006")
                .withDoneTriggerQueueNamespaceId("namespace-1001"))
            .withSimpleItemAcquireScript(null)
            .withSimpleItemConsumeScript(null)
            .withBigItemAcquireScript(null)
            .withBigItemConsumeScript(null)
            .withLogSetting(new io.gs2.inventory.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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.UpdateNamespaceRequest;
using Gs2.Gs2Inventory.Result.UpdateNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Inventory.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace1")
        .WithDescription("description1")
        .WithAcquireScript(new Gs2.Gs2Inventory.Model.ScriptSetting()
            .WithTriggerScriptId("script-1001")
            .WithDoneTriggerScriptId("script-1002")
            .WithDoneTriggerQueueNamespaceId("namespace-1001"))
        .WithOverflowScript(new Gs2.Gs2Inventory.Model.ScriptSetting()
            .WithDoneTriggerScriptId("script-1003")
            .WithDoneTriggerQueueNamespaceId("script-1004"))
        .WithConsumeScript(new Gs2.Gs2Inventory.Model.ScriptSetting()
            .WithTriggerScriptId("script-1005")
            .WithDoneTriggerScriptId("script-1006")
            .WithDoneTriggerQueueNamespaceId("namespace-1001"))
        .WithSimpleItemAcquireScript(null)
        .WithSimpleItemConsumeScript(null)
        .WithBigItemAcquireScript(null)
        .WithBigItemConsumeScript(null)
        .WithLogSetting(new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.updateNamespace(
        new Gs2Inventory.UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withAcquireScript(new Gs2Inventory.model.ScriptSetting()
                .withTriggerScriptId("script-1001")
                .withDoneTriggerScriptId("script-1002")
                .withDoneTriggerQueueNamespaceId("namespace-1001"))
            .withOverflowScript(new Gs2Inventory.model.ScriptSetting()
                .withDoneTriggerScriptId("script-1003")
                .withDoneTriggerQueueNamespaceId("script-1004"))
            .withConsumeScript(new Gs2Inventory.model.ScriptSetting()
                .withTriggerScriptId("script-1005")
                .withDoneTriggerScriptId("script-1006")
                .withDoneTriggerQueueNamespaceId("namespace-1001"))
            .withSimpleItemAcquireScript(null)
            .withSimpleItemConsumeScript(null)
            .withBigItemAcquireScript(null)
            .withBigItemConsumeScript(null)
            .withLogSetting(new Gs2Inventory.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 inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.update_namespace(
        inventory.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_acquire_script(
                inventory.ScriptSetting()
                    .with_trigger_script_id('script-1001')
                    .with_done_trigger_script_id('script-1002')
                    .with_done_trigger_queue_namespace_id('namespace-1001'))
            .with_overflow_script(
                inventory.ScriptSetting()
                    .with_done_trigger_script_id('script-1003')
                    .with_done_trigger_queue_namespace_id('script-1004'))
            .with_consume_script(
                inventory.ScriptSetting()
                    .with_trigger_script_id('script-1005')
                    .with_done_trigger_script_id('script-1006')
                    .with_done_trigger_queue_namespace_id('namespace-1001'))
            .with_simple_item_acquire_script(None)
            .with_simple_item_consume_script(None)
            .with_big_item_acquire_script(None)
            .with_big_item_consume_script(None)
            .with_log_setting(
                inventory.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('inventory')

api_result = client.update_namespace({
    namespaceName="namespace1",
    description="description1",
    acquireScript={
        triggerScriptId="script-1001",
        doneTriggerScriptId="script-1002",
        doneTriggerQueueNamespaceId="namespace-1001",
    },
    overflowScript={
        doneTriggerScriptId="script-1003",
        doneTriggerQueueNamespaceId="script-1004",
    },
    consumeScript={
        triggerScriptId="script-1005",
        doneTriggerScriptId="script-1006",
        doneTriggerQueueNamespaceId="namespace-1001",
    },
    simpleItemAcquireScript=nil,
    simpleItemConsumeScript=nil,
    bigItemAcquireScript=nil,
    bigItemConsumeScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

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

result = api_result.result
item = result.item;
client = gs2('inventory')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace1",
    description="description1",
    acquireScript={
        triggerScriptId="script-1001",
        doneTriggerScriptId="script-1002",
        doneTriggerQueueNamespaceId="namespace-1001",
    },
    overflowScript={
        doneTriggerScriptId="script-1003",
        doneTriggerQueueNamespaceId="script-1004",
    },
    consumeScript={
        triggerScriptId="script-1005",
        doneTriggerScriptId="script-1006",
        doneTriggerQueueNamespaceId="namespace-1001",
    },
    simpleItemAcquireScript=nil,
    simpleItemConsumeScript=nil,
    bigItemAcquireScript=nil,
    bigItemConsumeScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

deleteNamespace

ネームスペースを削除

Request

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

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteNamespaceRequest;
import io.gs2.inventory.result.DeleteNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteNamespaceRequest;
using Gs2.Gs2Inventory.Result.DeleteNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.deleteNamespace(
        new Gs2Inventory.DeleteNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.delete_namespace(
        inventory.DeleteNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

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

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

result = api_result.result
item = result.item;
client = gs2('inventory')

api_result_handler = client.delete_namespace_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

dumpUserDataByUserId

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

Request

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

Result

説明

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DumpUserDataByUserIdRequest;
import io.gs2.inventory.result.DumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Inventory.Result.DumpUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.dumpUserDataByUserId(
        new Gs2Inventory.DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.dump_user_data_by_user_id(
        inventory.DumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
client = gs2('inventory')

api_result_handler = client.dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result

checkDumpUserDataByUserId

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

Request

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

Result

説明
urlstring出力データのURL

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.inventory.result.CheckDumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Inventory.Result.CheckDumpUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.checkDumpUserDataByUserId(
        new Gs2Inventory.CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.check_dump_user_data_by_user_id(
        inventory.CheckDumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.check_dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
url = result.url;
client = gs2('inventory')

api_result_handler = client.check_dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
url = result.url;

cleanUserDataByUserId

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

Request

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

Result

説明

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CleanUserDataByUserIdRequest;
import io.gs2.inventory.result.CleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Inventory.Result.CleanUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.cleanUserDataByUserId(
        new Gs2Inventory.CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.clean_user_data_by_user_id(
        inventory.CleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
client = gs2('inventory')

api_result_handler = client.clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result

checkCleanUserDataByUserId

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

Request

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

Result

説明

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.inventory.result.CheckCleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Inventory.Result.CheckCleanUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.checkCleanUserDataByUserId(
        new Gs2Inventory.CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.check_clean_user_data_by_user_id(
        inventory.CheckCleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.check_clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
client = gs2('inventory')

api_result_handler = client.check_clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result

prepareImportUserDataByUserId

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

Request

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

Result

説明
uploadTokenstringアップロード後に結果を反映する際に使用するトークン
uploadUrlstringユーザーデータアップロード処理の実行に使用するURL

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.inventory.result.PrepareImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Inventory.Result.PrepareImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.prepareImportUserDataByUserId(
        new Gs2Inventory.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 inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.prepare_import_user_data_by_user_id(
        inventory.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('inventory')

api_result = client.prepare_import_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('inventory')

api_result_handler = client.prepare_import_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

importUserDataByUserId

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

Request

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

Result

説明

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.ImportUserDataByUserIdRequest;
import io.gs2.inventory.result.ImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Inventory.Result.ImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.importUserDataByUserId(
        new Gs2Inventory.ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.import_user_data_by_user_id(
        inventory.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('inventory')

api_result = client.import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
client = gs2('inventory')

api_result_handler = client.import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result

checkImportUserDataByUserId

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

Request

有効化条件必須デフォルト値の制限説明
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/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &inventory.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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CheckImportUserDataByUserIdRequest;
import io.gs2.inventory.result.CheckImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2InventoryRestClient client = new Gs2InventoryRestClient(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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Inventory.Result.CheckImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2Inventory.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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.checkImportUserDataByUserId(
        new Gs2Inventory.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 inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.check_import_user_data_by_user_id(
        inventory.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('inventory')

api_result = client.check_import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
url = result.url;
client = gs2('inventory')

api_result_handler = client.check_import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
url = result.url;

describeInventoryModelMasters

インベントリモデルマスターの一覧を取得

Request

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

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeInventoryModelMasters(
    &inventory.DescribeInventoryModelMastersRequest {
        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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeInventoryModelMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeInventoryModelMasters(
        (new DescribeInventoryModelMastersRequest())
            ->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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeInventoryModelMastersRequest;
import io.gs2.inventory.result.DescribeInventoryModelMastersResult;

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

try {
    DescribeInventoryModelMastersResult result = client.describeInventoryModelMasters(
        new DescribeInventoryModelMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<InventoryModelMaster> 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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeInventoryModelMastersRequest;
using Gs2.Gs2Inventory.Result.DescribeInventoryModelMastersResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeInventoryModelMastersResult> asyncResult = null;
yield return client.DescribeInventoryModelMasters(
    new Gs2.Gs2Inventory.Request.DescribeInventoryModelMastersRequest()
        .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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.describeInventoryModelMasters(
        new Gs2Inventory.DescribeInventoryModelMastersRequest()
            .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 inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.describe_inventory_model_masters(
        inventory.DescribeInventoryModelMastersRequest()
            .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('inventory')

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

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('inventory')

api_result_handler = client.describe_inventory_model_masters_async({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

createInventoryModelMaster

インベントリモデルマスターを新規作成

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
namestring~ 128文字インベントリモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
initialCapacityint~ 2147483646初期サイズ
maxCapacityint~ 2147483646最大サイズ
protectReferencedItemboolfalse参照元が登録されているアイテムセットは削除できなくする

Result

説明
itemInventoryModelMaster作成したインベントリモデルマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.CreateInventoryModelMaster(
    &inventory.CreateInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("item"),
        Description: nil,
        Metadata: nil,
        InitialCapacity: pointy.Int32(50),
        MaxCapacity: pointy.Int32(100),
        ProtectReferencedItem: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\CreateInventoryModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createInventoryModelMaster(
        (new CreateInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("item")
            ->withDescription(null)
            ->withMetadata(null)
            ->withInitialCapacity(50)
            ->withMaxCapacity(100)
            ->withProtectReferencedItem(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.CreateInventoryModelMasterRequest;
import io.gs2.inventory.result.CreateInventoryModelMasterResult;

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

try {
    CreateInventoryModelMasterResult result = client.createInventoryModelMaster(
        new CreateInventoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("item")
            .withDescription(null)
            .withMetadata(null)
            .withInitialCapacity(50)
            .withMaxCapacity(100)
            .withProtectReferencedItem(null)
    );
    InventoryModelMaster 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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.CreateInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.CreateInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.CreateInventoryModelMasterResult> asyncResult = null;
yield return client.CreateInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.CreateInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithName("item")
        .WithDescription(null)
        .WithMetadata(null)
        .WithInitialCapacity(50)
        .WithMaxCapacity(100)
        .WithProtectReferencedItem(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.createInventoryModelMaster(
        new Gs2Inventory.CreateInventoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("item")
            .withDescription(null)
            .withMetadata(null)
            .withInitialCapacity(50)
            .withMaxCapacity(100)
            .withProtectReferencedItem(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.create_inventory_model_master(
        inventory.CreateInventoryModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('item')
            .with_description(None)
            .with_metadata(None)
            .with_initial_capacity(50)
            .with_max_capacity(100)
            .with_protect_referenced_item(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.create_inventory_model_master({
    namespaceName="namespace1",
    name="item",
    description=nil,
    metadata=nil,
    initialCapacity=50,
    maxCapacity=100,
    protectReferencedItem=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('inventory')

api_result_handler = client.create_inventory_model_master_async({
    namespaceName="namespace1",
    name="item",
    description=nil,
    metadata=nil,
    initialCapacity=50,
    maxCapacity=100,
    protectReferencedItem=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

getInventoryModelMaster

インベントリモデルマスターを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
inventoryNamestring~ 128文字インベントリモデル名

Result

説明
itemInventoryModelMasterインベントリモデルマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetInventoryModelMaster(
    &inventory.GetInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetInventoryModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getInventoryModelMaster(
        (new GetInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetInventoryModelMasterRequest;
import io.gs2.inventory.result.GetInventoryModelMasterResult;

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

try {
    GetInventoryModelMasterResult result = client.getInventoryModelMaster(
        new GetInventoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("item")
    );
    InventoryModelMaster 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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.GetInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetInventoryModelMasterResult> asyncResult = null;
yield return client.GetInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.GetInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.getInventoryModelMaster(
        new Gs2Inventory.GetInventoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("item")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.get_inventory_model_master(
        inventory.GetInventoryModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('item')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.get_inventory_model_master({
    namespaceName="namespace1",
    inventoryName="item",
})

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

result = api_result.result
item = result.item;
client = gs2('inventory')

api_result_handler = client.get_inventory_model_master_async({
    namespaceName="namespace1",
    inventoryName="item",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

updateInventoryModelMaster

インベントリモデルマスターを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
inventoryNamestring~ 128文字インベントリモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 128文字メタデータ
initialCapacityint~ 2147483646初期サイズ
maxCapacityint~ 2147483646最大サイズ
protectReferencedItemboolfalse参照元が登録されているアイテムセットは削除できなくする

Result

説明
itemInventoryModelMaster更新したインベントリモデルマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.UpdateInventoryModelMaster(
    &inventory.UpdateInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        InventoryName: pointy.String("item"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("ITEM_INVENTORY_MASTER"),
        InitialCapacity: pointy.Int32(150),
        MaxCapacity: pointy.Int32(250),
        ProtectReferencedItem: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\UpdateInventoryModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateInventoryModelMaster(
        (new UpdateInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
            ->withDescription("description1")
            ->withMetadata("ITEM_INVENTORY_MASTER")
            ->withInitialCapacity(150)
            ->withMaxCapacity(250)
            ->withProtectReferencedItem(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.UpdateInventoryModelMasterRequest;
import io.gs2.inventory.result.UpdateInventoryModelMasterResult;

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

try {
    UpdateInventoryModelMasterResult result = client.updateInventoryModelMaster(
        new UpdateInventoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("item")
            .withDescription("description1")
            .withMetadata("ITEM_INVENTORY_MASTER")
            .withInitialCapacity(150)
            .withMaxCapacity(250)
            .withProtectReferencedItem(null)
    );
    InventoryModelMaster 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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.UpdateInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.UpdateInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.UpdateInventoryModelMasterResult> asyncResult = null;
yield return client.UpdateInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.UpdateInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item")
        .WithDescription("description1")
        .WithMetadata("ITEM_INVENTORY_MASTER")
        .WithInitialCapacity(150)
        .WithMaxCapacity(250)
        .WithProtectReferencedItem(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.updateInventoryModelMaster(
        new Gs2Inventory.UpdateInventoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("item")
            .withDescription("description1")
            .withMetadata("ITEM_INVENTORY_MASTER")
            .withInitialCapacity(150)
            .withMaxCapacity(250)
            .withProtectReferencedItem(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.update_inventory_model_master(
        inventory.UpdateInventoryModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('item')
            .with_description('description1')
            .with_metadata('ITEM_INVENTORY_MASTER')
            .with_initial_capacity(150)
            .with_max_capacity(250)
            .with_protect_referenced_item(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.update_inventory_model_master({
    namespaceName="namespace1",
    inventoryName="item",
    description="description1",
    metadata="ITEM_INVENTORY_MASTER",
    initialCapacity=150,
    maxCapacity=250,
    protectReferencedItem=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('inventory')

api_result_handler = client.update_inventory_model_master_async({
    namespaceName="namespace1",
    inventoryName="item",
    description="description1",
    metadata="ITEM_INVENTORY_MASTER",
    initialCapacity=150,
    maxCapacity=250,
    protectReferencedItem=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

deleteInventoryModelMaster

インベントリモデルマスターを削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
inventoryNamestring~ 128文字インベントリモデル名

Result

説明
itemInventoryModelMaster削除したインベントリモデルマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DeleteInventoryModelMaster(
    &inventory.DeleteInventoryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DeleteInventoryModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteInventoryModelMaster(
        (new DeleteInventoryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DeleteInventoryModelMasterRequest;
import io.gs2.inventory.result.DeleteInventoryModelMasterResult;

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

try {
    DeleteInventoryModelMasterResult result = client.deleteInventoryModelMaster(
        new DeleteInventoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("item")
    );
    InventoryModelMaster 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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DeleteInventoryModelMasterRequest;
using Gs2.Gs2Inventory.Result.DeleteInventoryModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DeleteInventoryModelMasterResult> asyncResult = null;
yield return client.DeleteInventoryModelMaster(
    new Gs2.Gs2Inventory.Request.DeleteInventoryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.deleteInventoryModelMaster(
        new Gs2Inventory.DeleteInventoryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("item")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.delete_inventory_model_master(
        inventory.DeleteInventoryModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_inventory_name('item')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

api_result = client.delete_inventory_model_master({
    namespaceName="namespace1",
    inventoryName="item",
})

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

result = api_result.result
item = result.item;
client = gs2('inventory')

api_result_handler = client.delete_inventory_model_master_async({
    namespaceName="namespace1",
    inventoryName="item",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

describeInventoryModels

インベントリモデルの一覧を取得

Request

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

Result

説明
itemsList<InventoryModel>インベントリモデルのリスト

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.DescribeInventoryModels(
    &inventory.DescribeInventoryModelsRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\DescribeInventoryModelsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeInventoryModels(
        (new DescribeInventoryModelsRequest())
            ->withNamespaceName(self::namespace1)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.DescribeInventoryModelsRequest;
import io.gs2.inventory.result.DescribeInventoryModelsResult;

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

try {
    DescribeInventoryModelsResult result = client.describeInventoryModels(
        new DescribeInventoryModelsRequest()
            .withNamespaceName("namespace1")
    );
    List<InventoryModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.DescribeInventoryModelsRequest;
using Gs2.Gs2Inventory.Result.DescribeInventoryModelsResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.DescribeInventoryModelsResult> asyncResult = null;
yield return client.DescribeInventoryModels(
    new Gs2.Gs2Inventory.Request.DescribeInventoryModelsRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.describeInventoryModels(
        new Gs2Inventory.DescribeInventoryModelsRequest()
            .withNamespaceName("namespace1")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = inventory.Gs2InventoryRestClient(session)

try:
    result = client.describe_inventory_models(
        inventory.DescribeInventoryModelsRequest()
            .with_namespace_name(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('inventory')

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

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

result = api_result.result
items = result.items;
client = gs2('inventory')

api_result_handler = client.describe_inventory_models_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;

getInventoryModel

インベントリモデルを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
inventoryNamestring~ 128文字インベントリモデル名

Result

説明
itemInventoryModelインベントリモデル

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inventory"
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 := inventory.Gs2InventoryRestClient{
    Session: &session,
}
result, err := client.GetInventoryModel(
    &inventory.GetInventoryModelRequest {
        NamespaceName: pointy.String("namespace1"),
        InventoryName: pointy.String("item"),
    }
)
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\Inventory\Gs2InventoryRestClient;
use Gs2\Inventory\Request\GetInventoryModelRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getInventoryModel(
        (new GetInventoryModelRequest())
            ->withNamespaceName(self::namespace1)
            ->withInventoryName("item")
    );
    $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.inventory.rest.Gs2InventoryRestClient;
import io.gs2.inventory.request.GetInventoryModelRequest;
import io.gs2.inventory.result.GetInventoryModelResult;

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

try {
    GetInventoryModelResult result = client.getInventoryModel(
        new GetInventoryModelRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("item")
    );
    InventoryModel 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.Gs2Inventory.Gs2InventoryRestClient;
using Gs2.Gs2Inventory.Request.GetInventoryModelRequest;
using Gs2.Gs2Inventory.Result.GetInventoryModelResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2InventoryRestClient(session);

AsyncResult<Gs2.Gs2Inventory.Result.GetInventoryModelResult> asyncResult = null;
yield return client.GetInventoryModel(
    new Gs2.Gs2Inventory.Request.GetInventoryModelRequest()
        .WithNamespaceName("namespace1")
        .WithInventoryName("item"),
    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 Gs2Inventory from '@/gs2/inventory';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Inventory.Gs2InventoryRestClient(session);

try {
    const result = await client.getInventoryModel(
        new Gs2Inventory.GetInventoryModelRequest()
            .withNamespaceName("namespace1")
            .withInventoryName("item")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inventory

session = core.Gs2RestSession(
    core.BasicGs2Credential