NAV
go python java php typescript csharp GS2-Script

GS2-Formation

GS2 SDK Reference

GS2 SDK Reference

Models

Namespace

Namespace

Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project.
Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.

Therefore, it is necessary to create a namespace before starting to use each service.

Type Description
namespaceId string Namespace GRN
name string Namespace name
description string description of Namespace
transactionSetting TransactionSetting Transaction settings
updateMoldScript ScriptSetting Script to run when updating capacity
updateFormScript ScriptSetting Script to run when updating a form
logSetting LogSetting Log output settings
createdAt long Datetime of creation
updatedAt long Datetime of last update

FormModel

Form Model

This entity represents the form status.
A slot can be defined as an area that can be organized.

In the case of weapons and armor, a slot can be a part such as right hand',left hand', body',arm', etc., or it can be an area such as slot',slot', or `slot', etc.
In the case of a party, positions such as "vanguard," "middle guard," and "rear guard" can be represented as slots.

Type Description
formModelId string Form model GRN
name string Form Name
metadata string metadata
slots SlotModel[] List of Slot Model

FormModelMaster

Form Model Master

This entity represents the form status.
A slot can be defined as an area that can be organized.

In the case of weapons and armor, a slot can be a part such as right hand',left hand', body',arm', etc., or it can be an area such as slot',slot', or `slot', etc.
In the case of a party, positions such as "vanguard," "middle guard," and "rear guard" can be represented as slots.

Type Description
formModelId string Form Master GRN
name string Form Name
description string description of Namespace
metadata string metadata
slots SlotModel[] List of Slot Model
createdAt long Datetime of creation
updatedAt long Datetime of last update

MoldModel

Area for storing form

If it is a party composition, it is intended to be saved in the form of "fire attribute party" or "water attribute party".
The number of areas that can be saved can be limited or expanded individually.

Type Description
moldModelId string Form storage area GRN
name string Form Model Name
metadata string metadata
initialMaxCapacity int Initial capacity to store forms
maxCapacity int Maximum capacity to store forms
formModel FormModel

MoldModelMaster

Area for storing form master

If it is a party composition, it is intended to be saved in the form of "fire attribute party" or "water attribute party".
The number of areas that can be saved can be limited or expanded individually.

Type Description
moldModelId string Form Storage Area Master GRN
name string Form Model Name
description string description of Namespace
metadata string metadata
initialMaxCapacity int Initial capacity to store forms
maxCapacity int Maximum capacity to store forms
formModelName string Forms to be saved
createdAt long Datetime of creation
updatedAt long Datetime of last update

CurrentFormMaster

Currently available master data

GS2 uses JSON format files for master data management.
By uploading the file, you can actually reflect the settings on the server.

We provide a master data editor on the management console as a way to create JSON files, but you can also create JSON files using the
The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.

Please refer to the documentation for the format of the JSON file.

Type Description
namespaceId string Currently available form settings GRN
settings string Master data

Mold

Saved Form

An entity that holds information organized by the game player.
Each Mold can hold multiple Forms, and the capacity of how many Forms can be held can be set individually for each Mold.

Type Description
moldId string Saved Form GRN
name string Form Name
userId string User Id
capacity int Current Capacity
createdAt long Datetime of creation
updatedAt long Datetime of last update

Form

Form

This entity represents the form status.
A slot can be defined as an area that can be organized.

In the case of weapons and armor, a slot can be a part such as right hand',left hand', body',arm', etc., or it can be an area such as slot',slot', or `slot', etc.
In the case of a party, positions such as "vanguard," "middle guard," and "rear guard" can be represented as slots.

Type Description
formId string Form GRN
name string Form Name
index int Index of storage area
slots Slot[] List of Slots
createdAt long Datetime of creation
updatedAt long Datetime of last update

PropertyForm

Property Form

Type Description
formId string Property Form GRN
userId string User Id
name string Form Name
propertyId string Property Id
slots Slot[] List of Slots
createdAt long Datetime of creation
updatedAt long Datetime of last update

Slot

Type Description
name string Slot model name
propertyId string Property ID
metadata string metadata

SlotModel

Type Description
name string Slot model name
propertyRegex string Regular expressions for values that can be set as properties
metadata string metadata

SlotWithSignature

Type Description
name string Slot model name
propertyType enum ['gs2_inventory', 'gs2_dictionary'] Property Type
body string payload
signature string Signature that proves ownership of the resource for the property ID
metadata string metadata

AcquireAction

Type Description
action enum [] Types of actions to be performed in the stamp sheet
request string JSON of request

AcquireActionConfig

Type Description
name string Slot Name
config Config[] Config for use with stamp sheets

Config

Type Description
key string Name
value string Value

GitHubCheckoutSetting

Type Description
apiKeyId string GitHub API key GRN
repositoryName string Repository Name
sourcePath string Source code file path
referenceType enum ['commit_hash', 'branch', 'tag'] Source of code
commitHash string Commit hash
branchName string Branch Name
tagName string Tag Name

ScriptSetting

Type Description
triggerScriptId string Script GRN
doneTriggerTargetType enum ['none', 'gs2_script', 'aws'] Notification of Completion
doneTriggerScriptId string Script GRN
doneTriggerQueueNamespaceId string Namespace GRN

LogSetting

Type Description
loggingNamespaceId string Namespace GRN

TransactionSetting

Type Description
enableAutoRun bool Automatically run issued stamp sheets on the server side, or
distributorNamespaceId string GS2-Distributor namespace used for stamp sheet execution
keyId string GS2-Key encryption key used to sign the stamp sheet
queueNamespaceId string Namespace in GS2-JobQueue used to run the stamp sheet

Methods

describeNamespaces

describeNamespaces

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;

Get list of namespaces



Request

Type Require Default Limitation Description
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired

Result

Type Description
items Namespace[] List of Namespace
nextPageToken string Page token to retrieve the rest of the listing

createNamespace

createNamespace

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;

Create a new namespace



Request

Type Require Default Limitation Description
name string ~ 32 chars Namespace name
description string ~ 1024 chars description of Namespace
transactionSetting TransactionSetting Transaction settings
updateMoldScript ScriptSetting Script to run when updating capacity
updateFormScript ScriptSetting Script to run when updating a form
logSetting LogSetting Log output settings

Result

Type Description
item Namespace Namespace created

getNamespaceStatus

getNamespaceStatus

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;

Get namespace status



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name

Result

Type Description
status string

getNamespace

getNamespace

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;

Get namespace



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name

Result

Type Description
item Namespace Namespace

updateNamespace

updateNamespace

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;

Update namespace



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
description string ~ 1024 chars description of Namespace
transactionSetting TransactionSetting Transaction settings
updateMoldScript ScriptSetting Script to run when updating capacity
updateFormScript ScriptSetting Script to run when updating a form
logSetting LogSetting Log output settings

Result

Type Description
item Namespace Updated namespace

deleteNamespace

deleteNamespace

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;

Delete namespace



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name

Result

Type Description
item Namespace Deleted namespace

describeFormModels

describeFormModels

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.DescribeFormModels(
    &formation.DescribeFormModelsRequest {
        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\DescribeFormModelsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeFormModels(
        (new DescribeFormModelsRequest())
            ->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.DescribeFormModelsRequest;
import io.gs2.formation.result.DescribeFormModelsResult;

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

try {
    DescribeFormModelsResult result = client.describeFormModels(
        new DescribeFormModelsRequest()
            .withNamespaceName("namespace1")
    );
    List<FormModel> 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.DescribeFormModelsRequest;
using Gs2.Gs2Formation.Result.DescribeFormModelsResult;

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.DescribeFormModelsResult> asyncResult = null;
yield return client.DescribeFormModels(
    new Gs2.Gs2Formation.Request.DescribeFormModelsRequest()
        .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.describeFormModels(
        new Gs2Formation.DescribeFormModelsRequest()
            .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_form_models(
        formation.DescribeFormModelsRequest()
            .with_namespace_name(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.describe_form_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;



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name

Result

Type Description
items FormModel[] List of Form

getFormModel

getFormModel

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"),
        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\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)
            ->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.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")
            .withFormModelName("form-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")
        .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.getFormModel(
        new Gs2Formation.GetFormModelRequest()
            .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(
        formation.GetFormModelRequest()
            .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({
    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;



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
formModelName string ~ 128 chars Form Name

Result

Type Description
item FormModel Form

describeFormModelMasters

describeFormModelMasters

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;



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired

Result

Type Description
items FormModelMaster[] List of Form Model Master
nextPageToken string Page token to retrieve the rest of the listing

createFormModelMaster

createFormModelMaster

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;

Create new form model master



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
name string ~ 128 chars Form Name
description string ~ 1024 chars description of Namespace
metadata string ~ 2048 chars metadata
slots SlotModel[] List of Slot Model

Result

Type Description
item FormModelMaster Created form model master

getFormModelMaster

getFormModelMaster

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;

Get form model master



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
formModelName string ~ 128 chars Form Name

Result

Type Description
item FormModelMaster Form Model Master

updateFormModelMaster

updateFormModelMaster

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;

Update form model master



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
formModelName string ~ 128 chars Form Name
description string ~ 1024 chars description of Namespace
metadata string ~ 2048 chars metadata
slots SlotModel[] List of Slot Model

Result

Type Description
item FormModelMaster Updated form model master

deleteFormModelMaster

deleteFormModelMaster

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;

Delete form model master



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
formModelName string ~ 128 chars Form Name

Result

Type Description
item FormModelMaster Deleted form model master

describeMoldModels

describeMoldModels

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;



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name

Result

Type Description
items MoldModel[] List of Form storage area

getMoldModel

getMoldModel

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"),
        MoldName: 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)
            ->withMoldName("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")
            .withMoldName("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")
        .WithMoldName("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")
            .withMoldName("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_name('mold-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.get_mold_model({
    namespaceName='namespace1',
    moldName='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;



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
moldName string ~ 128 chars Form Model Name

Result

Type Description
item MoldModel Form storage area

describeMoldModelMasters

describeMoldModelMasters

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;

Get list of form storage area masters



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired

Result

Type Description
items MoldModelMaster[] List of Form storage area master
nextPageToken string Page token to retrieve the rest of the listing

createMoldModelMaster

createMoldModelMaster

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;

Create new form storage area master



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
name string ~ 128 chars Form Model Name
description string ~ 1024 chars description of Namespace
metadata string ~ 2048 chars metadata
formModelName string ~ 128 chars Forms to be saved
initialMaxCapacity int 1 ~ 2147483646 Initial capacity to store forms
maxCapacity int 1 ~ 2147483646 Maximum capacity to store forms

Result

Type Description
item MoldModelMaster Created form storage area master

getMoldModelMaster

getMoldModelMaster

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"),
        MoldName: 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)
            ->withMoldName("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")
            .withMoldName("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")
        .WithMoldName("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.getMoldModelMaster(
        new Gs2Formation.GetMoldModelMasterRequest()
            .withNamespaceName("namespace1")
            .withMoldName("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_master(
        formation.GetMoldModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_mold_name('mold-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.get_mold_model_master({
    namespaceName='namespace1',
    moldName='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;

Get form storage area master



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
moldName string ~ 128 chars Form Model Name

Result

Type Description
item MoldModelMaster Form storage area master

updateMoldModelMaster

updateMoldModelMaster

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.UpdateMoldModelMaster(
    &formation.UpdateMoldModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        MoldName: pointy.String("mold-0001"),
        Description: nil,
        Metadata: nil,
        FormModelName: pointy.String("$formModel1.name"),
        InitialMaxCapacity: pointy.Int32(5),
        MaxCapacity: pointy.Int32(15),
    }
)
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\UpdateMoldModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateMoldModelMaster(
        (new UpdateMoldModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withMoldName("mold-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withFormModelName(self::$formModel1.name)
            ->withInitialMaxCapacity(5)
            ->withMaxCapacity(15)
    );
    $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.UpdateMoldModelMasterRequest;
import io.gs2.formation.result.UpdateMoldModelMasterResult;

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

try {
    UpdateMoldModelMasterResult result = client.updateMoldModelMaster(
        new UpdateMoldModelMasterRequest()
            .withNamespaceName("namespace1")
            .withMoldName("mold-0001")
            .withDescription(null)
            .withMetadata(null)
            .withFormModelName("$formModel1.name")
            .withInitialMaxCapacity(5)
            .withMaxCapacity(15)
    );
    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.UpdateMoldModelMasterRequest;
using Gs2.Gs2Formation.Result.UpdateMoldModelMasterResult;

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.UpdateMoldModelMasterResult> asyncResult = null;
yield return client.UpdateMoldModelMaster(
    new Gs2.Gs2Formation.Request.UpdateMoldModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithMoldName("mold-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithFormModelName("$formModel1.name")
        .WithInitialMaxCapacity(5)
        .WithMaxCapacity(15),
    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.updateMoldModelMaster(
        new Gs2Formation.UpdateMoldModelMasterRequest()
            .withNamespaceName("namespace1")
            .withMoldName("mold-0001")
            .withDescription(null)
            .withMetadata(null)
            .withFormModelName("$formModel1.name")
            .withInitialMaxCapacity(5)
            .withMaxCapacity(15)
    );
    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_mold_model_master(
        formation.UpdateMoldModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_mold_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(15)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

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

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

result = api_result.result
item = result.item;

Update form storage area master



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
moldName string ~ 128 chars Form Model Name
description string ~ 1024 chars description of Namespace
metadata string ~ 2048 chars metadata
formModelName string ~ 128 chars Forms to be saved
initialMaxCapacity int 1 ~ 2147483646 Initial capacity to store forms
maxCapacity int 1 ~ 2147483646 Maximum capacity to store forms

Result

Type Description
item MoldModelMaster Updated form storage area master

deleteMoldModelMaster

deleteMoldModelMaster

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.DeleteMoldModelMaster(
    &formation.DeleteMoldModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        MoldName: 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\DeleteMoldModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteMoldModelMaster(
        (new DeleteMoldModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withMoldName("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.DeleteMoldModelMasterRequest;
import io.gs2.formation.result.DeleteMoldModelMasterResult;

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

try {
    DeleteMoldModelMasterResult result = client.deleteMoldModelMaster(
        new DeleteMoldModelMasterRequest()
            .withNamespaceName("namespace1")
            .withMoldName("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.DeleteMoldModelMasterRequest;
using Gs2.Gs2Formation.Result.DeleteMoldModelMasterResult;

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.DeleteMoldModelMasterResult> asyncResult = null;
yield return client.DeleteMoldModelMaster(
    new Gs2.Gs2Formation.Request.DeleteMoldModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithMoldName("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.deleteMoldModelMaster(
        new Gs2Formation.DeleteMoldModelMasterRequest()
            .withNamespaceName("namespace1")
            .withMoldName("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.delete_mold_model_master(
        formation.DeleteMoldModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_mold_name('mold-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.delete_mold_model_master({
    namespaceName='namespace1',
    moldName='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;

Delete form storage area master



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
moldName string ~ 128 chars Form Model Name

Result

Type Description
item MoldModelMaster Deleted form storage area master

exportMaster

exportMaster

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

client = gs2('formation')

api_result = client.export_master({
    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;

Export master data for currently available form settings



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name

Result

Type Description
item CurrentFormMaster Currently available form settings

getCurrentFormMaster

getCurrentFormMaster

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.GetCurrentFormMaster(
    &formation.GetCurrentFormMasterRequest {
        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\GetCurrentFormMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCurrentFormMaster(
        (new GetCurrentFormMasterRequest())
            ->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.GetCurrentFormMasterRequest;
import io.gs2.formation.result.GetCurrentFormMasterResult;

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

try {
    GetCurrentFormMasterResult result = client.getCurrentFormMaster(
        new GetCurrentFormMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentFormMaster 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.GetCurrentFormMasterRequest;
using Gs2.Gs2Formation.Result.GetCurrentFormMasterResult;

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.GetCurrentFormMasterResult> asyncResult = null;
yield return client.GetCurrentFormMaster(
    new Gs2.Gs2Formation.Request.GetCurrentFormMasterRequest()
        .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.getCurrentFormMaster(
        new Gs2Formation.GetCurrentFormMasterRequest()
            .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_current_form_master(
        formation.GetCurrentFormMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.get_current_form_master({
    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;

Get the currently available form settings



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name

Result

Type Description
item CurrentFormMaster Currently available form settings

updateCurrentFormMaster

updateCurrentFormMaster

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.UpdateCurrentFormMaster(
    &formation.UpdateCurrentFormMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Settings: pointy.String("{\n  \"version\": \"2019-09-09\",\n  \"moldModels\": [\n    {\n      \"name\": \"party\",\n      \"metadata\": \"PARTY\",\n      \"formModel\": {\n        \"name\": \"party\",\n        \"metadata\": \"PARTY\",\n        \"slots\": [\n          {\n            \"name\": \"tank\",\n            \"metadata\": \"TANK\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"healer\",\n            \"metadata\": \"HEALER\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"dps_1\",\n            \"metadata\": \"DPS\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"dps_2\",\n            \"metadata\": \"DPS\",\n            \"propertyRegex\": \"grn:.*\"\n          }\n        ]\n      },\n      \"initialMaxCapacity\": 10,\n      \"maxCapacity\": 20\n    },\n    {\n      \"name\": \"equipment\",\n      \"metadata\": \"EQUIPMENT\",\n      \"formModel\": {\n        \"name\": \"equipment\",\n        \"metadata\": \"EQUIPMENT\",\n        \"slots\": [\n          {\n            \"name\": \"head\",\n            \"metadata\": \"HEAD\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"body\",\n            \"metadata\": \"BODY\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"leg\",\n            \"metadata\": \"LEG\",\n            \"propertyRegex\": \"grn:.*\"\n          }\n        ]\n      },\n      \"initialMaxCapacity\": 20,\n      \"maxCapacity\": 30\n    }\n  ]\n}"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Formation\Gs2FormationRestClient;
use Gs2\Formation\Request\UpdateCurrentFormMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentFormMaster(
        (new UpdateCurrentFormMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSettings("{\n  \"version\": \"2019-09-09\",\n  \"moldModels\": [\n    {\n      \"name\": \"party\",\n      \"metadata\": \"PARTY\",\n      \"formModel\": {\n        \"name\": \"party\",\n        \"metadata\": \"PARTY\",\n        \"slots\": [\n          {\n            \"name\": \"tank\",\n            \"metadata\": \"TANK\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"healer\",\n            \"metadata\": \"HEALER\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"dps_1\",\n            \"metadata\": \"DPS\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"dps_2\",\n            \"metadata\": \"DPS\",\n            \"propertyRegex\": \"grn:.*\"\n          }\n        ]\n      },\n      \"initialMaxCapacity\": 10,\n      \"maxCapacity\": 20\n    },\n    {\n      \"name\": \"equipment\",\n      \"metadata\": \"EQUIPMENT\",\n      \"formModel\": {\n        \"name\": \"equipment\",\n        \"metadata\": \"EQUIPMENT\",\n        \"slots\": [\n          {\n            \"name\": \"head\",\n            \"metadata\": \"HEAD\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"body\",\n            \"metadata\": \"BODY\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"leg\",\n            \"metadata\": \"LEG\",\n            \"propertyRegex\": \"grn:.*\"\n          }\n        ]\n      },\n      \"initialMaxCapacity\": 20,\n      \"maxCapacity\": 30\n    }\n  ]\n}")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.UpdateCurrentFormMasterRequest;
import io.gs2.formation.result.UpdateCurrentFormMasterResult;

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

try {
    UpdateCurrentFormMasterResult result = client.updateCurrentFormMaster(
        new UpdateCurrentFormMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n  \"version\": \"2019-09-09\",\n  \"moldModels\": [\n    {\n      \"name\": \"party\",\n      \"metadata\": \"PARTY\",\n      \"formModel\": {\n        \"name\": \"party\",\n        \"metadata\": \"PARTY\",\n        \"slots\": [\n          {\n            \"name\": \"tank\",\n            \"metadata\": \"TANK\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"healer\",\n            \"metadata\": \"HEALER\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"dps_1\",\n            \"metadata\": \"DPS\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"dps_2\",\n            \"metadata\": \"DPS\",\n            \"propertyRegex\": \"grn:.*\"\n          }\n        ]\n      },\n      \"initialMaxCapacity\": 10,\n      \"maxCapacity\": 20\n    },\n    {\n      \"name\": \"equipment\",\n      \"metadata\": \"EQUIPMENT\",\n      \"formModel\": {\n        \"name\": \"equipment\",\n        \"metadata\": \"EQUIPMENT\",\n        \"slots\": [\n          {\n            \"name\": \"head\",\n            \"metadata\": \"HEAD\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"body\",\n            \"metadata\": \"BODY\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"leg\",\n            \"metadata\": \"LEG\",\n            \"propertyRegex\": \"grn:.*\"\n          }\n        ]\n      },\n      \"initialMaxCapacity\": 20,\n      \"maxCapacity\": 30\n    }\n  ]\n}")
    );
    CurrentFormMaster 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.UpdateCurrentFormMasterRequest;
using Gs2.Gs2Formation.Result.UpdateCurrentFormMasterResult;

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.UpdateCurrentFormMasterResult> asyncResult = null;
yield return client.UpdateCurrentFormMaster(
    new Gs2.Gs2Formation.Request.UpdateCurrentFormMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSettings("{\n  \"version\": \"2019-09-09\",\n  \"moldModels\": [\n    {\n      \"name\": \"party\",\n      \"metadata\": \"PARTY\",\n      \"formModel\": {\n        \"name\": \"party\",\n        \"metadata\": \"PARTY\",\n        \"slots\": [\n          {\n            \"name\": \"tank\",\n            \"metadata\": \"TANK\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"healer\",\n            \"metadata\": \"HEALER\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"dps_1\",\n            \"metadata\": \"DPS\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"dps_2\",\n            \"metadata\": \"DPS\",\n            \"propertyRegex\": \"grn:.*\"\n          }\n        ]\n      },\n      \"initialMaxCapacity\": 10,\n      \"maxCapacity\": 20\n    },\n    {\n      \"name\": \"equipment\",\n      \"metadata\": \"EQUIPMENT\",\n      \"formModel\": {\n        \"name\": \"equipment\",\n        \"metadata\": \"EQUIPMENT\",\n        \"slots\": [\n          {\n            \"name\": \"head\",\n            \"metadata\": \"HEAD\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"body\",\n            \"metadata\": \"BODY\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"leg\",\n            \"metadata\": \"LEG\",\n            \"propertyRegex\": \"grn:.*\"\n          }\n        ]\n      },\n      \"initialMaxCapacity\": 20,\n      \"maxCapacity\": 30\n    }\n  ]\n}"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.updateCurrentFormMaster(
        new Gs2Formation.UpdateCurrentFormMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n  \"version\": \"2019-09-09\",\n  \"moldModels\": [\n    {\n      \"name\": \"party\",\n      \"metadata\": \"PARTY\",\n      \"formModel\": {\n        \"name\": \"party\",\n        \"metadata\": \"PARTY\",\n        \"slots\": [\n          {\n            \"name\": \"tank\",\n            \"metadata\": \"TANK\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"healer\",\n            \"metadata\": \"HEALER\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"dps_1\",\n            \"metadata\": \"DPS\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"dps_2\",\n            \"metadata\": \"DPS\",\n            \"propertyRegex\": \"grn:.*\"\n          }\n        ]\n      },\n      \"initialMaxCapacity\": 10,\n      \"maxCapacity\": 20\n    },\n    {\n      \"name\": \"equipment\",\n      \"metadata\": \"EQUIPMENT\",\n      \"formModel\": {\n        \"name\": \"equipment\",\n        \"metadata\": \"EQUIPMENT\",\n        \"slots\": [\n          {\n            \"name\": \"head\",\n            \"metadata\": \"HEAD\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"body\",\n            \"metadata\": \"BODY\",\n            \"propertyRegex\": \"grn:.*\"\n          },\n          {\n            \"name\": \"leg\",\n            \"metadata\": \"LEG\",\n            \"propertyRegex\": \"grn:.*\"\n          }\n        ]\n      },\n      \"initialMaxCapacity\": 20,\n      \"maxCapacity\": 30\n    }\n  ]\n}")
    );
    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_current_form_master(
        formation.UpdateCurrentFormMasterRequest()
            .with_namespace_name(self.hash1)
            .with_settings('{\n  "version": "2019-09-09",\n  "moldModels": [\n    {\n      "name": "party",\n      "metadata": "PARTY",\n      "formModel": {\n        "name": "party",\n        "metadata": "PARTY",\n        "slots": [\n          {\n            "name": "tank",\n            "metadata": "TANK",\n            "propertyRegex": "grn:.*"\n          },\n          {\n            "name": "healer",\n            "metadata": "HEALER",\n            "propertyRegex": "grn:.*"\n          },\n          {\n            "name": "dps_1",\n            "metadata": "DPS",\n            "propertyRegex": "grn:.*"\n          },\n          {\n            "name": "dps_2",\n            "metadata": "DPS",\n            "propertyRegex": "grn:.*"\n          }\n        ]\n      },\n      "initialMaxCapacity": 10,\n      "maxCapacity": 20\n    },\n    {\n      "name": "equipment",\n      "metadata": "EQUIPMENT",\n      "formModel": {\n        "name": "equipment",\n        "metadata": "EQUIPMENT",\n        "slots": [\n          {\n            "name": "head",\n            "metadata": "HEAD",\n            "propertyRegex": "grn:.*"\n          },\n          {\n            "name": "body",\n            "metadata": "BODY",\n            "propertyRegex": "grn:.*"\n          },\n          {\n            "name": "leg",\n            "metadata": "LEG",\n            "propertyRegex": "grn:.*"\n          }\n        ]\n      },\n      "initialMaxCapacity": 20,\n      "maxCapacity": 30\n    }\n  ]\n}')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.update_current_form_master({
    namespaceName='namespace1',
    settings='{\n  "version": "2019-09-09",\n  "moldModels": [\n    {\n      "name": "party",\n      "metadata": "PARTY",\n      "formModel": {\n        "name": "party",\n        "metadata": "PARTY",\n        "slots": [\n          {\n            "name": "tank",\n            "metadata": "TANK",\n            "propertyRegex": "grn:.*"\n          },\n          {\n            "name": "healer",\n            "metadata": "HEALER",\n            "propertyRegex": "grn:.*"\n          },\n          {\n            "name": "dps_1",\n            "metadata": "DPS",\n            "propertyRegex": "grn:.*"\n          },\n          {\n            "name": "dps_2",\n            "metadata": "DPS",\n            "propertyRegex": "grn:.*"\n          }\n        ]\n      },\n      "initialMaxCapacity": 10,\n      "maxCapacity": 20\n    },\n    {\n      "name": "equipment",\n      "metadata": "EQUIPMENT",\n      "formModel": {\n        "name": "equipment",\n        "metadata": "EQUIPMENT",\n        "slots": [\n          {\n            "name": "head",\n            "metadata": "HEAD",\n            "propertyRegex": "grn:.*"\n          },\n          {\n            "name": "body",\n            "metadata": "BODY",\n            "propertyRegex": "grn:.*"\n          },\n          {\n            "name": "leg",\n            "metadata": "LEG",\n            "propertyRegex": "grn:.*"\n          }\n        ]\n      },\n      "initialMaxCapacity": 20,\n      "maxCapacity": 30\n    }\n  ]\n}',
})

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

result = api_result.result
item = result.item;

Updates the currently available form settings



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
settings string ~ 5242880 chars Master data

Result

Type Description
item CurrentFormMaster Updated and currently available form settings

updateCurrentFormMasterFromGitHub

updateCurrentFormMasterFromGitHub

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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.UpdateCurrentFormMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentFormMasterFromGitHub(
    new Gs2.Gs2Formation.Request.UpdateCurrentFormMasterFromGitHubRequest()
        .WithNamespaceName("namespace1")
        .WithCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'}),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.updateCurrentFormMasterFromGitHub(
        new Gs2Formation.UpdateCurrentFormMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_current_form_master_from_git_hub(
        formation.UpdateCurrentFormMasterFromGitHubRequest()
            .with_namespace_name(self.hash1)
            .with_checkout_setting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

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

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

result = api_result.result
item = result.item;

Updates the currently available form settings



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
checkoutSetting GitHubCheckoutSetting Setup to check out master data from GitHub

Result

Type Description
item CurrentFormMaster Updated and currently available form settings

describeMolds

describeMolds

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeMoldsResult result = client.describeMolds(
        new DescribeMoldsRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Mold> 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.DescribeMoldsRequest;
using Gs2.Gs2Formation.Result.DescribeMoldsResult;

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.DescribeMoldsResult> asyncResult = null;
yield return client.DescribeMolds(
    new Gs2.Gs2Formation.Request.DescribeMoldsRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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.describeMolds(
        new Gs2Formation.DescribeMoldsRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_molds(
        formation.DescribeMoldsRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.describe_molds({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    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;

Get list of saved forms



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
accessToken string ~ 128 chars User Id
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired

Result

Type Description
items Mold[] List of Saved Forms
nextPageToken string Page token to retrieve the rest of the listing

describeMoldsByUserId

describeMoldsByUserId

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeMoldsByUserId(
        (new DescribeMoldsByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.DescribeMoldsByUserIdRequest;
import io.gs2.formation.result.DescribeMoldsByUserIdResult;

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

try {
    DescribeMoldsByUserIdResult result = client.describeMoldsByUserId(
        new DescribeMoldsByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Mold> 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.DescribeMoldsByUserIdRequest;
using Gs2.Gs2Formation.Result.DescribeMoldsByUserIdResult;

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.DescribeMoldsByUserIdResult> asyncResult = null;
yield return client.DescribeMoldsByUserId(
    new Gs2.Gs2Formation.Request.DescribeMoldsByUserIdRequest()
        .WithNamespaceName("namespace2")
        .WithUserId("user-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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.describeMoldsByUserId(
        new Gs2Formation.DescribeMoldsByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_molds_by_user_id(
        formation.DescribeMoldsByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.describe_molds_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    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;

Get list of saved forms by specifying user ID



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
userId string ~ 128 chars User Id
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired

Result

Type Description
items Mold[] List of Saved Forms
nextPageToken string Page token to retrieve the rest of the listing

getMold

getMold

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.GetMold(
    &formation.GetMoldRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        MoldName: pointy.String("mold-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
moldModel := result.MoldModel
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\GetMoldRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getMold(
        (new GetMoldRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withMoldName("mold-0001")
    );
    $item = $result->getItem();
    $moldModel = $result->getMoldModel();
} 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.GetMoldRequest;
import io.gs2.formation.result.GetMoldResult;

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

try {
    GetMoldResult result = client.getMold(
        new GetMoldRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withMoldName("mold-0001")
    );
    Mold item = result.getItem();
    MoldModel moldModel = result.getMoldModel();
} 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.GetMoldRequest;
using Gs2.Gs2Formation.Result.GetMoldResult;

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.GetMoldResult> asyncResult = null;
yield return client.GetMold(
    new Gs2.Gs2Formation.Request.GetMoldRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithMoldName("mold-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var moldModel = result.MoldModel;
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.getMold(
        new Gs2Formation.GetMoldRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withMoldName("mold-0001")
    );
    const item = result.getItem();
    const moldModel = result.getMoldModel();
} 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(
        formation.GetMoldRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_mold_name('mold-0001')
    )
    item = result.item
    mold_model = result.mold_model
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.get_mold({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    moldName='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;
moldModel = result.moldModel;

Retrieve saved forms



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
accessToken string ~ 128 chars User Id
moldName string ~ 128 chars Form Name

Result

Type Description
item Mold Saved forms
moldModel MoldModel Form storage area

getMoldByUserId

getMoldByUserId

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.GetMoldByUserId(
    &formation.GetMoldByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        MoldName: pointy.String("mold-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
moldModel := result.MoldModel
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\GetMoldByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getMoldByUserId(
        (new GetMoldByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withMoldName("mold-0001")
    );
    $item = $result->getItem();
    $moldModel = $result->getMoldModel();
} 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.GetMoldByUserIdRequest;
import io.gs2.formation.result.GetMoldByUserIdResult;

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

try {
    GetMoldByUserIdResult result = client.getMoldByUserId(
        new GetMoldByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withMoldName("mold-0001")
    );
    Mold item = result.getItem();
    MoldModel moldModel = result.getMoldModel();
} 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.GetMoldByUserIdRequest;
using Gs2.Gs2Formation.Result.GetMoldByUserIdResult;

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.GetMoldByUserIdResult> asyncResult = null;
yield return client.GetMoldByUserId(
    new Gs2.Gs2Formation.Request.GetMoldByUserIdRequest()
        .WithNamespaceName("namespace2")
        .WithUserId("user-0001")
        .WithMoldName("mold-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var moldModel = result.MoldModel;
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.getMoldByUserId(
        new Gs2Formation.GetMoldByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withMoldName("mold-0001")
    );
    const item = result.getItem();
    const moldModel = result.getMoldModel();
} 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_by_user_id(
        formation.GetMoldByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_mold_name('mold-0001')
    )
    item = result.item
    mold_model = result.mold_model
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.get_mold_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    moldName='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;
moldModel = result.moldModel;

Retrieve saved forms by specifying the user ID



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
userId string ~ 128 chars User Id
moldName string ~ 128 chars Form Name

Result

Type Description
item Mold Saved forms
moldModel MoldModel Form storage area

setMoldCapacityByUserId

setMoldCapacityByUserId

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.SetMoldCapacityByUserId(
    &formation.SetMoldCapacityByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        MoldName: pointy.String("mold-0001"),
        Capacity: pointy.Int32(10),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
moldModel := result.MoldModel
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\SetMoldCapacityByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->setMoldCapacityByUserId(
        (new SetMoldCapacityByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withMoldName("mold-0001")
            ->withCapacity(10)
    );
    $item = $result->getItem();
    $moldModel = $result->getMoldModel();
} 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.SetMoldCapacityByUserIdRequest;
import io.gs2.formation.result.SetMoldCapacityByUserIdResult;

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

try {
    SetMoldCapacityByUserIdResult result = client.setMoldCapacityByUserId(
        new SetMoldCapacityByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withMoldName("mold-0001")
            .withCapacity(10)
    );
    Mold item = result.getItem();
    MoldModel moldModel = result.getMoldModel();
} 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.SetMoldCapacityByUserIdRequest;
using Gs2.Gs2Formation.Result.SetMoldCapacityByUserIdResult;

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.SetMoldCapacityByUserIdResult> asyncResult = null;
yield return client.SetMoldCapacityByUserId(
    new Gs2.Gs2Formation.Request.SetMoldCapacityByUserIdRequest()
        .WithNamespaceName("namespace2")
        .WithUserId("user-0001")
        .WithMoldName("mold-0001")
        .WithCapacity(10),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var moldModel = result.MoldModel;
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.setMoldCapacityByUserId(
        new Gs2Formation.SetMoldCapacityByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withMoldName("mold-0001")
            .withCapacity(10)
    );
    const item = result.getItem();
    const moldModel = result.getMoldModel();
} 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.set_mold_capacity_by_user_id(
        formation.SetMoldCapacityByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_mold_name('mold-0001')
            .with_capacity(10)
    )
    item = result.item
    mold_model = result.mold_model
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.set_mold_capacity_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    moldName='mold-0001',
    capacity=10,
})

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

result = api_result.result
item = result.item;
moldModel = result.moldModel;

Update capacity of saved forms with user ID



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
userId string ~ 128 chars User Id
moldName string ~ 128 chars Form Name
capacity int ~ 2147483646 Current Capacity

Result

Type Description
item Mold Saved forms with updated capacity
moldModel MoldModel Form storage area

addMoldCapacityByUserId

addMoldCapacityByUserId

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.AddMoldCapacityByUserId(
    &formation.AddMoldCapacityByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        MoldName: pointy.String("mold-0001"),
        Capacity: pointy.Int32(10),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
moldModel := result.MoldModel
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\AddMoldCapacityByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->addMoldCapacityByUserId(
        (new AddMoldCapacityByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withMoldName("mold-0001")
            ->withCapacity(10)
    );
    $item = $result->getItem();
    $moldModel = $result->getMoldModel();
} 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.AddMoldCapacityByUserIdRequest;
import io.gs2.formation.result.AddMoldCapacityByUserIdResult;

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

try {
    AddMoldCapacityByUserIdResult result = client.addMoldCapacityByUserId(
        new AddMoldCapacityByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withMoldName("mold-0001")
            .withCapacity(10)
    );
    Mold item = result.getItem();
    MoldModel moldModel = result.getMoldModel();
} 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.AddMoldCapacityByUserIdRequest;
using Gs2.Gs2Formation.Result.AddMoldCapacityByUserIdResult;

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.AddMoldCapacityByUserIdResult> asyncResult = null;
yield return client.AddMoldCapacityByUserId(
    new Gs2.Gs2Formation.Request.AddMoldCapacityByUserIdRequest()
        .WithNamespaceName("namespace2")
        .WithUserId("user-0001")
        .WithMoldName("mold-0001")
        .WithCapacity(10),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var moldModel = result.MoldModel;
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.addMoldCapacityByUserId(
        new Gs2Formation.AddMoldCapacityByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withMoldName("mold-0001")
            .withCapacity(10)
    );
    const item = result.getItem();
    const moldModel = result.getMoldModel();
} 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.add_mold_capacity_by_user_id(
        formation.AddMoldCapacityByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_mold_name('mold-0001')
            .with_capacity(10)
    )
    item = result.item
    mold_model = result.mold_model
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.add_mold_capacity_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    moldName='mold-0001',
    capacity=10,
})

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

result = api_result.result
item = result.item;
moldModel = result.moldModel;

Add capacity for forms saved with user ID



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
userId string ~ 128 chars User Id
moldName string ~ 128 chars Form Name
capacity int ~ 2147483646 Current Capacity

Result

Type Description
item Mold Saved forms with updated capacity
moldModel MoldModel Form storage area

deleteMold

deleteMold

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.DeleteMold(
    &formation.DeleteMoldRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        MoldName: 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\DeleteMoldRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteMold(
        (new DeleteMoldRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withMoldName("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.DeleteMoldRequest;
import io.gs2.formation.result.DeleteMoldResult;

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

try {
    DeleteMoldResult result = client.deleteMold(
        new DeleteMoldRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withMoldName("mold-0001")
    );
    Mold 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.DeleteMoldRequest;
using Gs2.Gs2Formation.Result.DeleteMoldResult;

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.DeleteMoldResult> asyncResult = null;
yield return client.DeleteMold(
    new Gs2.Gs2Formation.Request.DeleteMoldRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithMoldName("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.deleteMold(
        new Gs2Formation.DeleteMoldRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withMoldName("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.delete_mold(
        formation.DeleteMoldRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_mold_name('mold-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.delete_mold({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    moldName='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;

Delete saved forms



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
accessToken string ~ 128 chars User Id
moldName string ~ 128 chars Form Name

Result

Type Description
item Mold Saved forms

deleteMoldByUserId

deleteMoldByUserId

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.DeleteMoldByUserId(
    &formation.DeleteMoldByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        MoldName: 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\DeleteMoldByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteMoldByUserId(
        (new DeleteMoldByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withMoldName("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.DeleteMoldByUserIdRequest;
import io.gs2.formation.result.DeleteMoldByUserIdResult;

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

try {
    DeleteMoldByUserIdResult result = client.deleteMoldByUserId(
        new DeleteMoldByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withMoldName("mold-0001")
    );
    Mold 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.DeleteMoldByUserIdRequest;
using Gs2.Gs2Formation.Result.DeleteMoldByUserIdResult;

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.DeleteMoldByUserIdResult> asyncResult = null;
yield return client.DeleteMoldByUserId(
    new Gs2.Gs2Formation.Request.DeleteMoldByUserIdRequest()
        .WithNamespaceName("namespace2")
        .WithUserId("user-0001")
        .WithMoldName("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.deleteMoldByUserId(
        new Gs2Formation.DeleteMoldByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withMoldName("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.delete_mold_by_user_id(
        formation.DeleteMoldByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_mold_name('mold-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.delete_mold_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    moldName='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;

Delete saved form with user ID



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
userId string ~ 128 chars User Id
moldName string ~ 128 chars Form Name

Result

Type Description
item Mold Saved forms

addCapacityByStampSheet

addCapacityByStampSheet

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.AddCapacityByStampSheet(
    &formation.AddCapacityByStampSheetRequest {
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
moldModel := result.MoldModel
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\AddCapacityByStampSheetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->addCapacityByStampSheet(
        (new AddCapacityByStampSheetRequest())
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $item = $result->getItem();
    $moldModel = $result->getMoldModel();
} 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.AddCapacityByStampSheetRequest;
import io.gs2.formation.result.AddCapacityByStampSheetResult;

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

try {
    AddCapacityByStampSheetResult result = client.addCapacityByStampSheet(
        new AddCapacityByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    Mold item = result.getItem();
    MoldModel moldModel = result.getMoldModel();
} 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.AddCapacityByStampSheetRequest;
using Gs2.Gs2Formation.Result.AddCapacityByStampSheetResult;

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.AddCapacityByStampSheetResult> asyncResult = null;
yield return client.AddCapacityByStampSheet(
    new Gs2.Gs2Formation.Request.AddCapacityByStampSheetRequest()
        .WithStampSheet("$stampSheet")
        .WithKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var moldModel = result.MoldModel;
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.addCapacityByStampSheet(
        new Gs2Formation.AddCapacityByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    const item = result.getItem();
    const moldModel = result.getMoldModel();
} 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.add_capacity_by_stamp_sheet(
        formation.AddCapacityByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    mold_model = result.mold_model
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.add_capacity_by_stamp_sheet({
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;
moldModel = result.moldModel;

Use stamp sheets to add capacity size



Request

Type Require Default Limitation Description
stampSheet string ~ 5242880 chars Stamp sheet
keyId string ~ 1024 chars encryption key GRN

Result

Type Description
item Mold Saved forms after capacity addition
moldModel MoldModel Form storage area

setCapacityByStampSheet

setCapacityByStampSheet

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.SetCapacityByStampSheet(
    &formation.SetCapacityByStampSheetRequest {
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
moldModel := result.MoldModel
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\SetCapacityByStampSheetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->setCapacityByStampSheet(
        (new SetCapacityByStampSheetRequest())
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $item = $result->getItem();
    $moldModel = $result->getMoldModel();
} 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.SetCapacityByStampSheetRequest;
import io.gs2.formation.result.SetCapacityByStampSheetResult;

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

try {
    SetCapacityByStampSheetResult result = client.setCapacityByStampSheet(
        new SetCapacityByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    Mold item = result.getItem();
    MoldModel moldModel = result.getMoldModel();
} 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.SetCapacityByStampSheetRequest;
using Gs2.Gs2Formation.Result.SetCapacityByStampSheetResult;

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.SetCapacityByStampSheetResult> asyncResult = null;
yield return client.SetCapacityByStampSheet(
    new Gs2.Gs2Formation.Request.SetCapacityByStampSheetRequest()
        .WithStampSheet("$stampSheet")
        .WithKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var moldModel = result.MoldModel;
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.setCapacityByStampSheet(
        new Gs2Formation.SetCapacityByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    const item = result.getItem();
    const moldModel = result.getMoldModel();
} 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.set_capacity_by_stamp_sheet(
        formation.SetCapacityByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    mold_model = result.mold_model
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.set_capacity_by_stamp_sheet({
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
})

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

result = api_result.result
item = result.item;
moldModel = result.moldModel;

Use stamp sheet to set capacity size



Request

Type Require Default Limitation Description
stampSheet string ~ 5242880 chars Stamp sheet
keyId string ~ 1024 chars encryption key GRN

Result

Type Description
item Mold Saved form after update
moldModel MoldModel Form storage area

describeForms

describeForms

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeForms(
        (new DescribeFormsRequest())
            ->withNamespaceName(self::namespace1)
            ->withMoldName("mold-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.DescribeFormsRequest;
import io.gs2.formation.result.DescribeFormsResult;

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

try {
    DescribeFormsResult result = client.describeForms(
        new DescribeFormsRequest()
            .withNamespaceName("namespace1")
            .withMoldName("mold-0001")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Form> 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.DescribeFormsRequest;
using Gs2.Gs2Formation.Result.DescribeFormsResult;

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.DescribeFormsResult> asyncResult = null;
yield return client.DescribeForms(
    new Gs2.Gs2Formation.Request.DescribeFormsRequest()
        .WithNamespaceName("namespace1")
        .WithMoldName("mold-0001")
        .WithAccessToken("$access_token_0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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.describeForms(
        new Gs2Formation.DescribeFormsRequest()
            .withNamespaceName("namespace1")
            .withMoldName("mold-0001")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_forms(
        formation.DescribeFormsRequest()
            .with_namespace_name(self.hash1)
            .with_mold_name('mold-0001')
            .with_access_token(self.access_token_0001)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.describe_forms({
    namespaceName='namespace1',
    moldName='mold-0001',
    accessToken='$access_token_0001',
    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;

Get list of forms



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
moldName string ~ 128 chars Mold Name
accessToken string ~ 128 chars User Id
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired

Result

Type Description
items Form[] List of Form
nextPageToken string Page token to retrieve the rest of the listing

describeFormsByUserId

describeFormsByUserId

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.DescribeFormsByUserId(
    &formation.DescribeFormsByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        MoldName: pointy.String("mold-0001"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Formation\Gs2FormationRestClient;
use Gs2\Formation\Request\DescribeFormsByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeFormsByUserId(
        (new DescribeFormsByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withMoldName("mold-0001")
            ->withUserId("user-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.formation.rest.Gs2FormationRestClient;
import io.gs2.formation.request.DescribeFormsByUserIdRequest;
import io.gs2.formation.result.DescribeFormsByUserIdResult;

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

try {
    DescribeFormsByUserIdResult result = client.describeFormsByUserId(
        new DescribeFormsByUserIdRequest()
            .withNamespaceName("namespace2")
            .withMoldName("mold-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Form> 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.DescribeFormsByUserIdRequest;
using Gs2.Gs2Formation.Result.DescribeFormsByUserIdResult;

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.DescribeFormsByUserIdResult> asyncResult = null;
yield return client.DescribeFormsByUserId(
    new Gs2.Gs2Formation.Request.DescribeFormsByUserIdRequest()
        .WithNamespaceName("namespace2")
        .WithMoldName("mold-0001")
        .WithUserId("user-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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.describeFormsByUserId(
        new Gs2Formation.DescribeFormsByUserIdRequest()
            .withNamespaceName("namespace2")
            .withMoldName("mold-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_forms_by_user_id(
        formation.DescribeFormsByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_mold_name('mold-0001')
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.describe_forms_by_user_id({
    namespaceName='namespace2',
    moldName='mold-0001',
    userId='user-0001',
    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;

Get list of forms by user ID



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
moldName string ~ 128 chars Mold Name
userId string ~ 128 chars User Id
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data acquired

Result

Type Description
items Form[] List of Form
nextPageToken string Page token to retrieve the rest of the listing

getForm

getForm

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.GetForm(
    &formation.GetFormRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        MoldName: pointy.String("mold-0001"),
        Index: pointy.Int32(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
mold := result.Mold
moldModel := result.MoldModel
formModel := result.FormModel
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\GetFormRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getForm(
        (new GetFormRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withMoldName("mold-0001")
            ->withIndex(0)
    );
    $item = $result->getItem();
    $mold = $result->getMold();
    $moldModel = $result->getMoldModel();
    $formModel = $result->getFormModel();
} 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.GetFormRequest;
import io.gs2.formation.result.GetFormResult;

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

try {
    GetFormResult result = client.getForm(
        new GetFormRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withMoldName("mold-0001")
            .withIndex(0)
    );
    Form item = result.getItem();
    Mold mold = result.getMold();
    MoldModel moldModel = result.getMoldModel();
    FormModel formModel = result.getFormModel();
} 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.GetFormRequest;
using Gs2.Gs2Formation.Result.GetFormResult;

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.GetFormResult> asyncResult = null;
yield return client.GetForm(
    new Gs2.Gs2Formation.Request.GetFormRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithMoldName("mold-0001")
        .WithIndex(0),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var mold = result.Mold;
var moldModel = result.MoldModel;
var formModel = result.FormModel;
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.getForm(
        new Gs2Formation.GetFormRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withMoldName("mold-0001")
            .withIndex(0)
    );
    const item = result.getItem();
    const mold = result.getMold();
    const moldModel = result.getMoldModel();
    const formModel = result.getFormModel();
} 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(
        formation.GetFormRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_mold_name('mold-0001')
            .with_index(0)
    )
    item = result.item
    mold = result.mold
    mold_model = result.mold_model
    form_model = result.form_model
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.get_form({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    moldName='mold-0001',
    index=0,
})

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

result = api_result.result
item = result.item;
mold = result.mold;
moldModel = result.moldModel;
formModel = result.formModel;

Get Form



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
accessToken string ~ 128 chars User Id
moldName string ~ 128 chars Mold Name
index int ~ 2147483646 Index of storage area

Result

Type Description
item Form Form
mold Mold Saved forms
moldModel MoldModel Form storage area
formModel FormModel Form Model

getFormByUserId

getFormByUserId

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.GetFormByUserId(
    &formation.GetFormByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        MoldName: pointy.String("mold-0001"),
        Index: pointy.Int32(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
mold := result.Mold
moldModel := result.MoldModel
formModel := result.FormModel
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\GetFormByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getFormByUserId(
        (new GetFormByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withMoldName("mold-0001")
            ->withIndex(0)
    );
    $item = $result->getItem();
    $mold = $result->getMold();
    $moldModel = $result->getMoldModel();
    $formModel = $result->getFormModel();
} 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.GetFormByUserIdRequest;
import io.gs2.formation.result.GetFormByUserIdResult;

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

try {
    GetFormByUserIdResult result = client.getFormByUserId(
        new GetFormByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withMoldName("mold-0001")
            .withIndex(0)
    );
    Form item = result.getItem();
    Mold mold = result.getMold();
    MoldModel moldModel = result.getMoldModel();
    FormModel formModel = result.getFormModel();
} 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.GetFormByUserIdRequest;
using Gs2.Gs2Formation.Result.GetFormByUserIdResult;

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.GetFormByUserIdResult> asyncResult = null;
yield return client.GetFormByUserId(
    new Gs2.Gs2Formation.Request.GetFormByUserIdRequest()
        .WithNamespaceName("namespace2")
        .WithUserId("user-0001")
        .WithMoldName("mold-0001")
        .WithIndex(0),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var mold = result.Mold;
var moldModel = result.MoldModel;
var formModel = result.FormModel;
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.getFormByUserId(
        new Gs2Formation.GetFormByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withMoldName("mold-0001")
            .withIndex(0)
    );
    const item = result.getItem();
    const mold = result.getMold();
    const moldModel = result.getMoldModel();
    const formModel = result.getFormModel();
} 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_by_user_id(
        formation.GetFormByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_mold_name('mold-0001')
            .with_index(0)
    )
    item = result.item
    mold = result.mold
    mold_model = result.mold_model
    form_model = result.form_model
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.get_form_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    moldName='mold-0001',
    index=0,
})

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

result = api_result.result
item = result.item;
mold = result.mold;
moldModel = result.moldModel;
formModel = result.formModel;

Get form by specifying user ID



Request

Type Require Default Limitation Description
namespaceName string ~ 32 chars Namespace name
userId string ~ 128 chars User Id
moldName string ~ 128 chars Mold Name
index int ~ 2147483646 Index of storage area

Result

Type Description
item Form Form
mold Mold Saved forms
moldModel MoldModel Form storage area
formModel FormModel Form Model

getFormWithSignature

getFormWithSignature

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.GetFormWithSignature(
    &formation.GetFormWithSignatureRequest {
        NamespaceName: pointy.String("namespace2"),
        AccessToken: pointy.String("$access_token_0001"),
        MoldName: pointy.String("mold-0001"),
        Index: pointy.Int32(0),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature
mold := result.Mold
moldModel := result.MoldModel
formModel := result.FormModel
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\GetFormWithSignatureRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getFormWithSignature(
        (new GetFormWithSignatureRequest())
            ->withNamespaceName(self::namespace2)
            ->withAccessToken(self::$accessToken0001)
            ->withMoldName("mold-0001")
            ->withIndex(0)
            ->withKeyId(self::$key1.keyId)
    );
    $item = $result->getItem();
    $body = $result->getBody();
    $signature = $result->getSignature();
    $mold = $result->getMold();
    $moldModel = $result->getMoldModel();
    $formModel = $result->getFormModel();
} 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.GetFormWithSignatureRequest;
import io.gs2.formation.result.GetFormWithSignatureResult;

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

try {
    GetFormWithSignatureResult result = client.getFormWithSignature(
        new GetFormWithSignatureRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withMoldName("mold-0001")
            .withIndex(0)
            .withKeyId("$key1.keyId")
    );
    Form item = result.getItem();
    String body = result.getBody();
    String signature = result.getSignature();
    Mold mold = result.getMold();
    MoldModel moldModel = result.getMoldModel();
    FormModel formModel = result.getFormModel();
} 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.GetFormWithSignatureRequest;
using Gs2.Gs2Formation.Result.GetFormWithSignatureResult;

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.GetFormWithSignatureResult> asyncResult = null;
yield return client.GetFormWithSignature(
    new Gs2.Gs2Formation.Request.GetFormWithSignatureRequest()
        .WithNamespaceName("namespace2")
        .WithAccessToken("$access_token_0001")
        .WithMoldName("mold-0001")
        .WithIndex(0)
        .WithKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
var mold = result.Mold;
var moldModel = result.MoldModel;
var formModel = result.FormModel;
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.getFormWithSignature(
        new Gs2Formation.GetFormWithSignatureRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withMoldName("mold-0001")
            .withIndex(0)
            .withKeyId("$key1.keyId")
    );
    const item = result.getItem();
    const body = result.getBody();
    const signature = result.getSignature();
    const mold = result.getMold();
    const moldModel = result.getMoldModel();
    const formModel = result.getFormModel();
} 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_with_signature(
        formation.GetFormWithSignatureRequest()
            .with_namespace_name(self.hash2)
            .with_access_token(self.access_token_0001)
            .with_mold_name('mold-0001')
            .with_index(0)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    body = result.body
    signature = result.signature
    mold = result.mold
    mold_model = result.mold_model
    form_model = result.form_model
except core.Gs2Exception as e:
    exit(1)

client = gs2('formation')

api_result = client.get_form_with_signature({
    namespaceName='namespace2',
    accessToken='$access_token_0001',
    moldName='mold-0001',
    index=0,
    keyId='$key1.keyId',
})

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

result = api_result.result