NAV
go python java php typescript csharp GS2-Script

GS2-Version

GS2 SDK のリファレンス

GS2 SDK リファレンス

モデル

Namespace

ネームスペース

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

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

説明
namespaceId string ネームスペースGRN
name string ネームスペース名
description string 説明文
assumeUserId string ユーザGRN
acceptVersionScript ScriptSetting バージョンを承認したときに実行するスクリプト
checkVersionTriggerScriptId string バージョンチェック処理を実行する GS2-Script のスクリプト
logSetting LogSetting ログの出力設定
createdAt long 作成日時
updatedAt long 最終更新日時

VersionModelMaster

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

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

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

説明
versionModelId string バージョンマスターGRN
name string バージョンモデル名
description string 説明文
metadata string メタデータ
warningVersion Version_ バージョンアップを促すバージョン
errorVersion Version_ バージョンチェックを蹴るバージョン
scope enum ['passive', 'active'] 判定に使用するバージョン値の種類
currentVersion Version_ 現在のバージョン
needSignature bool 判定するバージョン値に署名検証を必要とするか
signatureKeyId string 暗号鍵GRN
createdAt long 作成日時
updatedAt long 最終更新日時

Version

説明
major int メジャーバージョン
minor int マイナーバージョン
micro int マイクロバージョン

VersionModel

バージョンモデル

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

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

説明
versionModelId string バージョンモデルGRN
name string バージョンモデル名
metadata string メタデータ
warningVersion Version_ バージョンアップを促すバージョン
errorVersion Version_ バージョンチェックを蹴るバージョン
scope enum ['passive', 'active'] 判定に使用するバージョン値の種類
currentVersion Version_ 現在のバージョン
needSignature bool 判定するバージョン値に署名検証を必要とするか
signatureKeyId string 暗号鍵GRN

AcceptVersion

承認したバージョン

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

説明
acceptVersionId string 承認したバージョンGRN
versionName string 承認したバージョン名
userId string ユーザーID
version Version_ 承認したバージョン
createdAt long 作成日時
updatedAt long 最終更新日時

Status

説明
versionModel VersionModel バージョンモデル
currentVersion Version_ 現在のバージョン

TargetVersion

説明
versionName string バージョンの名前
version Version_ バージョン
body string ボディ
signature string 署名

SignTargetVersion

説明
region string リージョン
namespaceName string ネームスペース名
versionName string バージョンモデル名
version Version_ バージョン

CurrentVersionMaster

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

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

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

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

説明
namespaceId string 現在有効なバージョンGRN
settings string マスターデータ

ScriptSetting

説明
triggerScriptId string スクリプトGRN
doneTriggerTargetType enum ['none', 'gs2_script', 'aws'] 完了通知の通知先
doneTriggerScriptId string スクリプトGRN
doneTriggerQueueNamespaceId string ネームスペースGRN

GitHubCheckoutSetting

説明
apiKeyId string GitHub のAPIキーGRN
repositoryName string リポジトリ名
sourcePath string ソースコードのファイルパス
referenceType enum ['commit_hash', 'branch', 'tag'] コードの取得元
commitHash string コミットハッシュ
branchName string ブランチ名
tagName string タグ名

LogSetting

説明
loggingNamespaceId string ネームスペースGRN

メソッド

describeNamespaces

describeNamespaces

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeNamespaces(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

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

Request

必須 デフォルト 値の制限 説明
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items Namespace[] ネームスペースのリスト
nextPageToken string リストの続きを取得するためのページトークン

createNamespace

createNamespace

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createNamespace(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

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

Request

必須 デフォルト 値の制限 説明
name string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
assumeUserId string ~ 1024文字 ユーザGRN
acceptVersionScript ScriptSetting バージョンを承認したときに実行するスクリプト
checkVersionTriggerScriptId string ~ 1024文字 バージョンチェック処理を実行する GS2-Script のスクリプト
logSetting LogSetting ログの出力設定

Result

説明
item Namespace 作成したネームスペース

getNamespaceStatus

getNamespaceStatus

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespaceStatus(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
status = result.status;

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

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
status string

getNamespace

getNamespace

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespace(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item Namespace ネームスペース

updateNamespace

updateNamespace

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateNamespace(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
assumeUserId string ~ 1024文字 ユーザGRN
acceptVersionScript ScriptSetting バージョンを承認したときに実行するスクリプト
checkVersionTriggerScriptId string ~ 1024文字 バージョンチェック処理を実行する GS2-Script のスクリプト
logSetting LogSetting ログの出力設定

Result

説明
item Namespace 更新したネームスペース

deleteNamespace

deleteNamespace

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteNamespace(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item Namespace 削除したネームスペース

describeVersionModelMasters

describeVersionModelMasters

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeVersionModelMasters(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

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

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items VersionModelMaster[] バージョンマスターのリスト
nextPageToken string リストの続きを取得するためのページトークン

createVersionModelMaster

createVersionModelMaster

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,
        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),
        },
        Scope: pointy.String("passive"),
        CurrentVersion: nil,
        NeedSignature: pointy.Bool(false),
        SignatureKeyId: 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)
            ->withWarningVersion((new \Gs2\Version\Model\Version())
                ->withMajor(2)
                ->withMinor(2)
                ->withMicro(2))
            ->withErrorVersion((new \Gs2\Version\Model\Version())
                ->withMajor(1)
                ->withMinor(1)
                ->withMicro(1))
            ->withScope("passive")
            ->withCurrentVersion(null)
            ->withNeedSignature(False)
            ->withSignatureKeyId(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)
            .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))
            .withScope("passive")
            .withCurrentVersion(null)
            .withNeedSignature(false)
            .withSignatureKeyId(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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createVersionModelMaster(
    new CreateVersionModelMasterRequest()
        .withNamespaceName("namespace1")
        .withName("version-0001")
        .withDescription(null)
        .withMetadata(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))
        .withScope("passive")
        .withCurrentVersion(null)
        .withNeedSignature(false)
        .withSignatureKeyId(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)
            .withWarningVersion(new Gs2Version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
            .withErrorVersion(new Gs2Version.model.Version()
                .withMajor(1)
                .withMinor(1)
                .withMicro(1))
            .withScope("passive")
            .withCurrentVersion(null)
            .withNeedSignature(false)
            .withSignatureKeyId(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_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_scope('passive')
            .with_current_version(None)
            .with_need_signature(False)
            .with_signature_key_id(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,
    warningVersion={
        major=2,
        minor=2,
        micro=2,
    },
    errorVersion={
        major=1,
        minor=1,
        micro=1,
    },
    scope='passive',
    currentVersion=nil,
    needSignature=false,
    signatureKeyId=nil,
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

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

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
name string ~ 128文字 バージョンモデル名
description string ~ 1024文字 説明文
metadata string ~ 2048文字 メタデータ
warningVersion Version_ バージョンアップを促すバージョン
errorVersion Version_ バージョンチェックを蹴るバージョン
scope enum ['passive', 'active'] ~ 128文字 判定に使用するバージョン値の種類
currentVersion Version_ {scope} == "active" 現在のバージョン
needSignature bool {scope} == "passive" 判定するバージョン値に署名検証を必要とするか
signatureKeyId string {needSignature} != none and {needSignature} ~ 1024文字 暗号鍵GRN

Result

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

getVersionModelMaster

getVersionModelMaster

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getVersionModelMaster(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

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

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
versionName string ~ 128文字 バージョンモデル名

Result

説明
item VersionModelMaster バージョンマスター

updateVersionModelMaster

updateVersionModelMaster

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\"}"),
        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),
        },
        Scope: pointy.String("active"),
        CurrentVersion: &version.Version{
            Major: pointy.Int32(3),
            Minor: pointy.Int32(0),
            Micro: pointy.Int32(0),
        },
        NeedSignature: pointy.Bool(false),
        SignatureKeyId: 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\"}")
            ->withWarningVersion((new \Gs2\Version\Model\Version())
                ->withMajor(3)
                ->withMinor(3)
                ->withMicro(3))
            ->withErrorVersion((new \Gs2\Version\Model\Version())
                ->withMajor(2)
                ->withMinor(2)
                ->withMicro(2))
            ->withScope("active")
            ->withCurrentVersion((new \Gs2\Version\Model\Version())
                ->withMajor(3)
                ->withMinor(0)
                ->withMicro(0))
            ->withNeedSignature(False)
            ->withSignatureKeyId(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\"}")
            .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))
            .withScope("active")
            .withCurrentVersion(new io.gs2.version.model.Version()
                .withMajor(3)
                .withMinor(0)
                .withMicro(0))
            .withNeedSignature(false)
            .withSignatureKeyId(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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateVersionModelMaster(
    new UpdateVersionModelMasterRequest()
        .withNamespaceName("namespace1")
        .withVersionName("version-0001")
        .withDescription("description1")
        .withMetadata("{\"hoge\": \"fuga\"}")
        .withWarningVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(3)
            .WithMinor(3)
            .WithMicro(3))
        .withErrorVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(2)
            .WithMinor(2)
            .WithMicro(2))
        .withScope("active")
        .withCurrentVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(3)
            .WithMinor(0)
            .WithMicro(0))
        .withNeedSignature(false)
        .withSignatureKeyId(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\"}")
            .withWarningVersion(new Gs2Version.model.Version()
                .withMajor(3)
                .withMinor(3)
                .withMicro(3))
            .withErrorVersion(new Gs2Version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
            .withScope("active")
            .withCurrentVersion(new Gs2Version.model.Version()
                .withMajor(3)
                .withMinor(0)
                .withMicro(0))
            .withNeedSignature(false)
            .withSignatureKeyId(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_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_scope('active')
            .with_current_version(
                version.Version()
                    .with_major(3)
                    .with_minor(0)
                    .with_micro(0))
            .with_need_signature(False)
            .with_signature_key_id(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"}',
    warningVersion={
        major=3,
        minor=3,
        micro=3,
    },
    errorVersion={
        major=2,
        minor=2,
        micro=2,
    },
    scope='active',
    currentVersion={
        major=3,
        minor=0,
        micro=0,
    },
    needSignature=false,
    signatureKeyId=nil,
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

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

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
versionName string ~ 128文字 バージョンモデル名
description string ~ 1024文字 説明文
metadata string ~ 2048文字 メタデータ
warningVersion Version_ バージョンアップを促すバージョン
errorVersion Version_ バージョンチェックを蹴るバージョン
scope enum ['passive', 'active'] ~ 128文字 判定に使用するバージョン値の種類
currentVersion Version_ {scope} == "active" 現在のバージョン
needSignature bool {scope} == "passive" 判定するバージョン値に署名検証を必要とするか
signatureKeyId string {needSignature} != none and {needSignature} ~ 1024文字 暗号鍵GRN

Result

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

deleteVersionModelMaster

deleteVersionModelMaster

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteVersionModelMaster(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

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

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
versionName string ~ 128文字 バージョンモデル名

Result

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

describeVersionModels

describeVersionModels

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeVersionModels(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;

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

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
items VersionModel[] バージョンモデルのリスト

getVersionModel

getVersionModel

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getVersionModel(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

バージョンモデルを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
versionName string ~ 128文字 バージョンモデル名

Result

説明
item VersionModel バージョンモデル

describeAcceptVersions

describeAcceptVersions

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.DescribeAcceptVersions(
    &version.DescribeAcceptVersionsRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DescribeAcceptVersionsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeAcceptVersions(
        (new DescribeAcceptVersionsRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DescribeAcceptVersionsRequest;
import io.gs2.version.result.DescribeAcceptVersionsResult;

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

try {
    DescribeAcceptVersionsResult result = client.describeAcceptVersions(
        new DescribeAcceptVersionsRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<AcceptVersion> 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.DescribeAcceptVersionsRequest;
using Gs2.Gs2Version.Result.DescribeAcceptVersionsResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeAcceptVersions(
    new DescribeAcceptVersionsRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withPageToken(null)
        .withLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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.describeAcceptVersions(
        new Gs2Version.DescribeAcceptVersionsRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_accept_versions(
        version.DescribeAcceptVersionsRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

api_result = client.describe_accept_versions({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

承認したバージョンの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items AcceptVersion[] 承認したバージョンのリスト
nextPageToken string リストの続きを取得するためのページトークン

describeAcceptVersionsByUserId

describeAcceptVersionsByUserId

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.DescribeAcceptVersionsByUserId(
    &version.DescribeAcceptVersionsByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DescribeAcceptVersionsByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeAcceptVersionsByUserId(
        (new DescribeAcceptVersionsByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DescribeAcceptVersionsByUserIdRequest;
import io.gs2.version.result.DescribeAcceptVersionsByUserIdResult;

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

try {
    DescribeAcceptVersionsByUserIdResult result = client.describeAcceptVersionsByUserId(
        new DescribeAcceptVersionsByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<AcceptVersion> 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.DescribeAcceptVersionsByUserIdRequest;
using Gs2.Gs2Version.Result.DescribeAcceptVersionsByUserIdResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeAcceptVersionsByUserId(
    new DescribeAcceptVersionsByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001")
        .withPageToken(null)
        .withLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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.describeAcceptVersionsByUserId(
        new Gs2Version.DescribeAcceptVersionsByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_accept_versions_by_user_id(
        version.DescribeAcceptVersionsByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

api_result = client.describe_accept_versions_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

承認したバージョンの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items AcceptVersion[] 承認したバージョンのリスト
nextPageToken string リストの続きを取得するためのページトークン

accept

accept

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.Accept(
    &version.AcceptRequest {
        NamespaceName: pointy.String("namespace1"),
        VersionName: pointy.String("eula"),
        AccessToken: pointy.String("$access_token_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\AcceptRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->accept(
        (new AcceptRequest())
            ->withNamespaceName(self::namespace1)
            ->withVersionName("eula")
            ->withAccessToken(self::$accessToken0001)
    );
    $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.AcceptRequest;
import io.gs2.version.result.AcceptResult;

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

try {
    AcceptResult result = client.accept(
        new AcceptRequest()
            .withNamespaceName("namespace1")
            .withVersionName("eula")
            .withAccessToken("$access_token_0001")
    );
    AcceptVersion 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.AcceptRequest;
using Gs2.Gs2Version.Result.AcceptResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.accept(
    new AcceptRequest()
        .withNamespaceName("namespace1")
        .withVersionName("eula")
        .withAccessToken("$access_token_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.accept(
        new Gs2Version.AcceptRequest()
            .withNamespaceName("namespace1")
            .withVersionName("eula")
            .withAccessToken("$access_token_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.accept(
        version.AcceptRequest()
            .with_namespace_name(self.hash1)
            .with_version_name('eula')
            .with_access_token(self.access_token_0001)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

api_result = client.accept({
    namespaceName='namespace1',
    versionName='eula',
    accessToken='$access_token_0001',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

現在のバージョンを承認

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
versionName string ~ 128文字 承認したバージョン名
accessToken string ~ 128文字 ユーザーID

Result

説明
item AcceptVersion 承認したバージョン

acceptByUserId

acceptByUserId

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.AcceptByUserId(
    &version.AcceptByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        VersionName: nil,
        UserId: pointy.String("user-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\AcceptByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->acceptByUserId(
        (new AcceptByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withVersionName(null)
            ->withUserId("user-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.AcceptByUserIdRequest;
import io.gs2.version.result.AcceptByUserIdResult;

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

try {
    AcceptByUserIdResult result = client.acceptByUserId(
        new AcceptByUserIdRequest()
            .withNamespaceName("namespace1")
            .withVersionName(null)
            .withUserId("user-0001")
    );
    AcceptVersion 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.AcceptByUserIdRequest;
using Gs2.Gs2Version.Result.AcceptByUserIdResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.acceptByUserId(
    new AcceptByUserIdRequest()
        .withNamespaceName("namespace1")
        .withVersionName(null)
        .withUserId("user-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.acceptByUserId(
        new Gs2Version.AcceptByUserIdRequest()
            .withNamespaceName("namespace1")
            .withVersionName(null)
            .withUserId("user-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.accept_by_user_id(
        version.AcceptByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_version_name(None)
            .with_user_id('user-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

api_result = client.accept_by_user_id({
    namespaceName='namespace1',
    versionName=nil,
    userId='user-0001',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ユーザIDを指定して現在のバージョンを承認

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
versionName string ~ 128文字 承認したバージョン名
userId string ~ 128文字 ユーザーID

Result

説明
item AcceptVersion 承認したバージョン

getAcceptVersion

getAcceptVersion

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.GetAcceptVersion(
    &version.GetAcceptVersionRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        VersionName: pointy.String("eula"),
    }
)
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\GetAcceptVersionRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getAcceptVersion(
        (new GetAcceptVersionRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withVersionName("eula")
    );
    $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.GetAcceptVersionRequest;
import io.gs2.version.result.GetAcceptVersionResult;

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

try {
    GetAcceptVersionResult result = client.getAcceptVersion(
        new GetAcceptVersionRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withVersionName("eula")
    );
    AcceptVersion 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.GetAcceptVersionRequest;
using Gs2.Gs2Version.Result.GetAcceptVersionResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getAcceptVersion(
    new GetAcceptVersionRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withVersionName("eula"),
    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.getAcceptVersion(
        new Gs2Version.GetAcceptVersionRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withVersionName("eula")
    );
    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_accept_version(
        version.GetAcceptVersionRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_version_name('eula')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

api_result = client.get_accept_version({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    versionName='eula',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

承認したバージョンを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
versionName string ~ 128文字 承認したバージョン名

Result

説明
item AcceptVersion 承認したバージョン

getAcceptVersionByUserId

getAcceptVersionByUserId

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.GetAcceptVersionByUserId(
    &version.GetAcceptVersionByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        VersionName: 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\GetAcceptVersionByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getAcceptVersionByUserId(
        (new GetAcceptVersionByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withVersionName(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.GetAcceptVersionByUserIdRequest;
import io.gs2.version.result.GetAcceptVersionByUserIdResult;

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

try {
    GetAcceptVersionByUserIdResult result = client.getAcceptVersionByUserId(
        new GetAcceptVersionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withVersionName(null)
    );
    AcceptVersion 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.GetAcceptVersionByUserIdRequest;
using Gs2.Gs2Version.Result.GetAcceptVersionByUserIdResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getAcceptVersionByUserId(
    new GetAcceptVersionByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001")
        .withVersionName(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.getAcceptVersionByUserId(
        new Gs2Version.GetAcceptVersionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withVersionName(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.get_accept_version_by_user_id(
        version.GetAcceptVersionByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_version_name(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

api_result = client.get_accept_version_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    versionName=nil,
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ユーザーIDを指定して承認したバージョンを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
versionName string ~ 128文字 承認したバージョン名

Result

説明
item AcceptVersion 承認したバージョン

deleteAcceptVersion

deleteAcceptVersion

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.DeleteAcceptVersion(
    &version.DeleteAcceptVersionRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        VersionName: pointy.String("eula"),
    }
)
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\DeleteAcceptVersionRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteAcceptVersion(
        (new DeleteAcceptVersionRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withVersionName("eula")
    );
    $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.DeleteAcceptVersionRequest;
import io.gs2.version.result.DeleteAcceptVersionResult;

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

try {
    DeleteAcceptVersionResult result = client.deleteAcceptVersion(
        new DeleteAcceptVersionRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withVersionName("eula")
    );
    AcceptVersion 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.DeleteAcceptVersionRequest;
using Gs2.Gs2Version.Result.DeleteAcceptVersionResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteAcceptVersion(
    new DeleteAcceptVersionRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withVersionName("eula"),
    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.deleteAcceptVersion(
        new Gs2Version.DeleteAcceptVersionRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withVersionName("eula")
    );
    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_accept_version(
        version.DeleteAcceptVersionRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_version_name('eula')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

api_result = client.delete_accept_version({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    versionName='eula',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

承認したバージョンを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
versionName string ~ 128文字 承認したバージョン名

Result

説明
item AcceptVersion 削除した承認バージョン

deleteAcceptVersionByUserId

deleteAcceptVersionByUserId

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.DeleteAcceptVersionByUserId(
    &version.DeleteAcceptVersionByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        VersionName: 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\DeleteAcceptVersionByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteAcceptVersionByUserId(
        (new DeleteAcceptVersionByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withVersionName(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.DeleteAcceptVersionByUserIdRequest;
import io.gs2.version.result.DeleteAcceptVersionByUserIdResult;

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

try {
    DeleteAcceptVersionByUserIdResult result = client.deleteAcceptVersionByUserId(
        new DeleteAcceptVersionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withVersionName(null)
    );
    AcceptVersion 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.DeleteAcceptVersionByUserIdRequest;
using Gs2.Gs2Version.Result.DeleteAcceptVersionByUserIdResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteAcceptVersionByUserId(
    new DeleteAcceptVersionByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001")
        .withVersionName(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.deleteAcceptVersionByUserId(
        new Gs2Version.DeleteAcceptVersionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withVersionName(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.delete_accept_version_by_user_id(
        version.DeleteAcceptVersionByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_version_name(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

api_result = client.delete_accept_version_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    versionName=nil,
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ユーザーIDを指定して承認したバージョンを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
versionName string ~ 128文字 承認したバージョン名

Result

説明
item AcceptVersion 削除した承認バージョン

checkVersion

checkVersion

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.CheckVersion(
    &version.CheckVersionRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        TargetVersions: []version.TargetVersion{
            {'versionName': 'app', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
        {'versionName': 'asset', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
        },
    }
)
if err != nil {
    panic("error occurred")
}
projectToken := result.ProjectToken
warnings := result.Warnings
errors := result.Errors
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\CheckVersionRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkVersion(
        (new CheckVersionRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withTargetVersions([    {'versionName': 'app', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
            {'versionName': 'asset', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
            ])
    );
    $projectToken = $result->getProjectToken();
    $warnings = $result->getWarnings();
    $errors = $result->getErrors();
} 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.CheckVersionRequest;
import io.gs2.version.result.CheckVersionResult;

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

try {
    CheckVersionResult result = client.checkVersion(
        new CheckVersionRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withTargetVersions(Arrays.asList(
                {'versionName': 'app', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
            {'versionName': 'asset', 'version': {'major': 1, 'minor': 2, 'micro': 3}}
            ))
    );
    String projectToken = result.getProjectToken();
    List<Status> warnings = result.getWarnings();
    List<Status> errors = result.getErrors();
} 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.CheckVersionRequest;
using Gs2.Gs2Version.Result.CheckVersionResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.checkVersion(
    new CheckVersionRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withTargetVersions(new Gs2.Gs2Version.Model.TargetVersion[] {
            {'versionName': 'app', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
        {'versionName': 'asset', 'version': {'major': 1, 'minor': 2, 'micro': 3}}
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var projectToken = result.ProjectToken;
var warnings = result.Warnings;
var errors = result.Errors;
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.checkVersion(
        new Gs2Version.CheckVersionRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withTargetVersions([
                {'versionName': 'app', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
            {'versionName': 'asset', 'version': {'major': 1, 'minor': 2, 'micro': 3}}
            ])
    );
    const projectToken = result.getProjectToken();
    const warnings = result.getWarnings();
    const errors = result.getErrors();
} 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_version(
        version.CheckVersionRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_target_versions([    {'versionName': 'app', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
            {'versionName': 'asset', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
            ])
    )
    project_token = result.project_token
    warnings = result.warnings
    errors = result.errors
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

api_result = client.check_version({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    targetVersions={
        {'versionName': 'app', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
    {'versionName': 'asset', 'version': {'major': 1, 'minor': 2, 'micro': 3}}
    },
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
projectToken = result.projectToken;
warnings = result.warnings;
errors = result.errors;

バージョンチェック

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
targetVersions TargetVersion[] [] 検証するバージョンリスト

Result

説明
projectToken string プロジェクトトークン
warnings Status[] バージョンの検証結果 警告のリスト
errors Status[] バージョンの検証結果 エラーのリスト

checkVersionByUserId

checkVersionByUserId

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.CheckVersionByUserId(
    &version.CheckVersionByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        TargetVersions: []version.TargetVersion{
            {'versionName': 'app', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
        {'versionName': 'asset', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
        },
    }
)
if err != nil {
    panic("error occurred")
}
projectToken := result.ProjectToken
warnings := result.Warnings
errors := result.Errors
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\CheckVersionByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkVersionByUserId(
        (new CheckVersionByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withTargetVersions([    {'versionName': 'app', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
            {'versionName': 'asset', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
            ])
    );
    $projectToken = $result->getProjectToken();
    $warnings = $result->getWarnings();
    $errors = $result->getErrors();
} 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.CheckVersionByUserIdRequest;
import io.gs2.version.result.CheckVersionByUserIdResult;

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

try {
    CheckVersionByUserIdResult result = client.checkVersionByUserId(
        new CheckVersionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withTargetVersions(Arrays.asList(
                {'versionName': 'app', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
            {'versionName': 'asset', 'version': {'major': 1, 'minor': 2, 'micro': 3}}
            ))
    );
    String projectToken = result.getProjectToken();
    List<Status> warnings = result.getWarnings();
    List<Status> errors = result.getErrors();
} 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.CheckVersionByUserIdRequest;
using Gs2.Gs2Version.Result.CheckVersionByUserIdResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.checkVersionByUserId(
    new CheckVersionByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001")
        .withTargetVersions(new Gs2.Gs2Version.Model.TargetVersion[] {
            {'versionName': 'app', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
        {'versionName': 'asset', 'version': {'major': 1, 'minor': 2, 'micro': 3}}
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var projectToken = result.ProjectToken;
var warnings = result.Warnings;
var errors = result.Errors;
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.checkVersionByUserId(
        new Gs2Version.CheckVersionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withTargetVersions([
                {'versionName': 'app', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
            {'versionName': 'asset', 'version': {'major': 1, 'minor': 2, 'micro': 3}}
            ])
    );
    const projectToken = result.getProjectToken();
    const warnings = result.getWarnings();
    const errors = result.getErrors();
} 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_version_by_user_id(
        version.CheckVersionByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_target_versions([    {'versionName': 'app', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
            {'versionName': 'asset', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
            ])
    )
    project_token = result.project_token
    warnings = result.warnings
    errors = result.errors
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

api_result = client.check_version_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    targetVersions={
        {'versionName': 'app', 'version': {'major': 1, 'minor': 2, 'micro': 3}},
    {'versionName': 'asset', 'version': {'major': 1, 'minor': 2, 'micro': 3}}
    },
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
projectToken = result.projectToken;
warnings = result.warnings;
errors = result.errors;

ユーザーIDを指定してバージョンチェック

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
targetVersions TargetVersion[] [] 検証するバージョンリスト

Result

説明
projectToken string プロジェクトトークン
warnings Status[] バージョンの検証結果 警告のリスト
errors Status[] バージョンの検証結果 エラーのリスト

calculateSignature

calculateSignature

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.CalculateSignature(
    &version.CalculateSignatureRequest {
        NamespaceName: pointy.String("namespace1"),
        VersionName: pointy.String("version-0001"),
        Version: {'major': 1, 'minor': 2, 'micro': 3},
    }
)
if err != nil {
    panic("error occurred")
}
body := result.Body
signature := result.Signature
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\CalculateSignatureRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->calculateSignature(
        (new CalculateSignatureRequest())
            ->withNamespaceName(self::namespace1)
            ->withVersionName("version-0001")
            ->withVersion({'major': 1, 'minor': 2, 'micro': 3})
    );
    $body = $result->getBody();
    $signature = $result->getSignature();
} 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.CalculateSignatureRequest;
import io.gs2.version.result.CalculateSignatureResult;

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

try {
    CalculateSignatureResult result = client.calculateSignature(
        new CalculateSignatureRequest()
            .withNamespaceName("namespace1")
            .withVersionName("version-0001")
            .withVersion({'major': 1, 'minor': 2, 'micro': 3})
    );
    String body = result.getBody();
    String signature = result.getSignature();
} 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.CalculateSignatureRequest;
using Gs2.Gs2Version.Result.CalculateSignatureResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.calculateSignature(
    new CalculateSignatureRequest()
        .withNamespaceName("namespace1")
        .withVersionName("version-0001")
        .withVersion({'major': 1, 'minor': 2, 'micro': 3}),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var body = result.Body;
var signature = result.Signature;
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.calculateSignature(
        new Gs2Version.CalculateSignatureRequest()
            .withNamespaceName("namespace1")
            .withVersionName("version-0001")
            .withVersion({'major': 1, 'minor': 2, 'micro': 3})
    );
    const body = result.getBody();
    const signature = result.getSignature();
} 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.calculate_signature(
        version.CalculateSignatureRequest()
            .with_namespace_name(self.hash1)
            .with_version_name('version-0001')
            .with_version({'major': 1, 'minor': 2, 'micro': 3})
    )
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

api_result = client.calculate_signature({
    namespaceName='namespace1',
    versionName='version-0001',
    version={'major': 1, 'minor': 2, 'micro': 3},
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
body = result.body;
signature = result.signature;

バージョンの署名を計算する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
versionName string ~ 128文字 バージョンモデル名
version Version_ バージョン

Result

説明
body string ボディ
signature string 署名

exportMaster

exportMaster

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.ExportMaster(
    &version.ExportMasterRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\ExportMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentVersionMaster 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.ExportMasterRequest;
using Gs2.Gs2Version.Result.ExportMasterResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.exportMaster(
    new ExportMasterRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.exportMaster(
        new Gs2Version.ExportMasterRequest()
            .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.export_master(
        version.ExportMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

現在有効なバージョンのマスターデータをエクスポート

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item CurrentVersionMaster 現在有効なバージョン

getCurrentVersionMaster

getCurrentVersionMaster

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.GetCurrentVersionMaster(
    &version.GetCurrentVersionMasterRequest {
        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\GetCurrentVersionMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCurrentVersionMaster(
        (new GetCurrentVersionMasterRequest())
            ->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.GetCurrentVersionMasterRequest;
import io.gs2.version.result.GetCurrentVersionMasterResult;

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

try {
    GetCurrentVersionMasterResult result = client.getCurrentVersionMaster(
        new GetCurrentVersionMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentVersionMaster 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.GetCurrentVersionMasterRequest;
using Gs2.Gs2Version.Result.GetCurrentVersionMasterResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getCurrentVersionMaster(
    new GetCurrentVersionMasterRequest()
        .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.getCurrentVersionMaster(
        new Gs2Version.GetCurrentVersionMasterRequest()
            .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_current_version_master(
        version.GetCurrentVersionMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

api_result = client.get_current_version_master({
    namespaceName='namespace1',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

現在有効なバージョンを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item CurrentVersionMaster 現在有効なバージョン

updateCurrentVersionMaster

updateCurrentVersionMaster

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.UpdateCurrentVersionMaster(
    &version.UpdateCurrentVersionMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Settings: pointy.String("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\UpdateCurrentVersionMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentVersionMaster(
        (new UpdateCurrentVersionMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSettings("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.UpdateCurrentVersionMasterRequest;
import io.gs2.version.result.UpdateCurrentVersionMasterResult;

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

try {
    UpdateCurrentVersionMasterResult result = client.updateCurrentVersionMaster(
        new UpdateCurrentVersionMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}")
    );
    CurrentVersionMaster 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.UpdateCurrentVersionMasterRequest;
using Gs2.Gs2Version.Result.UpdateCurrentVersionMasterResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCurrentVersionMaster(
    new UpdateCurrentVersionMasterRequest()
        .withNamespaceName("namespace1")
        .withSettings("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.updateCurrentVersionMaster(
        new Gs2Version.UpdateCurrentVersionMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}")
    );
    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_current_version_master(
        version.UpdateCurrentVersionMasterRequest()
            .with_namespace_name(self.hash1)
            .with_settings('{\n  "version": "2019-10-09",\n  "versionModels": [\n    {\n      "name": "app",\n      "metadata": "APP",\n      "warningVersion": {\n        "major": 2,\n        "minor": 2,\n        "micro": 2\n      },\n      "errorVersion": {\n        "major": 1,\n        "minor": 1,\n        "micro": 1\n      },\n      "scope": "passive",\n      "needSignature": false\n    },\n    {\n      "name": "asset",\n      "metadata": "ASSET",\n      "warningVersion": {\n        "major": 3,\n        "minor": 3,\n        "micro": 3\n      },\n      "errorVersion": {\n        "major": 2,\n        "minor": 2,\n        "micro": 2\n      },\n      "scope": "passive",\n      "needSignature": true,\n      "signatureKeyId": "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001"\n    },\n    {\n      "name": "eula",\n      "metadata": "EULA",\n      "warningVersion": {\n        "major": 4,\n        "minor": 4,\n        "micro": 4\n      },\n      "errorVersion": {\n        "major": 3,\n        "minor": 3,\n        "micro": 3\n      },\n      "scope": "active",\n      "currentVersion": {\n        "major": 2,\n        "minor": 2,\n        "micro": 2\n      }\n    }\n  ]\n}')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

api_result = client.update_current_version_master({
    namespaceName='namespace1',
    settings='{\n  "version": "2019-10-09",\n  "versionModels": [\n    {\n      "name": "app",\n      "metadata": "APP",\n      "warningVersion": {\n        "major": 2,\n        "minor": 2,\n        "micro": 2\n      },\n      "errorVersion": {\n        "major": 1,\n        "minor": 1,\n        "micro": 1\n      },\n      "scope": "passive",\n      "needSignature": false\n    },\n    {\n      "name": "asset",\n      "metadata": "ASSET",\n      "warningVersion": {\n        "major": 3,\n        "minor": 3,\n        "micro": 3\n      },\n      "errorVersion": {\n        "major": 2,\n        "minor": 2,\n        "micro": 2\n      },\n      "scope": "passive",\n      "needSignature": true,\n      "signatureKeyId": "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001"\n    },\n    {\n      "name": "eula",\n      "metadata": "EULA",\n      "warningVersion": {\n        "major": 4,\n        "minor": 4,\n        "micro": 4\n      },\n      "errorVersion": {\n        "major": 3,\n        "minor": 3,\n        "micro": 3\n      },\n      "scope": "active",\n      "currentVersion": {\n        "major": 2,\n        "minor": 2,\n        "micro": 2\n      }\n    }\n  ]\n}',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

現在有効なバージョンを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
settings string ~ 5242880文字 マスターデータ

Result

説明
item CurrentVersionMaster 更新した現在有効なバージョン

updateCurrentVersionMasterFromGitHub

updateCurrentVersionMasterFromGitHub

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.UpdateCurrentVersionMasterFromGitHub(
    &version.UpdateCurrentVersionMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace1"),
        CheckoutSetting: {'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'},
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\UpdateCurrentVersionMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentVersionMasterFromGitHub(
        (new UpdateCurrentVersionMasterFromGitHubRequest())
            ->withNamespaceName(self::namespace1)
            ->withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.UpdateCurrentVersionMasterFromGitHubRequest;
import io.gs2.version.result.UpdateCurrentVersionMasterFromGitHubResult;

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

try {
    UpdateCurrentVersionMasterFromGitHubResult result = client.updateCurrentVersionMasterFromGitHub(
        new UpdateCurrentVersionMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    CurrentVersionMaster 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.UpdateCurrentVersionMasterFromGitHubRequest;
using Gs2.Gs2Version.Result.UpdateCurrentVersionMasterFromGitHubResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCurrentVersionMasterFromGitHub(
    new UpdateCurrentVersionMasterFromGitHubRequest()
        .withNamespaceName("namespace1")
        .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'}),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.updateCurrentVersionMasterFromGitHub(
        new Gs2Version.UpdateCurrentVersionMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    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_current_version_master_from_git_hub(
        version.UpdateCurrentVersionMasterFromGitHubRequest()
            .with_namespace_name(self.hash1)
            .with_checkout_setting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('version')

api_result = client.update_current_version_master_from_git_hub({
    namespaceName='namespace1',
    checkoutSetting={'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'},
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

現在有効なバージョンを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
checkoutSetting GitHubCheckoutSetting GitHubからマスターデータをチェックアウトしてくる設定

Result

説明
item CurrentVersionMaster 更新した現在有効なバージョン