GS2-Formation SDK API リファレンス

モデル

Namespace

ネームスペース

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

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

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字ネームスペースGRN
namestring~ 32文字ネームスペース名
descriptionstring~ 1024文字説明文
transactionSettingTransactionSettingトランザクション設定
updateMoldScriptScriptSettingキャパシティを更新するときに実行するスクリプト
updateFormScriptScriptSettingフォームを更新するときに実行するスクリプト
logSettingLogSettingログの出力設定
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

FormModel

編成モデル

編成状況を表すエンティティです。 編成できる領域として スロット を定義できます。

武器・防具 であれば 「右手」「左手」「胴」「腕」のような部位をスロットとし、 パーティであれば「前衛」「中衛」「後衛」のようなポジションをスロットとして表現できます。

有効化条件必須デフォルト値の制限説明
formModelIdstring~ 1024文字フォームモデルGRN
namestring~ 128文字編成名
metadatastring~ 2048文字メタデータ
slotsList<SlotModel>スロットモデルリスト

FormModelMaster

編成モデルマスター

編成状況を表すエンティティです。 編成できる領域として スロット を定義できます。

武器・防具 であれば 「右手」「左手」「胴」「腕」のような部位をスロットとし、 パーティであれば「前衛」「中衛」「後衛」のようなポジションをスロットとして表現できます。

有効化条件必須デフォルト値の制限説明
formModelIdstring~ 1024文字フォームマスターGRN
namestring~ 128文字フォーム名
descriptionstring~ 1024文字説明文
metadatastring~ 2048文字メタデータ
slotsList<SlotModel>スロットモデルリスト
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

MoldModel

編成の情報を保存する領域

パーティ編成であれば「火属性パーティ」「水属性パーティ」のような形で保存することを想定しています。 保存できる領域の数は制限することができ、個別に拡張することもできます。

有効化条件必須デフォルト値の制限説明
moldModelIdstring~ 1024文字フォームの保存領域GRN
namestring~ 128文字編成モデル名
metadatastring~ 2048文字メタデータ
initialMaxCapacityint1 ~ 2147483646フォームを保存できる初期キャパシティ
maxCapacityint1 ~ 2147483646フォームを保存できる最大キャパシティ
formModelFormModel

MoldModelMaster

編成の情報を保存する領域マスター

パーティ編成であれば「火属性パーティ」「水属性パーティ」のような形で保存することを想定しています。 保存できる領域の数は制限することができ、個別に拡張することもできます。

有効化条件必須デフォルト値の制限説明
moldModelIdstring~ 1024文字フォームの保存領域マスターGRN
namestring~ 128文字編成モデル名
descriptionstring~ 1024文字説明文
metadatastring~ 2048文字メタデータ
initialMaxCapacityint1 ~ 2147483646フォームを保存できる初期キャパシティ
maxCapacityint1 ~ 2147483646フォームを保存できる最大キャパシティ
formModelNamestring~ 128文字保存するフォーム
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

PropertyFormModel

編成モデル

編成状況を表すエンティティです。 編成できる領域として スロット を定義できます。

武器・防具 であれば 「右手」「左手」「胴」「腕」のような部位をスロットとし、 パーティであれば「前衛」「中衛」「後衛」のようなポジションをスロットとして表現できます。

有効化条件必須デフォルト値の制限説明
propertyFormModelIdstring~ 1024文字プロパティフォームモデルGRN
namestring~ 128文字編成名
metadatastring~ 2048文字メタデータ
slotsList<SlotModel>スロットモデルリスト

PropertyFormModelMaster

編成モデルマスター

編成状況を表すエンティティです。 編成できる領域として スロット を定義できます。

武器・防具 であれば 「右手」「左手」「胴」「腕」のような部位をスロットとし、 パーティであれば「前衛」「中衛」「後衛」のようなポジションをスロットとして表現できます。

有効化条件必須デフォルト値の制限説明
propertyFormModelIdstring~ 1024文字プロパティフォームマスターGRN
namestring~ 128文字フォーム名
descriptionstring~ 1024文字説明文
metadatastring~ 2048文字メタデータ
slotsList<SlotModel>スロットモデルリスト
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

CurrentFormMaster

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

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

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

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

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

Mold

保存したフォーム

ゲームプレイヤーが編成した情報を保持するエンティティです。 編成情報(Form) は 編成モデル(Mold) ごとに複数保持することができ、いくつ保持できるかのキャパシティをゲームプレイヤー×編成モデル ごとに個別に設定できます。

有効化条件必須デフォルト値の制限説明
moldIdstring~ 1024文字保存したフォームGRN
namestring~ 128文字編成モデルの名前
userIdstring~ 128文字ユーザーID
capacityint~ 2147483646現在のキャパシティ
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

Form

編成

編成状況を表すエンティティです。 編成できる領域として スロット を定義できます。

武器・防具 であれば 「右手」「左手」「胴」「腕」のような部位をスロットとし、 パーティであれば「前衛」「中衛」「後衛」のようなポジションをスロットとして表現できます。

有効化条件必須デフォルト値の制限説明
formIdstring~ 1024文字フォームGRN
namestring~ 128文字編成の名前
indexint~ 2147483646保存領域のインデックス
slotsList<Slot>スロットリスト
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

PropertyForm

プロパティ編成

有効化条件必須デフォルト値の制限説明
formIdstring~ 1024文字プロパティフォームGRN
userIdstring~ 128文字ユーザーID
namestring~ 128文字編成の名前
propertyIdstring~ 1024文字プロパティID
slotsList<Slot>スロットリスト
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン

Slot

有効化条件必須デフォルト値の制限説明
namestring~ 128文字スロットモデル名
propertyIdstring~ 1024文字プロパティID
metadatastring~ 1024文字メタデータ

SlotModel

有効化条件必須デフォルト値の制限説明
namestring~ 128文字スロットモデル名
propertyRegexstring“.*”~ 512文字プロパティとして設定可能な値の正規表現
metadatastring~ 512文字メタデータ

SlotWithSignature

有効化条件必須デフォルト値の制限説明
namestring~ 128文字スロットモデル名
propertyTypeenum [‘gs2_inventory’, ‘gs2_simple_inventory’, ‘gs2_dictionary’]~ 128文字プロパティの種類
bodystring~ 1048576文字ペイロード
signaturestring~ 1024文字プロパティIDのリソースを所有していることを証明する署名
metadatastring~ 1024文字メタデータ

AcquireAction

有効化条件必須デフォルト値の制限説明
actionenum []~ 128文字スタンプシートを使用して実行するアクションの種類
requeststring~ 1048576文字リクエストのJSON

AcquireActionConfig

有効化条件必須デフォルト値の制限説明
nameenum []~ 128文字スタンプシートを使用して実行するアクションの種類
configList<Config>[]スタンプシートに使用するコンフィグ

Config

有効化条件必須デフォルト値の制限説明
keystring~ 64文字名前
valuestring~ 51200文字

GitHubCheckoutSetting

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

ScriptSetting

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

LogSetting

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

TransactionSetting

有効化条件必須デフォルト値の制限説明
enableAutoRunboolfalse発行したスタンプシートをサーバーサイドで自動的に実行するか
distributorNamespaceIdstring{enableAutoRun}~ 1024文字スタンプシートの実行に使用する GS2-Distributor ネームスペース
keyIdstring!{enableAutoRun}~ 1024文字スタンプシートの署名に使用する GS2-Key の暗号鍵
queueNamespaceIdstring~ 1024文字スタンプシートの実行に使用する GS2-JobQueue のネームスペース

メソッド

describeNamespaces

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

Request

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

Result

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

実装例

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

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

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

AsyncResult<Gs2.Gs2Formation.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Formation.Request.DescribeNamespacesRequest()
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Formation from '@/gs2/formation';

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

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

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

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

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

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

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

createNamespace

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

Request

有効化条件必須デフォルト値の制限説明
namestring~ 32文字ネームスペース名
descriptionstring~ 1024文字説明文
transactionSettingTransactionSettingトランザクション設定
updateMoldScriptScriptSettingキャパシティを更新するときに実行するスクリプト
updateFormScriptScriptSettingフォームを更新するときに実行するスクリプト
logSettingLogSettingログの出力設定

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/formation"
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 := formation.Gs2FormationRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &formation.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        TransactionSetting: &formation.TransactionSetting{
            EnableAutoRun: pointy.Bool(false),
            QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"),
            KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"),
        },
        UpdateMoldScript: nil,
        UpdateFormScript: nil,
        LogSetting: &formation.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\Formation\Gs2FormationRestClient;
use Gs2\Formation\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)
            ->withTransactionSetting((new \Gs2\Formation\Model\TransactionSetting())
                ->withEnableAutoRun(False)
                ->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
                ->withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:\namespace1:key:key-0001"))
            ->withUpdateMoldScript(null)
            ->withUpdateFormScript(null)
            ->withLogSetting((new \Gs2\Formation\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.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.CreateNamespaceRequest;
import io.gs2.formation.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withTransactionSetting(new io.gs2.formation.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
                .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
            .withUpdateMoldScript(null)
            .withUpdateFormScript(null)
            .withLogSetting(new io.gs2.formation.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.Gs2Formation.Gs2FormationRestClient;
using Gs2.Gs2Formation.Request.CreateNamespaceRequest;
using Gs2.Gs2Formation.Result.CreateNamespaceResult;

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

AsyncResult<Gs2.Gs2Formation.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Formation.Request.CreateNamespaceRequest()
        .WithName("namespace1")
        .WithDescription(null)
        .WithTransactionSetting(new Gs2.Gs2Formation.Model.TransactionSetting()
            .WithEnableAutoRun(false)
            .WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
            .WithKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
        .WithUpdateMoldScript(null)
        .WithUpdateFormScript(null)
        .WithLogSetting(new Gs2.Gs2Formation.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 Gs2Formation from '@/gs2/formation';

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

try {
    const result = await client.createNamespace(
        new Gs2Formation.CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withTransactionSetting(new Gs2Formation.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
                .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
            .withUpdateMoldScript(null)
            .withUpdateFormScript(null)
            .withLogSetting(new Gs2Formation.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 formation

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

try:
    result = client.create_namespace(
        formation.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_transaction_setting(
                formation.TransactionSetting()
                    .with_enable_auto_run(False)
                    .with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001')
                    .with_key_id('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001'))
            .with_update_mold_script(None)
            .with_update_form_script(None)
            .with_log_setting(
                formation.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('formation')

api_result = client.create_namespace({
    name='namespace1',
    description=nil,
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001',
        keyId='grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001',
    },
    updateMoldScript=nil,
    updateFormScript=nil,
    logSetting={
        loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1',
    },
})

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

result = api_result.result
item = result.item;

getNamespaceStatus

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

Request

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

Result

説明
statusstring

実装例

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

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

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

AsyncResult<Gs2.Gs2Formation.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Formation.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as Gs2Formation from '@/gs2/formation';

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

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

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

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

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

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

result = api_result.result
status = result.status;

getNamespace

ネームスペースを取得

Request

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

Result

説明
itemNamespaceネームスペース

実装例

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

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

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

AsyncResult<Gs2.Gs2Formation.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Formation.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Formation from '@/gs2/formation';

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

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

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

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

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

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

result = api_result.result
item = result.item;

updateNamespace

ネームスペースを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
descriptionstring~ 1024文字説明文
transactionSettingTransactionSettingトランザクション設定
updateMoldScriptScriptSettingキャパシティを更新するときに実行するスクリプト
updateFormScriptScriptSettingフォームを更新するときに実行するスクリプト
logSettingLogSettingログの出力設定

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/formation"
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 := formation.Gs2FormationRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &formation.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        TransactionSetting: &formation.TransactionSetting{
            EnableAutoRun: pointy.Bool(false),
            QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"),
            KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"),
        },
        UpdateMoldScript: nil,
        UpdateFormScript: nil,
        LogSetting: &formation.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\Formation\Gs2FormationRestClient;
use Gs2\Formation\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")
            ->withTransactionSetting((new \Gs2\Formation\Model\TransactionSetting())
                ->withEnableAutoRun(False)
                ->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
                ->withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:\namespace1:key:key-0002"))
            ->withUpdateMoldScript(null)
            ->withUpdateFormScript(null)
            ->withLogSetting((new \Gs2\Formation\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.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.UpdateNamespaceRequest;
import io.gs2.formation.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withTransactionSetting(new io.gs2.formation.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
                .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
            .withUpdateMoldScript(null)
            .withUpdateFormScript(null)
            .withLogSetting(new io.gs2.formation.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.Gs2Formation.Gs2FormationRestClient;
using Gs2.Gs2Formation.Request.UpdateNamespaceRequest;
using Gs2.Gs2Formation.Result.UpdateNamespaceResult;

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

AsyncResult<Gs2.Gs2Formation.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Formation.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace1")
        .WithDescription("description1")
        .WithTransactionSetting(new Gs2.Gs2Formation.Model.TransactionSetting()
            .WithEnableAutoRun(false)
            .WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
            .WithKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
        .WithUpdateMoldScript(null)
        .WithUpdateFormScript(null)
        .WithLogSetting(new Gs2.Gs2Formation.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 Gs2Formation from '@/gs2/formation';

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

try {
    const result = await client.updateNamespace(
        new Gs2Formation.UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withTransactionSetting(new Gs2Formation.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
                .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
            .withUpdateMoldScript(null)
            .withUpdateFormScript(null)
            .withLogSetting(new Gs2Formation.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 formation

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

try:
    result = client.update_namespace(
        formation.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_transaction_setting(
                formation.TransactionSetting()
                    .with_enable_auto_run(False)
                    .with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002')
                    .with_key_id('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002'))
            .with_update_mold_script(None)
            .with_update_form_script(None)
            .with_log_setting(
                formation.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('formation')

api_result = client.update_namespace({
    namespaceName='namespace1',
    description='description1',
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002',
        keyId='grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002',
    },
    updateMoldScript=nil,
    updateFormScript=nil,
    logSetting={
        loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1',
    },
})

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

result = api_result.result
item = result.item;

deleteNamespace

ネームスペースを削除

Request

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

Result

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

実装例

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

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

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

AsyncResult<Gs2.Gs2Formation.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Formation.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Formation from '@/gs2/formation';

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

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

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

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

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

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

result = api_result.result
item = result.item;

getFormModel

フォームを取得

Request

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

Result

説明
itemFormModelフォーム

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/formation"
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 := formation.Gs2FormationRestClient{
    Session: &session,
}
result, err := client.GetFormModel(
    &formation.GetFormModelRequest {
        NamespaceName: pointy.String("namespace1"),
        MoldModelName: pointy.String("mold-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\Formation\Gs2FormationRestClient;
use Gs2\Formation\Request\GetFormModelRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getFormModel(
        (new GetFormModelRequest())
            ->withNamespaceName(self::namespace1)
            ->withMoldModelName("mold-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.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.GetFormModelRequest;
import io.gs2.formation.result.GetFormModelResult;

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

try {
    GetFormModelResult result = client.getFormModel(
        new GetFormModelRequest()
            .withNamespaceName("namespace1")
            .withMoldModelName("mold-0001")
    );
    FormModel 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.Gs2Formation.Gs2FormationRestClient;
using Gs2.Gs2Formation.Request.GetFormModelRequest;
using Gs2.Gs2Formation.Result.GetFormModelResult;

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

AsyncResult<Gs2.Gs2Formation.Result.GetFormModelResult> asyncResult = null;
yield return client.GetFormModel(
    new Gs2.Gs2Formation.Request.GetFormModelRequest()
        .WithNamespaceName("namespace1")
        .WithMoldModelName("mold-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 Gs2Formation from '@/gs2/formation';

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

try {
    const result = await client.getFormModel(
        new Gs2Formation.GetFormModelRequest()
            .withNamespaceName("namespace1")
            .withMoldModelName("mold-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import formation

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

try:
    result = client.get_form_model(
        formation.GetFormModelRequest()
            .with_namespace_name(self.hash1)
            .with_mold_model_name('mold-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('formation')

api_result = client.get_form_model({
    namespaceName='namespace1',
    moldModelName='mold-0001',
})

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

result = api_result.result
item = result.item;

describeFormModelMasters

フォームモデルマスターの一覧を取得

Request

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

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/formation"
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 := formation.Gs2FormationRestClient{
    Session: &session,
}
result, err := client.DescribeFormModelMasters(
    &formation.DescribeFormModelMastersRequest {
        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\Formation\Gs2FormationRestClient;
use Gs2\Formation\Request\DescribeFormModelMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeFormModelMasters(
        (new DescribeFormModelMastersRequest())
            ->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.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.DescribeFormModelMastersRequest;
import io.gs2.formation.result.DescribeFormModelMastersResult;

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

try {
    DescribeFormModelMastersResult result = client.describeFormModelMasters(
        new DescribeFormModelMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<FormModelMaster> 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.Gs2Formation.Gs2FormationRestClient;
using Gs2.Gs2Formation.Request.DescribeFormModelMastersRequest;
using Gs2.Gs2Formation.Result.DescribeFormModelMastersResult;

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

AsyncResult<Gs2.Gs2Formation.Result.DescribeFormModelMastersResult> asyncResult = null;
yield return client.DescribeFormModelMasters(
    new Gs2.Gs2Formation.Request.DescribeFormModelMastersRequest()
        .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 Gs2Formation from '@/gs2/formation';

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

try {
    const result = await client.describeFormModelMasters(
        new Gs2Formation.DescribeFormModelMastersRequest()
            .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 formation

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

try:
    result = client.describe_form_model_masters(
        formation.DescribeFormModelMastersRequest()
            .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('formation')

api_result = client.describe_form_model_masters({
    namespaceName='namespace1',
    pageToken=nil,
    limit=nil,
})

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

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

createFormModelMaster

フォームモデルマスターを新規作成

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
namestring~ 128文字フォーム名
descriptionstring~ 1024文字説明文
metadatastring~ 2048文字メタデータ
slotsList<SlotModel>スロットモデルリスト

Result

説明
itemFormModelMaster作成したフォームモデルマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/formation"
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 := formation.Gs2FormationRestClient{
    Session: &session,
}
result, err := client.CreateFormModelMaster(
    &formation.CreateFormModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("form-0001"),
        Description: nil,
        Metadata: nil,
        Slots: []formation.SlotModel{
            formation.SlotModel{
                Name: pointy.String("slot-0001"),
                PropertyRegex: pointy.String(".*"),
            },
        formation.SlotModel{
                Name: pointy.String("slot-0002"),
                PropertyRegex: pointy.String(".*"),
                Metadata: pointy.String("METADATA_0002"),
            },
        },
    }
)
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\Formation\Gs2FormationRestClient;
use Gs2\Formation\Request\CreateFormModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createFormModelMaster(
        (new CreateFormModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("form-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withSlots([    (new \Gs2\Formation\Model\SlotModel())
                ->withName("slot-0001")
                ->withPropertyRegex(".*"),
            (new \Gs2\Formation\Model\SlotModel())
                ->withName("slot-0002")
                ->withPropertyRegex(".*")
                ->withMetadata("METADATA_0002"),
            ])
    );
    $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.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.CreateFormModelMasterRequest;
import io.gs2.formation.result.CreateFormModelMasterResult;

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

try {
    CreateFormModelMasterResult result = client.createFormModelMaster(
        new CreateFormModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("form-0001")
            .withDescription(null)
            .withMetadata(null)
            .withSlots(Arrays.asList(
                new io.gs2.formation.model.SlotModel()
                    .withName("slot-0001")
                    .withPropertyRegex(".*"),
            new io.gs2.formation.model.SlotModel()
                    .withName("slot-0002")
                    .withPropertyRegex(".*")
                    .withMetadata("METADATA_0002")
            ))
    );
    FormModelMaster 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.Gs2Formation.Gs2FormationRestClient;
using Gs2.Gs2Formation.Request.CreateFormModelMasterRequest;
using Gs2.Gs2Formation.Result.CreateFormModelMasterResult;

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

AsyncResult<Gs2.Gs2Formation.Result.CreateFormModelMasterResult> asyncResult = null;
yield return client.CreateFormModelMaster(
    new Gs2.Gs2Formation.Request.CreateFormModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithName("form-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithSlots(new Gs2.Gs2Formation.Model.SlotModel[] {
            new Gs2.Gs2Formation.Model.SlotModel()
                .WithName("slot-0001")
                .WithPropertyRegex(".*"),
        new Gs2.Gs2Formation.Model.SlotModel()
                .WithName("slot-0002")
                .WithPropertyRegex(".*")
                .WithMetadata("METADATA_0002")
        }),
    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 Gs2Formation from '@/gs2/formation';

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

try {
    const result = await client.createFormModelMaster(
        new Gs2Formation.CreateFormModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("form-0001")
            .withDescription(null)
            .withMetadata(null)
            .withSlots([
                new Gs2Formation.model.SlotModel()
                    .withName("slot-0001")
                    .withPropertyRegex(".*"),
            new Gs2Formation.model.SlotModel()
                    .withName("slot-0002")
                    .withPropertyRegex(".*")
                    .withMetadata("METADATA_0002")
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import formation

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

try:
    result = client.create_form_model_master(
        formation.CreateFormModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('form-0001')
            .with_description(None)
            .with_metadata(None)
            .with_slots([    formation.SlotModel()
                .with_name('slot-0001')
                .with_property_regex('.*'),
            formation.SlotModel()
                .with_name('slot-0002')
                .with_property_regex('.*')
                .with_metadata('METADATA_0002'),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('formation')

api_result = client.create_form_model_master({
    namespaceName='namespace1',
    name='form-0001',
    description=nil,
    metadata=nil,
    slots={
        {
            name='slot-0001',
            propertyRegex='.*',
        },
    {
            name='slot-0002',
            propertyRegex='.*',
            metadata='METADATA_0002',
        }
    },
})

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

result = api_result.result
item = result.item;

getFormModelMaster

フォームモデルマスターを取得

Request

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

Result

説明
itemFormModelMasterフォームモデルマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/formation"
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 := formation.Gs2FormationRestClient{
    Session: &session,
}
result, err := client.GetFormModelMaster(
    &formation.GetFormModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        FormModelName: pointy.String("form-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\Formation\Gs2FormationRestClient;
use Gs2\Formation\Request\GetFormModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getFormModelMaster(
        (new GetFormModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withFormModelName("form-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.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.GetFormModelMasterRequest;
import io.gs2.formation.result.GetFormModelMasterResult;

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

try {
    GetFormModelMasterResult result = client.getFormModelMaster(
        new GetFormModelMasterRequest()
            .withNamespaceName("namespace1")
            .withFormModelName("form-0001")
    );
    FormModelMaster 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.Gs2Formation.Gs2FormationRestClient;
using Gs2.Gs2Formation.Request.GetFormModelMasterRequest;
using Gs2.Gs2Formation.Result.GetFormModelMasterResult;

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

AsyncResult<Gs2.Gs2Formation.Result.GetFormModelMasterResult> asyncResult = null;
yield return client.GetFormModelMaster(
    new Gs2.Gs2Formation.Request.GetFormModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithFormModelName("form-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 Gs2Formation from '@/gs2/formation';

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

try {
    const result = await client.getFormModelMaster(
        new Gs2Formation.GetFormModelMasterRequest()
            .withNamespaceName("namespace1")
            .withFormModelName("form-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import formation

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

try:
    result = client.get_form_model_master(
        formation.GetFormModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_form_model_name('form-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('formation')

api_result = client.get_form_model_master({
    namespaceName='namespace1',
    formModelName='form-0001',
})

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

result = api_result.result
item = result.item;

updateFormModelMaster

フォームモデルマスターを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
formModelNamestring~ 128文字フォーム名
descriptionstring~ 1024文字説明文
metadatastring~ 2048文字メタデータ
slotsList<SlotModel>スロットモデルリスト

Result

説明
itemFormModelMaster更新したフォームモデルマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/formation"
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 := formation.Gs2FormationRestClient{
    Session: &session,
}
result, err := client.UpdateFormModelMaster(
    &formation.UpdateFormModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        FormModelName: pointy.String("form-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("FORM_0001"),
        Slots: []formation.SlotModel{
            formation.SlotModel{
                Name: pointy.String("slot-1101"),
            },
        formation.SlotModel{
                Name: pointy.String("slot-1102"),
                Metadata: pointy.String("METADATA_1102"),
            },
        },
    }
)
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\Formation\Gs2FormationRestClient;
use Gs2\Formation\Request\UpdateFormModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateFormModelMaster(
        (new UpdateFormModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withFormModelName("form-0001")
            ->withDescription("description1")
            ->withMetadata("FORM_0001")
            ->withSlots([    (new \Gs2\Formation\Model\SlotModel())
                ->withName("slot-1101"),
            (new \Gs2\Formation\Model\SlotModel())
                ->withName("slot-1102")
                ->withMetadata("METADATA_1102"),
            ])
    );
    $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.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.UpdateFormModelMasterRequest;
import io.gs2.formation.result.UpdateFormModelMasterResult;

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

try {
    UpdateFormModelMasterResult result = client.updateFormModelMaster(
        new UpdateFormModelMasterRequest()
            .withNamespaceName("namespace1")
            .withFormModelName("form-0001")
            .withDescription("description1")
            .withMetadata("FORM_0001")
            .withSlots(Arrays.asList(
                new io.gs2.formation.model.SlotModel()
                    .withName("slot-1101"),
            new io.gs2.formation.model.SlotModel()
                    .withName("slot-1102")
                    .withMetadata("METADATA_1102")
            ))
    );
    FormModelMaster 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.Gs2Formation.Gs2FormationRestClient;
using Gs2.Gs2Formation.Request.UpdateFormModelMasterRequest;
using Gs2.Gs2Formation.Result.UpdateFormModelMasterResult;

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

AsyncResult<Gs2.Gs2Formation.Result.UpdateFormModelMasterResult> asyncResult = null;
yield return client.UpdateFormModelMaster(
    new Gs2.Gs2Formation.Request.UpdateFormModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithFormModelName("form-0001")
        .WithDescription("description1")
        .WithMetadata("FORM_0001")
        .WithSlots(new Gs2.Gs2Formation.Model.SlotModel[] {
            new Gs2.Gs2Formation.Model.SlotModel()
                .WithName("slot-1101"),
        new Gs2.Gs2Formation.Model.SlotModel()
                .WithName("slot-1102")
                .WithMetadata("METADATA_1102")
        }),
    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 Gs2Formation from '@/gs2/formation';

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

try {
    const result = await client.updateFormModelMaster(
        new Gs2Formation.UpdateFormModelMasterRequest()
            .withNamespaceName("namespace1")
            .withFormModelName("form-0001")
            .withDescription("description1")
            .withMetadata("FORM_0001")
            .withSlots([
                new Gs2Formation.model.SlotModel()
                    .withName("slot-1101"),
            new Gs2Formation.model.SlotModel()
                    .withName("slot-1102")
                    .withMetadata("METADATA_1102")
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import formation

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

try:
    result = client.update_form_model_master(
        formation.UpdateFormModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_form_model_name('form-0001')
            .with_description('description1')
            .with_metadata('FORM_0001')
            .with_slots([    formation.SlotModel()
                .with_name('slot-1101'),
            formation.SlotModel()
                .with_name('slot-1102')
                .with_metadata('METADATA_1102'),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('formation')

api_result = client.update_form_model_master({
    namespaceName='namespace1',
    formModelName='form-0001',
    description='description1',
    metadata='FORM_0001',
    slots={
        {
            name='slot-1101',
        },
    {
            name='slot-1102',
            metadata='METADATA_1102',
        }
    },
})

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

result = api_result.result
item = result.item;

deleteFormModelMaster

フォームモデルマスターを削除

Request

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

Result

説明
itemFormModelMaster削除したフォームモデルマスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/formation"
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 := formation.Gs2FormationRestClient{
    Session: &session,
}
result, err := client.DeleteFormModelMaster(
    &formation.DeleteFormModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        FormModelName: pointy.String("form-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\Formation\Gs2FormationRestClient;
use Gs2\Formation\Request\DeleteFormModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteFormModelMaster(
        (new DeleteFormModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withFormModelName("form-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.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.DeleteFormModelMasterRequest;
import io.gs2.formation.result.DeleteFormModelMasterResult;

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

try {
    DeleteFormModelMasterResult result = client.deleteFormModelMaster(
        new DeleteFormModelMasterRequest()
            .withNamespaceName("namespace1")
            .withFormModelName("form-0001")
    );
    FormModelMaster 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.Gs2Formation.Gs2FormationRestClient;
using Gs2.Gs2Formation.Request.DeleteFormModelMasterRequest;
using Gs2.Gs2Formation.Result.DeleteFormModelMasterResult;

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

AsyncResult<Gs2.Gs2Formation.Result.DeleteFormModelMasterResult> asyncResult = null;
yield return client.DeleteFormModelMaster(
    new Gs2.Gs2Formation.Request.DeleteFormModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithFormModelName("form-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 Gs2Formation from '@/gs2/formation';

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

try {
    const result = await client.deleteFormModelMaster(
        new Gs2Formation.DeleteFormModelMasterRequest()
            .withNamespaceName("namespace1")
            .withFormModelName("form-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import formation

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

try:
    result = client.delete_form_model_master(
        formation.DeleteFormModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_form_model_name('form-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('formation')

api_result = client.delete_form_model_master({
    namespaceName='namespace1',
    formModelName='form-0001',
})

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

result = api_result.result
item = result.item;

describeMoldModels

フォームの保存領域の一覧を取得

Request

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

Result

説明
itemsList<MoldModel>フォームの保存領域のリスト

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/formation"
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 := formation.Gs2FormationRestClient{
    Session: &session,
}
result, err := client.DescribeMoldModels(
    &formation.DescribeMoldModelsRequest {
        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\Formation\Gs2FormationRestClient;
use Gs2\Formation\Request\DescribeMoldModelsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeMoldModels(
        (new DescribeMoldModelsRequest())
            ->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.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.DescribeMoldModelsRequest;
import io.gs2.formation.result.DescribeMoldModelsResult;

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

try {
    DescribeMoldModelsResult result = client.describeMoldModels(
        new DescribeMoldModelsRequest()
            .withNamespaceName("namespace1")
    );
    List<MoldModel> 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.Gs2Formation.Gs2FormationRestClient;
using Gs2.Gs2Formation.Request.DescribeMoldModelsRequest;
using Gs2.Gs2Formation.Result.DescribeMoldModelsResult;

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

AsyncResult<Gs2.Gs2Formation.Result.DescribeMoldModelsResult> asyncResult = null;
yield return client.DescribeMoldModels(
    new Gs2.Gs2Formation.Request.DescribeMoldModelsRequest()
        .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 Gs2Formation from '@/gs2/formation';

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

try {
    const result = await client.describeMoldModels(
        new Gs2Formation.DescribeMoldModelsRequest()
            .withNamespaceName("namespace1")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import formation

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

try:
    result = client.describe_mold_models(
        formation.DescribeMoldModelsRequest()
            .with_namespace_name(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('formation')

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

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

result = api_result.result
items = result.items;

getMoldModel

フォームの保存領域を取得

Request

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

Result

説明
itemMoldModelフォームの保存領域

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/formation"
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 := formation.Gs2FormationRestClient{
    Session: &session,
}
result, err := client.GetMoldModel(
    &formation.GetMoldModelRequest {
        NamespaceName: pointy.String("namespace1"),
        MoldModelName: pointy.String("mold-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\Formation\Gs2FormationRestClient;
use Gs2\Formation\Request\GetMoldModelRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getMoldModel(
        (new GetMoldModelRequest())
            ->withNamespaceName(self::namespace1)
            ->withMoldModelName("mold-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.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.GetMoldModelRequest;
import io.gs2.formation.result.GetMoldModelResult;

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

try {
    GetMoldModelResult result = client.getMoldModel(
        new GetMoldModelRequest()
            .withNamespaceName("namespace1")
            .withMoldModelName("mold-0001")
    );
    MoldModel 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.Gs2Formation.Gs2FormationRestClient;
using Gs2.Gs2Formation.Request.GetMoldModelRequest;
using Gs2.Gs2Formation.Result.GetMoldModelResult;

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

AsyncResult<Gs2.Gs2Formation.Result.GetMoldModelResult> asyncResult = null;
yield return client.GetMoldModel(
    new Gs2.Gs2Formation.Request.GetMoldModelRequest()
        .WithNamespaceName("namespace1")
        .WithMoldModelName("mold-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 Gs2Formation from '@/gs2/formation';

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

try {
    const result = await client.getMoldModel(
        new Gs2Formation.GetMoldModelRequest()
            .withNamespaceName("namespace1")
            .withMoldModelName("mold-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import formation

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

try:
    result = client.get_mold_model(
        formation.GetMoldModelRequest()
            .with_namespace_name(self.hash1)
            .with_mold_model_name('mold-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('formation')

api_result = client.get_mold_model({
    namespaceName='namespace1',
    moldModelName='mold-0001',
})

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

result = api_result.result
item = result.item;

describeMoldModelMasters

フォームの保存領域マスターの一覧を取得

Request

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

Result

説明
itemsList<MoldModelMaster>フォームの保存領域マスターのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/formation"
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 := formation.Gs2FormationRestClient{
    Session: &session,
}
result, err := client.DescribeMoldModelMasters(
    &formation.DescribeMoldModelMastersRequest {
        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\Formation\Gs2FormationRestClient;
use Gs2\Formation\Request\DescribeMoldModelMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeMoldModelMasters(
        (new DescribeMoldModelMastersRequest())
            ->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.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.DescribeMoldModelMastersRequest;
import io.gs2.formation.result.DescribeMoldModelMastersResult;

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

try {
    DescribeMoldModelMastersResult result = client.describeMoldModelMasters(
        new DescribeMoldModelMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<MoldModelMaster> 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.Gs2Formation.Gs2FormationRestClient;
using Gs2.Gs2Formation.Request.DescribeMoldModelMastersRequest;
using Gs2.Gs2Formation.Result.DescribeMoldModelMastersResult;

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

AsyncResult<Gs2.Gs2Formation.Result.DescribeMoldModelMastersResult> asyncResult = null;
yield return client.DescribeMoldModelMasters(
    new Gs2.Gs2Formation.Request.DescribeMoldModelMastersRequest()
        .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 Gs2Formation from '@/gs2/formation';

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

try {
    const result = await client.describeMoldModelMasters(
        new Gs2Formation.DescribeMoldModelMastersRequest()
            .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 formation

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

try:
    result = client.describe_mold_model_masters(
        formation.DescribeMoldModelMastersRequest()
            .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('formation')

api_result = client.describe_mold_model_masters({
    namespaceName='namespace1',
    pageToken=nil,
    limit=nil,
})

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

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

createMoldModelMaster

フォームの保存領域マスターを新規作成

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
namestring~ 128文字編成モデル名
descriptionstring~ 1024文字説明文
metadatastring~ 2048文字メタデータ
formModelNamestring~ 128文字保存するフォーム
initialMaxCapacityint1 ~ 2147483646フォームを保存できる初期キャパシティ
maxCapacityint1 ~ 2147483646フォームを保存できる最大キャパシティ

Result

説明
itemMoldModelMaster作成したフォームの保存領域マスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/formation"
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 := formation.Gs2FormationRestClient{
    Session: &session,
}
result, err := client.CreateMoldModelMaster(
    &formation.CreateMoldModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("mold-0001"),
        Description: nil,
        Metadata: nil,
        FormModelName: pointy.String("$formModel1.name"),
        InitialMaxCapacity: pointy.Int32(5),
        MaxCapacity: pointy.Int32(10),
    }
)
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\Formation\Gs2FormationRestClient;
use Gs2\Formation\Request\CreateMoldModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createMoldModelMaster(
        (new CreateMoldModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("mold-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withFormModelName(self::$formModel1.name)
            ->withInitialMaxCapacity(5)
            ->withMaxCapacity(10)
    );
    $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.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.CreateMoldModelMasterRequest;
import io.gs2.formation.result.CreateMoldModelMasterResult;

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

try {
    CreateMoldModelMasterResult result = client.createMoldModelMaster(
        new CreateMoldModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("mold-0001")
            .withDescription(null)
            .withMetadata(null)
            .withFormModelName("$formModel1.name")
            .withInitialMaxCapacity(5)
            .withMaxCapacity(10)
    );
    MoldModelMaster 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.Gs2Formation.Gs2FormationRestClient;
using Gs2.Gs2Formation.Request.CreateMoldModelMasterRequest;
using Gs2.Gs2Formation.Result.CreateMoldModelMasterResult;

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

AsyncResult<Gs2.Gs2Formation.Result.CreateMoldModelMasterResult> asyncResult = null;
yield return client.CreateMoldModelMaster(
    new Gs2.Gs2Formation.Request.CreateMoldModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithName("mold-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithFormModelName("$formModel1.name")
        .WithInitialMaxCapacity(5)
        .WithMaxCapacity(10),
    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 Gs2Formation from '@/gs2/formation';

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

try {
    const result = await client.createMoldModelMaster(
        new Gs2Formation.CreateMoldModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("mold-0001")
            .withDescription(null)
            .withMetadata(null)
            .withFormModelName("$formModel1.name")
            .withInitialMaxCapacity(5)
            .withMaxCapacity(10)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import formation

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

try:
    result = client.create_mold_model_master(
        formation.CreateMoldModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('mold-0001')
            .with_description(None)
            .with_metadata(None)
            .with_form_model_name(self.form_model1.name)
            .with_initial_max_capacity(5)
            .with_max_capacity(10)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('formation')

api_result = client.create_mold_model_master({
    namespaceName='namespace1',
    name='mold-0001',
    description=nil,
    metadata=nil,
    formModelName='$formModel1.name',
    initialMaxCapacity=5,
    maxCapacity=10,
})

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

result = api_result.result
item = result.item;

getMoldModelMaster

フォームの保存領域マスターを取得

Request

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

Result

説明
itemMoldModelMasterフォームの保存領域マスター

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/formation"
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 := formation.Gs2FormationRestClient{
    Session: &session,
}
result, err := client.GetMoldModelMaster(
    &formation.GetMoldModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        MoldModelName: pointy.String("mold-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\Formation\Gs2FormationRestClient;
use Gs2\Formation\Request\GetMoldModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getMoldModelMaster(
        (new GetMoldModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withMoldModelName("mold-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.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.GetMoldModelMasterRequest;
import io.gs2.formation.result.GetMoldModelMasterResult;

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

try {
    GetMoldModelMasterResult result = client.getMoldModelMaster(
        new GetMoldModelMasterRequest()
            .withNamespaceName("namespace1")
            .withMoldModelName("mold-0001")
    );
    MoldModelMaster 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.Gs2Formation.Gs2FormationRestClient;
using Gs2.Gs2Formation.Request.GetMoldModelMasterRequest;
using Gs2.Gs2Formation.Result.GetMoldModelMasterResult;

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

AsyncResult<Gs2.Gs2Formation.Result.GetMoldModelMasterResult> asyncResult = null;
yield return client.GetMoldModelMaster(
    new Gs2.Gs2Formation.Request.GetMoldModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithMoldModelName("mold-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 Gs2Formation from '@/gs2/formation';

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