GS2-Version SDK API リファレンス

モデル

Namespace

ネームスペース

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

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

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字ネームスペースGRN
namestring~ 128文字ネームスペース名
descriptionstring~ 1024文字説明文
assumeUserIdstring~ 1024文字バージョンチェックを通過した場合に昇格する GS2-Identifier ユーザーGRN
acceptVersionScriptScriptSettingバージョンを承認したときに実行するスクリプト
checkVersionTriggerScriptIdstring~ 1024文字バージョンチェック処理を実行する GS2-Script のスクリプト
logSettingLogSettingログの出力設定
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

VersionModelMaster

バージョンモデルマスター

ログインを受け入れるが、バージョンアップ出来ることを通知する警告バージョンと、ログインを受け入れないエラーバージョンを設定できます。

現在のバージョンをクライアントに申告させるのに、署名の有無を指定できます。
署名付きを選択した場合、クライアントは嘘のバージョン申告を出来なくなります。

有効化条件必須デフォルト値の制限説明
versionModelIdstring~ 1024文字バージョンマスターGRN
namestring~ 128文字バージョンモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 2048文字メタデータ
scopeenum {
    “passive”,
    “active”
}
~ 128文字判定に使用するバージョン値の種類
typeenum {
    “simple”,
    “schedule”
}
“simple”~ 128文字バージョンチェックモード
currentVersionVersion{type} == “simple” and {scope} == “active”現在のバージョン
warningVersionVersion{type} == “simple”バージョンアップを促すバージョン
errorVersionVersion{type} == “simple”バージョンチェックでエラーになるバージョン
scheduleVersionsList<ScheduleVersion>{type} == “schedule”~ 10 items時系列で切り替わるバージョンチェック内容リスト
needSignaturebool{scope} == “passive”判定するバージョン値に署名検証を必要とするか
signatureKeyIdstring{needSignature}~ 1024文字暗号鍵GRN
approveRequirementenum {
    “required”,
    “optional”
}
{scope} == “active”“required”~ 128文字承認の必要性
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

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

定義説明
passiveクライアントから送信
active過去明示的に承認したバージョン

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

定義説明
simpleシンプル
schedule時系列切り替え

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

定義説明
required承認が必要
optional任意の承認

VersionModel

バージョンモデル

ログインを受け入れるが、バージョンアップ出来ることを通知する警告バージョンと、ログインを受け入れないエラーバージョンを設定できます。

現在のバージョンをクライアントに申告させるのに、署名の有無を指定できます。
署名付きを選択した場合、クライアントは嘘のバージョン申告を出来なくなります。

有効化条件必須デフォルト値の制限説明
versionModelIdstring~ 1024文字バージョンモデルGRN
namestring~ 128文字バージョンモデル名
metadatastring~ 2048文字メタデータ
scopeenum {
    “passive”,
    “active”
}
~ 128文字判定に使用するバージョン値の種類
typeenum {
    “simple”,
    “schedule”
}
“simple”~ 128文字バージョンチェックモード
currentVersionVersion{type} == “simple” and {scope} == “active”現在のバージョン
warningVersionVersion{type} == “simple”バージョンアップを促すバージョン
errorVersionVersion{type} == “simple”バージョンチェックでエラーになるバージョン
scheduleVersionsList<ScheduleVersion>{type} == “schedule”~ 10 items時系列で切り替わるバージョンチェック内容リスト
needSignaturebool{scope} == “passive”判定するバージョン値に署名検証を必要とするか
signatureKeyIdstring{needSignature}~ 1024文字暗号鍵GRN
approveRequirementenum {
    “required”,
    “optional”
}
{scope} == “active”“required”~ 128文字承認の必要性

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

定義説明
passiveクライアントから送信
active過去明示的に承認したバージョン

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

定義説明
simpleシンプル
schedule時系列切り替え

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

定義説明
required承認が必要
optional任意の承認

AcceptVersion

承認したバージョン

アプリバージョンや、アセットバージョンのようなデータに紐づいたバージョンではなく
同意した利用規約のバージョンのようなユーザ毎にバージョン管理が必要なエンティティで使用します。

有効化条件必須デフォルト値の制限説明
acceptVersionIdstring~ 1024文字承認したバージョンGRN
versionNamestring~ 128文字バージョン名
userIdstring~ 128文字ユーザーID
versionVersionバージョン
statusenum {
    “accept”,
    “reject”
}
“accept”~ 128文字ステータス
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

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

定義説明
accept承認済み
reject拒否済み

Status

バージョンの状態

バージョンの検証結果を表します。

有効化条件必須デフォルト値の制限説明
versionModelVersionModelバージョンモデル
currentVersionVersion現在のバージョン

TargetVersion

検証するバージョン

有効化条件必須デフォルト値の制限説明
versionNamestring~ 128文字バージョンモデル名
bodystring~ 1048576文字ボディ
signaturestring~ 256文字署名
versionVersion{signature} == ""バージョン

SignTargetVersion

署名対象バージョン

有効化条件必須デフォルト値の制限説明
regionstring~ 128文字リージョン
namespaceNamestring~ 128文字ネームスペース名
versionNamestring~ 128文字バージョンモデル名
versionVersionバージョン

CurrentVersionMaster

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

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

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

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

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

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タグ

LogSetting

ログの書き出し設定

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

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

Version

バージョン

有効化条件必須デフォルト値の制限説明
majorint~ 2147483646メジャーバージョン
minorint~ 2147483646マイナーバージョン
microint~ 2147483646マイクロバージョン

ScheduleVersion

時系列で切り替わるバージョン

有効化条件必須デフォルト値の制限説明
currentVersionVersion現在のバージョン
warningVersionVersionバージョンアップを促すバージョン
errorVersionVersionバージョンチェックでエラーになるバージョン
scheduleEventIdstring~ 1024文字バージョンチェックを有効化する期間を設定した GS2-Schedule のイベントGRN

メソッド

describeNamespaces

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

Request

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

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DescribeNamespacesRequest;
import io.gs2.version.result.DescribeNamespacesResult;

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

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

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

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

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

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

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

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('version')

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文字説明文
assumeUserIdstring~ 1024文字バージョンチェックを通過した場合に昇格する GS2-Identifier ユーザーGRN
acceptVersionScriptScriptSettingバージョンを承認したときに実行するスクリプト
checkVersionTriggerScriptIdstring~ 1024文字バージョンチェック処理を実行する GS2-Script のスクリプト
logSettingLogSettingログの出力設定

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &version.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        AssumeUserId: pointy.String("grn:gs2::YourOwnerId:identifier:user:user-0001"),
        AcceptVersionScript: nil,
        CheckVersionTriggerScriptId: nil,
        LogSetting: &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\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)
            ->withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            ->withAcceptVersionScript(null)
            ->withCheckVersionTriggerScriptId(null)
            ->withLogSetting((new \Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CreateNamespaceRequest;
import io.gs2.version.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            .withAcceptVersionScript(null)
            .withCheckVersionTriggerScriptId(null)
            .withLogSetting(new io.gs2.version.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.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.CreateNamespaceRequest;
using Gs2.Gs2Version.Result.CreateNamespaceResult;

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

AsyncResult<Gs2.Gs2Version.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Version.Request.CreateNamespaceRequest()
        .WithName("namespace1")
        .WithDescription(null)
        .WithAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
        .WithAcceptVersionScript(null)
        .WithCheckVersionTriggerScriptId(null)
        .WithLogSetting(new Gs2.Gs2Version.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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.createNamespace(
        new Gs2Version.CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            .withAcceptVersionScript(null)
            .withCheckVersionTriggerScriptId(null)
            .withLogSetting(new Gs2Version.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 version

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

try:
    result = client.create_namespace(
        version.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_assume_user_id('grn:gs2::YourOwnerId:identifier:user:user-0001')
            .with_accept_version_script(None)
            .with_check_version_trigger_script_id(None)
            .with_log_setting(
                version.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('version')

api_result = client.create_namespace({
    name="namespace1",
    description=nil,
    assumeUserId="grn:gs2::YourOwnerId:identifier:user:user-0001",
    acceptVersionScript=nil,
    checkVersionTriggerScriptId=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('version')

api_result_handler = client.create_namespace_async({
    name="namespace1",
    description=nil,
    assumeUserId="grn:gs2::YourOwnerId:identifier:user:user-0001",
    acceptVersionScript=nil,
    checkVersionTriggerScriptId=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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetNamespaceStatusRequest;
import io.gs2.version.result.GetNamespaceStatusResult;

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

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

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

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

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

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

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

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('version')

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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetNamespaceRequest;
import io.gs2.version.result.GetNamespaceResult;

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

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

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

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

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

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

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

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('version')

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文字説明文
assumeUserIdstring~ 1024文字バージョンチェックを通過した場合に昇格する GS2-Identifier ユーザーGRN
acceptVersionScriptScriptSettingバージョンを承認したときに実行するスクリプト
checkVersionTriggerScriptIdstring~ 1024文字バージョンチェック処理を実行する GS2-Script のスクリプト
logSettingLogSettingログの出力設定

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &version.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        AssumeUserId: pointy.String("grn:gs2::YourOwnerId:identifier:user:user-0002"),
        AcceptVersionScript: nil,
        CheckVersionTriggerScriptId: nil,
        LogSetting: &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\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")
            ->withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0002")
            ->withAcceptVersionScript(null)
            ->withCheckVersionTriggerScriptId(null)
            ->withLogSetting((new \Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.UpdateNamespaceRequest;
import io.gs2.version.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0002")
            .withAcceptVersionScript(null)
            .withCheckVersionTriggerScriptId(null)
            .withLogSetting(new io.gs2.version.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.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.UpdateNamespaceRequest;
using Gs2.Gs2Version.Result.UpdateNamespaceResult;

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

AsyncResult<Gs2.Gs2Version.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Version.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace1")
        .WithDescription("description1")
        .WithAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0002")
        .WithAcceptVersionScript(null)
        .WithCheckVersionTriggerScriptId(null)
        .WithLogSetting(new Gs2.Gs2Version.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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.updateNamespace(
        new Gs2Version.UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0002")
            .withAcceptVersionScript(null)
            .withCheckVersionTriggerScriptId(null)
            .withLogSetting(new Gs2Version.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 version

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

try:
    result = client.update_namespace(
        version.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_assume_user_id('grn:gs2::YourOwnerId:identifier:user:user-0002')
            .with_accept_version_script(None)
            .with_check_version_trigger_script_id(None)
            .with_log_setting(
                version.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('version')

api_result = client.update_namespace({
    namespaceName="namespace1",
    description="description1",
    assumeUserId="grn:gs2::YourOwnerId:identifier:user:user-0002",
    acceptVersionScript=nil,
    checkVersionTriggerScriptId=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('version')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace1",
    description="description1",
    assumeUserId="grn:gs2::YourOwnerId:identifier:user:user-0002",
    acceptVersionScript=nil,
    checkVersionTriggerScriptId=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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DeleteNamespaceRequest;
import io.gs2.version.result.DeleteNamespaceResult;

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

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

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

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

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

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

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

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('version')

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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DumpUserDataByUserIdRequest;
import io.gs2.version.result.DumpUserDataByUserIdResult;

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

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

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

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

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

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

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

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('version')

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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.version.result.CheckDumpUserDataByUserIdResult;

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

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

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

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

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

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

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

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('version')

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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CleanUserDataByUserIdRequest;
import io.gs2.version.result.CleanUserDataByUserIdResult;

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

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

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

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

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

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

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

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('version')

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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.version.result.CheckCleanUserDataByUserIdResult;

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

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

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

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

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

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

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

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('version')

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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.version.result.PrepareImportUserDataByUserIdResult;

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

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

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

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

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

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

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

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('version')

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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.ImportUserDataByUserIdRequest;
import io.gs2.version.result.ImportUserDataByUserIdResult;

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

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

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

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

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

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

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

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('version')

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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CheckImportUserDataByUserIdRequest;
import io.gs2.version.result.CheckImportUserDataByUserIdResult;

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

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

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

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

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

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

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

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('version')

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;

describeVersionModelMasters

バージョンマスターの一覧を取得

Request

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

Result

説明
itemsList<VersionModelMaster>バージョンマスターのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DescribeVersionModelMasters(
    &version.DescribeVersionModelMastersRequest {
        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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DescribeVersionModelMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeVersionModelMasters(
        (new DescribeVersionModelMastersRequest())
            ->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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DescribeVersionModelMastersRequest;
import io.gs2.version.result.DescribeVersionModelMastersResult;

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

try {
    DescribeVersionModelMastersResult result = client.describeVersionModelMasters(
        new DescribeVersionModelMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<VersionModelMaster> 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.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.DescribeVersionModelMastersRequest;
using Gs2.Gs2Version.Result.DescribeVersionModelMastersResult;

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

AsyncResult<Gs2.Gs2Version.Result.DescribeVersionModelMastersResult> asyncResult = null;
yield return client.DescribeVersionModelMasters(
    new Gs2.Gs2Version.Request.DescribeVersionModelMastersRequest()
        .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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.describeVersionModelMasters(
        new Gs2Version.DescribeVersionModelMastersRequest()
            .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 version

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

try:
    result = client.describe_version_model_masters(
        version.DescribeVersionModelMastersRequest()
            .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('version')

api_result = client.describe_version_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('version')

api_result_handler = client.describe_version_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;

createVersionModelMaster

バージョンマスターを新規作成

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
namestring~ 128文字バージョンモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 2048文字メタデータ
scopeenum {
    “passive”,
    “active”
}
~ 128文字判定に使用するバージョン値の種類
typeenum {
    “simple”,
    “schedule”
}
“simple”~ 128文字バージョンチェックモード
currentVersionVersion{type} == “simple” and {scope} == “active”現在のバージョン
warningVersionVersion{type} == “simple”バージョンアップを促すバージョン
errorVersionVersion{type} == “simple”バージョンチェックでエラーになるバージョン
scheduleVersionsList<ScheduleVersion>{type} == “schedule”~ 10 items時系列で切り替わるバージョンチェック内容リスト
needSignaturebool{scope} == “passive”判定するバージョン値に署名検証を必要とするか
signatureKeyIdstring{needSignature}~ 1024文字暗号鍵GRN
approveRequirementenum {
    “required”,
    “optional”
}
{scope} == “active”“required”~ 128文字承認の必要性

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

定義説明
passiveクライアントから送信
active過去明示的に承認したバージョン

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

定義説明
simpleシンプル
schedule時系列切り替え

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

定義説明
required承認が必要
optional任意の承認

Result

説明
itemVersionModelMaster作成したバージョンマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CreateVersionModelMaster(
    &version.CreateVersionModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("version-0001"),
        Description: nil,
        Metadata: nil,
        Scope: pointy.String("passive"),
        Type: nil,
        CurrentVersion: nil,
        WarningVersion: &version.Version{
            Major: pointy.Int32(2),
            Minor: pointy.Int32(2),
            Micro: pointy.Int32(2),
        },
        ErrorVersion: &version.Version{
            Major: pointy.Int32(1),
            Minor: pointy.Int32(1),
            Micro: pointy.Int32(1),
        },
        ScheduleVersions: nil,
        NeedSignature: pointy.Bool(false),
        SignatureKeyId: nil,
        ApproveRequirement: 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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CreateVersionModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createVersionModelMaster(
        (new CreateVersionModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("version-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withScope("passive")
            ->withType(null)
            ->withCurrentVersion(null)
            ->withWarningVersion((new \Gs2\Version\Model\Version())
                ->withMajor(2)
                ->withMinor(2)
                ->withMicro(2))
            ->withErrorVersion((new \Gs2\Version\Model\Version())
                ->withMajor(1)
                ->withMinor(1)
                ->withMicro(1))
            ->withScheduleVersions(null)
            ->withNeedSignature(False)
            ->withSignatureKeyId(null)
            ->withApproveRequirement(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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CreateVersionModelMasterRequest;
import io.gs2.version.result.CreateVersionModelMasterResult;

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

try {
    CreateVersionModelMasterResult result = client.createVersionModelMaster(
        new CreateVersionModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("version-0001")
            .withDescription(null)
            .withMetadata(null)
            .withScope("passive")
            .withType(null)
            .withCurrentVersion(null)
            .withWarningVersion(new io.gs2.version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
            .withErrorVersion(new io.gs2.version.model.Version()
                .withMajor(1)
                .withMinor(1)
                .withMicro(1))
            .withScheduleVersions(null)
            .withNeedSignature(false)
            .withSignatureKeyId(null)
            .withApproveRequirement(null)
    );
    VersionModelMaster 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.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.CreateVersionModelMasterRequest;
using Gs2.Gs2Version.Result.CreateVersionModelMasterResult;

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

AsyncResult<Gs2.Gs2Version.Result.CreateVersionModelMasterResult> asyncResult = null;
yield return client.CreateVersionModelMaster(
    new Gs2.Gs2Version.Request.CreateVersionModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithName("version-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithScope("passive")
        .WithType(null)
        .WithCurrentVersion(null)
        .WithWarningVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(2)
            .WithMinor(2)
            .WithMicro(2))
        .WithErrorVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(1)
            .WithMinor(1)
            .WithMicro(1))
        .WithScheduleVersions(null)
        .WithNeedSignature(false)
        .WithSignatureKeyId(null)
        .WithApproveRequirement(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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.createVersionModelMaster(
        new Gs2Version.CreateVersionModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("version-0001")
            .withDescription(null)
            .withMetadata(null)
            .withScope("passive")
            .withType(null)
            .withCurrentVersion(null)
            .withWarningVersion(new Gs2Version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
            .withErrorVersion(new Gs2Version.model.Version()
                .withMajor(1)
                .withMinor(1)
                .withMicro(1))
            .withScheduleVersions(null)
            .withNeedSignature(false)
            .withSignatureKeyId(null)
            .withApproveRequirement(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.create_version_model_master(
        version.CreateVersionModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('version-0001')
            .with_description(None)
            .with_metadata(None)
            .with_scope('passive')
            .with_type(None)
            .with_current_version(None)
            .with_warning_version(
                version.Version()
                    .with_major(2)
                    .with_minor(2)
                    .with_micro(2))
            .with_error_version(
                version.Version()
                    .with_major(1)
                    .with_minor(1)
                    .with_micro(1))
            .with_schedule_versions(None)
            .with_need_signature(False)
            .with_signature_key_id(None)
            .with_approve_requirement(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.create_version_model_master({
    namespaceName="namespace1",
    name="version-0001",
    description=nil,
    metadata=nil,
    scope="passive",
    type=nil,
    currentVersion=nil,
    warningVersion={
        major=2,
        minor=2,
        micro=2,
    },
    errorVersion={
        major=1,
        minor=1,
        micro=1,
    },
    scheduleVersions=nil,
    needSignature=false,
    signatureKeyId=nil,
    approveRequirement=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('version')

api_result_handler = client.create_version_model_master_async({
    namespaceName="namespace1",
    name="version-0001",
    description=nil,
    metadata=nil,
    scope="passive",
    type=nil,
    currentVersion=nil,
    warningVersion={
        major=2,
        minor=2,
        micro=2,
    },
    errorVersion={
        major=1,
        minor=1,
        micro=1,
    },
    scheduleVersions=nil,
    needSignature=false,
    signatureKeyId=nil,
    approveRequirement=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;

getVersionModelMaster

バージョンマスターを取得

Request

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

Result

説明
itemVersionModelMasterバージョンマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetVersionModelMaster(
    &version.GetVersionModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        VersionName: pointy.String("version-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\GetVersionModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getVersionModelMaster(
        (new GetVersionModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withVersionName("version-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetVersionModelMasterRequest;
import io.gs2.version.result.GetVersionModelMasterResult;

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

try {
    GetVersionModelMasterResult result = client.getVersionModelMaster(
        new GetVersionModelMasterRequest()
            .withNamespaceName("namespace1")
            .withVersionName("version-0001")
    );
    VersionModelMaster 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.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.GetVersionModelMasterRequest;
using Gs2.Gs2Version.Result.GetVersionModelMasterResult;

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

AsyncResult<Gs2.Gs2Version.Result.GetVersionModelMasterResult> asyncResult = null;
yield return client.GetVersionModelMaster(
    new Gs2.Gs2Version.Request.GetVersionModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithVersionName("version-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.getVersionModelMaster(
        new Gs2Version.GetVersionModelMasterRequest()
            .withNamespaceName("namespace1")
            .withVersionName("version-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.get_version_model_master(
        version.GetVersionModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_version_name('version-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.get_version_model_master({
    namespaceName="namespace1",
    versionName="version-0001",
})

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

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

api_result_handler = client.get_version_model_master_async({
    namespaceName="namespace1",
    versionName="version-0001",
})

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

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

result = api_result.result
item = result.item;

updateVersionModelMaster

バージョンマスターを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
versionNamestring~ 128文字バージョンモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 2048文字メタデータ
scopeenum {
    “passive”,
    “active”
}
~ 128文字判定に使用するバージョン値の種類
typeenum {
    “simple”,
    “schedule”
}
“simple”~ 128文字バージョンチェックモード
currentVersionVersion{type} == “simple” and {scope} == “active”現在のバージョン
warningVersionVersion{type} == “simple”バージョンアップを促すバージョン
errorVersionVersion{type} == “simple”バージョンチェックでエラーになるバージョン
scheduleVersionsList<ScheduleVersion>{type} == “schedule”~ 10 items時系列で切り替わるバージョンチェック内容リスト
needSignaturebool{scope} == “passive”判定するバージョン値に署名検証を必要とするか
signatureKeyIdstring{needSignature}~ 1024文字暗号鍵GRN
approveRequirementenum {
    “required”,
    “optional”
}
{scope} == “active”“required”~ 128文字承認の必要性

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

定義説明
passiveクライアントから送信
active過去明示的に承認したバージョン

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

定義説明
simpleシンプル
schedule時系列切り替え

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

定義説明
required承認が必要
optional任意の承認

Result

説明
itemVersionModelMaster更新したバージョンマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.UpdateVersionModelMaster(
    &version.UpdateVersionModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        VersionName: pointy.String("version-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("{\"hoge\": \"fuga\"}"),
        Scope: pointy.String("active"),
        Type: nil,
        CurrentVersion: &version.Version{
            Major: pointy.Int32(3),
            Minor: pointy.Int32(0),
            Micro: pointy.Int32(0),
        },
        WarningVersion: &version.Version{
            Major: pointy.Int32(3),
            Minor: pointy.Int32(3),
            Micro: pointy.Int32(3),
        },
        ErrorVersion: &version.Version{
            Major: pointy.Int32(2),
            Minor: pointy.Int32(2),
            Micro: pointy.Int32(2),
        },
        ScheduleVersions: nil,
        NeedSignature: pointy.Bool(false),
        SignatureKeyId: nil,
        ApproveRequirement: 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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\UpdateVersionModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateVersionModelMaster(
        (new UpdateVersionModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withVersionName("version-0001")
            ->withDescription("description1")
            ->withMetadata("{\"hoge\": \"fuga\"}")
            ->withScope("active")
            ->withType(null)
            ->withCurrentVersion((new \Gs2\Version\Model\Version())
                ->withMajor(3)
                ->withMinor(0)
                ->withMicro(0))
            ->withWarningVersion((new \Gs2\Version\Model\Version())
                ->withMajor(3)
                ->withMinor(3)
                ->withMicro(3))
            ->withErrorVersion((new \Gs2\Version\Model\Version())
                ->withMajor(2)
                ->withMinor(2)
                ->withMicro(2))
            ->withScheduleVersions(null)
            ->withNeedSignature(False)
            ->withSignatureKeyId(null)
            ->withApproveRequirement(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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.UpdateVersionModelMasterRequest;
import io.gs2.version.result.UpdateVersionModelMasterResult;

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

try {
    UpdateVersionModelMasterResult result = client.updateVersionModelMaster(
        new UpdateVersionModelMasterRequest()
            .withNamespaceName("namespace1")
            .withVersionName("version-0001")
            .withDescription("description1")
            .withMetadata("{\"hoge\": \"fuga\"}")
            .withScope("active")
            .withType(null)
            .withCurrentVersion(new io.gs2.version.model.Version()
                .withMajor(3)
                .withMinor(0)
                .withMicro(0))
            .withWarningVersion(new io.gs2.version.model.Version()
                .withMajor(3)
                .withMinor(3)
                .withMicro(3))
            .withErrorVersion(new io.gs2.version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
            .withScheduleVersions(null)
            .withNeedSignature(false)
            .withSignatureKeyId(null)
            .withApproveRequirement(null)
    );
    VersionModelMaster 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.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.UpdateVersionModelMasterRequest;
using Gs2.Gs2Version.Result.UpdateVersionModelMasterResult;

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

AsyncResult<Gs2.Gs2Version.Result.UpdateVersionModelMasterResult> asyncResult = null;
yield return client.UpdateVersionModelMaster(
    new Gs2.Gs2Version.Request.UpdateVersionModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithVersionName("version-0001")
        .WithDescription("description1")
        .WithMetadata("{\"hoge\": \"fuga\"}")
        .WithScope("active")
        .WithType(null)
        .WithCurrentVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(3)
            .WithMinor(0)
            .WithMicro(0))
        .WithWarningVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(3)
            .WithMinor(3)
            .WithMicro(3))
        .WithErrorVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(2)
            .WithMinor(2)
            .WithMicro(2))
        .WithScheduleVersions(null)
        .WithNeedSignature(false)
        .WithSignatureKeyId(null)
        .WithApproveRequirement(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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.updateVersionModelMaster(
        new Gs2Version.UpdateVersionModelMasterRequest()
            .withNamespaceName("namespace1")
            .withVersionName("version-0001")
            .withDescription("description1")
            .withMetadata("{\"hoge\": \"fuga\"}")
            .withScope("active")
            .withType(null)
            .withCurrentVersion(new Gs2Version.model.Version()
                .withMajor(3)
                .withMinor(0)
                .withMicro(0))
            .withWarningVersion(new Gs2Version.model.Version()
                .withMajor(3)
                .withMinor(3)
                .withMicro(3))
            .withErrorVersion(new Gs2Version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
            .withScheduleVersions(null)
            .withNeedSignature(false)
            .withSignatureKeyId(null)
            .withApproveRequirement(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.update_version_model_master(
        version.UpdateVersionModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_version_name('version-0001')
            .with_description('description1')
            .with_metadata('{"hoge": "fuga"}')
            .with_scope('active')
            .with_type(None)
            .with_current_version(
                version.Version()
                    .with_major(3)
                    .with_minor(0)
                    .with_micro(0))
            .with_warning_version(
                version.Version()
                    .with_major(3)
                    .with_minor(3)
                    .with_micro(3))
            .with_error_version(
                version.Version()
                    .with_major(2)
                    .with_minor(2)
                    .with_micro(2))
            .with_schedule_versions(None)
            .with_need_signature(False)
            .with_signature_key_id(None)
            .with_approve_requirement(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.update_version_model_master({
    namespaceName="namespace1",
    versionName="version-0001",
    description="description1",
    metadata="{\"hoge\": \"fuga\"}",
    scope="active",
    type=nil,
    currentVersion={
        major=3,
        minor=0,
        micro=0,
    },
    warningVersion={
        major=3,
        minor=3,
        micro=3,
    },
    errorVersion={
        major=2,
        minor=2,
        micro=2,
    },
    scheduleVersions=nil,
    needSignature=false,
    signatureKeyId=nil,
    approveRequirement=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('version')

api_result_handler = client.update_version_model_master_async({
    namespaceName="namespace1",
    versionName="version-0001",
    description="description1",
    metadata="{\"hoge\": \"fuga\"}",
    scope="active",
    type=nil,
    currentVersion={
        major=3,
        minor=0,
        micro=0,
    },
    warningVersion={
        major=3,
        minor=3,
        micro=3,
    },
    errorVersion={
        major=2,
        minor=2,
        micro=2,
    },
    scheduleVersions=nil,
    needSignature=false,
    signatureKeyId=nil,
    approveRequirement=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;

deleteVersionModelMaster

バージョンマスターを削除

Request

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

Result

説明
itemVersionModelMaster削除したバージョンマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DeleteVersionModelMaster(
    &version.DeleteVersionModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        VersionName: pointy.String("version-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DeleteVersionModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteVersionModelMaster(
        (new DeleteVersionModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withVersionName("version-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DeleteVersionModelMasterRequest;
import io.gs2.version.result.DeleteVersionModelMasterResult;

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

try {
    DeleteVersionModelMasterResult result = client.deleteVersionModelMaster(
        new DeleteVersionModelMasterRequest()
            .withNamespaceName("namespace1")
            .withVersionName("version-0001")
    );
    VersionModelMaster 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.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.DeleteVersionModelMasterRequest;
using Gs2.Gs2Version.Result.DeleteVersionModelMasterResult;

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

AsyncResult<Gs2.Gs2Version.Result.DeleteVersionModelMasterResult> asyncResult = null;
yield return client.DeleteVersionModelMaster(
    new Gs2.Gs2Version.Request.DeleteVersionModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithVersionName("version-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.deleteVersionModelMaster(
        new Gs2Version.DeleteVersionModelMasterRequest()
            .withNamespaceName("namespace1")
            .withVersionName("version-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.delete_version_model_master(
        version.DeleteVersionModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_version_name('version-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.delete_version_model_master({
    namespaceName="namespace1",
    versionName="version-0001",
})

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

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

api_result_handler = client.delete_version_model_master_async({
    namespaceName="namespace1",
    versionName="version-0001",
})

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

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

result = api_result.result
item = result.item;

describeVersionModels

バージョンモデルの一覧を取得

Request

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

Result

説明
itemsList<VersionModel>バージョンモデルのリスト

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DescribeVersionModels(
    &version.DescribeVersionModelsRequest {
        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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DescribeVersionModelsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeVersionModels(
        (new DescribeVersionModelsRequest())
            ->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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DescribeVersionModelsRequest;
import io.gs2.version.result.DescribeVersionModelsResult;

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

try {
    DescribeVersionModelsResult result = client.describeVersionModels(
        new DescribeVersionModelsRequest()
            .withNamespaceName("namespace1")
    );
    List<VersionModel> 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.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.DescribeVersionModelsRequest;
using Gs2.Gs2Version.Result.DescribeVersionModelsResult;

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

AsyncResult<Gs2.Gs2Version.Result.DescribeVersionModelsResult> asyncResult = null;
yield return client.DescribeVersionModels(
    new Gs2.Gs2Version.Request.DescribeVersionModelsRequest()
        .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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.describeVersionModels(
        new Gs2Version.DescribeVersionModelsRequest()
            .withNamespaceName("namespace1")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.describe_version_models(
        version.DescribeVersionModelsRequest()
            .with_namespace_name(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.describe_version_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('version')

api_result_handler = client.describe_version_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;

getVersionModel

バージョンモデルを取得

Request

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

Result

説明
itemVersionModelバージョンモデル

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetVersionModel(
    &version.GetVersionModelRequest {
        NamespaceName: pointy.String("namespace1"),
        VersionName: pointy.String("version-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\GetVersionModelRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getVersionModel(
        (new GetVersionModelRequest())
            ->withNamespaceName(self::namespace1)
            ->withVersionName("version-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetVersionModelRequest;
import io.gs2.version.result.GetVersionModelResult;

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

try {
    GetVersionModelResult result = client.getVersionModel(
        new GetVersionModelRequest()
            .withNamespaceName("namespace1")
            .withVersionName("version-0001")
    );
    VersionModel 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.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.GetVersionModelRequest;
using Gs2.Gs2Version.Result.GetVersionModelResult;

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

AsyncResult<Gs2.Gs2Version.Result.GetVersionModelResult> asyncResult = null;
yield return client.GetVersionModel(
    new Gs2.Gs2Version.Request.GetVersionModelRequest()
        .WithNamespaceName("namespace1")
        .WithVersionName("version-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.getVersionModel(
        new Gs2Version.GetVersionModelRequest()
            .withNamespaceName("namespace1")
            .withVersionName("version-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.get_version_model(
        version.GetVersionModelRequest()
            .with_namespace_name(self.hash1)
            .with_version_name('version-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.get_version_model({
    namespaceName="namespace1",
    versionName="version-0001",
})

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

result = api_result.result
item = result.item;