API Reference of GS2-MegaField SDK

Model

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.

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsNamespace GRN
namestring~ 32 charsNamespace name
descriptionstring~ 1024 charsDescription
logSettingLogSettingLog output settings
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

AreaModel

Area divides space, and different areas can be treated as different spaces even if they have the same coordinates.

TypeConditionRequireDefaultLimitationDescription
areaModelIdstring~ 1024 charsArea Model GRN
namestring~ 128 charsArea Model Name
metadatastring~ 2048 charsmetadata
layerModelsList<LayerModel>~ 1000 itemsList of layer models

AreaModelMaster

Area divides space, and different areas can be treated as different spaces even if they have the same coordinates.

TypeConditionRequireDefaultLimitationDescription
areaModelMasterIdstring~ 1024 charsArea Model Master GRN
namestring~ 128 charsArea Model Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

LayerModel

Layers allow for multiple logical hierarchies within a single space. For example, it solves the problem of an Enemy being invisible in a space with a large number of characters. Characters are placed on Layer 1. If Enemies are placed on Layer 2, there is no need to worry about them becoming invisible, since each layer can specify the quantity to be acquired within a specified distance.

TypeConditionRequireDefaultLimitationDescription
layerModelIdstring~ 1024 charsLayer Model GRN
namestring~ 128 charsLayer Model Name
metadatastring~ 2048 charsmetadata

LayerModelMaster

Layers allow for multiple logical hierarchies within a single space. For example, it solves the problem of an Enemy being invisible in a space with a large number of characters. Characters are placed on Layer 1. If Enemies are placed on Layer 2, there is no need to worry about them becoming invisible, since each layer can specify the quantity to be acquired within a specified distance.

TypeConditionRequireDefaultLimitationDescription
layerModelMasterIdstring~ 1024 charsLayer Model Master GRN
namestring~ 128 charsLayer Model Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

CurrentFieldMaster

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.

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsCurrently available Field Master GRN
settingsstring~ 5242880 charsMaster data

Layer

TypeConditionRequireDefaultLimitationDescription
layerIdstring~ 1024 charsLayer GRN
areaModelNamestring~ 128 charsArea name
layerModelNamestring~ 128 charsLayer name
numberOfMinEntriesint51 ~ 1000Attempts to join with other nodes when the number of entities in a node falls below a specified value
numberOfMaxEntriesint201 ~ 1000Attempts to split a node if the number of entities in the node exceeds the specified value
createdAtlongDatetime of creation

Spatial

TypeConditionRequireDefaultLimitationDescription
spatialIdstring~ 1024 charsSerial Key GRN
userIdstring~ 128 charsUser Id
areaModelNamestring~ 128 charsArea name
layerModelNamestring~ 128 charsLayer name
positionPositionPosition
vectorVectorVector
rfloat1~ 10000Radius
lastSyncAtlong
createdAtlongDatetime of creation

Position

Position

TypeConditionRequireDefaultLimitationDescription
xfloat~ 1048574X position
yfloat~ 1048574Y position
zfloat~ 1048574Z position

MyPosition

My Location

TypeConditionRequireDefaultLimitationDescription
positionPositionPosition
vectorVectorVector
rfloat1~ 10000Radius

Scope

Surroundings to be acquired

TypeConditionRequireDefaultLimitationDescription
layerNamestring~ 128 charsLayer Model Name
rfloat1 ~ 16777214Radius
limitint1 ~ 100Maximum number of result

Vector

Position

TypeConditionRequireDefaultLimitationDescription
xfloat~ 1048574X position
yfloat~ 1048574Y position
zfloat~ 1048574Z position

LogSetting

Log setting

This type manages log output settings. This type holds the identifier of the log namespace used to output log data. The log namespace ID specifies the GS2-Log namespace to aggregate and store the log data. Through this setting, API request and response log data under this namespace will be output to the target GS2-Log. GS2-Log provides logs in real time, which can be used for system monitoring, analysis, debugging, etc.

TypeConditionRequireDefaultLimitationDescription
loggingNamespaceIdstring~ 1024 charsNamespace GRN

GitHubCheckoutSetting

Setup to check out master data from GitHub

TypeConditionRequireDefaultLimitationDescription
apiKeyIdstring~ 1024 charsGitHub API key GRN
repositoryNamestring~ 1024 charsRepository Name
sourcePathstring~ 1024 charsSource code file path
referenceTypeenum [
“commit_hash”,
“branch”,
“tag”
]
~ 128 charsSource of code
commitHashstring{referenceType} == “commit_hash”~ 1024 charsCommit hash
branchNamestring{referenceType} == “branch”~ 1024 charsBranch Name
tagNamestring{referenceType} == “tag”~ 1024 charsTag Name

Methods

describeNamespaces

Get list of namespaces

Request

TypeConditionRequireDefaultLimitationDescription
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<Namespace>List of Namespace
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

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

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

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

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

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

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

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

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

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

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

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

createNamespace

Create a new namespace

Request

TypeConditionRequireDefaultLimitationDescription
namestring~ 32 charsNamespace name
descriptionstring~ 1024 charsDescription
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceNamespace created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mega_field"
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 := mega_field.Gs2MegaFieldRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &mega_field.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        LogSetting: &megaField.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\MegaField\Gs2MegaFieldRestClient;
use Gs2\MegaField\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)
            ->withLogSetting((new \Gs2\MegaField\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.megaField.rest.Gs2MegaFieldRestClient;
import io.gs2.megaField.request.CreateNamespaceRequest;
import io.gs2.megaField.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withLogSetting(new io.gs2.megaField.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.Gs2MegaField.Gs2MegaFieldRestClient;
using Gs2.Gs2MegaField.Request.CreateNamespaceRequest;
using Gs2.Gs2MegaField.Result.CreateNamespaceResult;

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

AsyncResult<Gs2.Gs2MegaField.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2MegaField.Request.CreateNamespaceRequest()
        .WithName("namespace1")
        .WithDescription(null)
        .WithLogSetting(new Gs2.Gs2MegaField.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 Gs2MegaField from '@/gs2/megaField';

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

try {
    const result = await client.createNamespace(
        new Gs2MegaField.CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withLogSetting(new Gs2MegaField.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 mega_field

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

try:
    result = client.create_namespace(
        mega_field.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_log_setting(
                mega_field.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('megaField')

api_result = client.create_namespace({
    name="namespace1",
    description=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

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

result = api_result.result
item = result.item;

getNamespaceStatus

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
statusstring

Implementation Example

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

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

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

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

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

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

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

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

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

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

result = api_result.result
status = result.status;

getNamespace

Get namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemNamespaceNamespace

Implementation Example

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

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

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

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

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

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

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

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

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

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

result = api_result.result
item = result.item;

updateNamespace

Update namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
descriptionstring~ 1024 charsDescription
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceUpdated namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mega_field"
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 := mega_field.Gs2MegaFieldRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &mega_field.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        LogSetting: &megaField.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\MegaField\Gs2MegaFieldRestClient;
use Gs2\MegaField\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")
            ->withLogSetting((new \Gs2\MegaField\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.megaField.rest.Gs2MegaFieldRestClient;
import io.gs2.megaField.request.UpdateNamespaceRequest;
import io.gs2.megaField.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withLogSetting(new io.gs2.megaField.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.Gs2MegaField.Gs2MegaFieldRestClient;
using Gs2.Gs2MegaField.Request.UpdateNamespaceRequest;
using Gs2.Gs2MegaField.Result.UpdateNamespaceResult;

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

AsyncResult<Gs2.Gs2MegaField.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2MegaField.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace1")
        .WithDescription("description1")
        .WithLogSetting(new Gs2.Gs2MegaField.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 Gs2MegaField from '@/gs2/megaField';

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

try {
    const result = await client.updateNamespace(
        new Gs2MegaField.UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withLogSetting(new Gs2MegaField.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 mega_field

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

try:
    result = client.update_namespace(
        mega_field.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_log_setting(
                mega_field.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('megaField')

api_result = client.update_namespace({
    namespaceName="namespace1",
    description="description1",
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

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

result = api_result.result
item = result.item;

deleteNamespace

Delete namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemNamespaceDeleted namespace

Implementation Example

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

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

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

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

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

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

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

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

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;

describeAreaModels

Get list of area models

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemsList<AreaModel>List of Area Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mega_field"
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 := mega_field.Gs2MegaFieldRestClient{
    Session: &session,
}
result, err := client.DescribeAreaModels(
    &mega_field.DescribeAreaModelsRequest {
        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\MegaField\Gs2MegaFieldRestClient;
use Gs2\MegaField\Request\DescribeAreaModelsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeAreaModels(
        (new DescribeAreaModelsRequest())
            ->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.megaField.rest.Gs2MegaFieldRestClient;
import io.gs2.megaField.request.DescribeAreaModelsRequest;
import io.gs2.megaField.result.DescribeAreaModelsResult;

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

try {
    DescribeAreaModelsResult result = client.describeAreaModels(
        new DescribeAreaModelsRequest()
            .withNamespaceName("namespace1")
    );
    List<AreaModel> 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.Gs2MegaField.Gs2MegaFieldRestClient;
using Gs2.Gs2MegaField.Request.DescribeAreaModelsRequest;
using Gs2.Gs2MegaField.Result.DescribeAreaModelsResult;

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

AsyncResult<Gs2.Gs2MegaField.Result.DescribeAreaModelsResult> asyncResult = null;
yield return client.DescribeAreaModels(
    new Gs2.Gs2MegaField.Request.DescribeAreaModelsRequest()
        .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 Gs2MegaField from '@/gs2/megaField';

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

try {
    const result = await client.describeAreaModels(
        new Gs2MegaField.DescribeAreaModelsRequest()
            .withNamespaceName("namespace1")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mega_field

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

try:
    result = client.describe_area_models(
        mega_field.DescribeAreaModelsRequest()
            .with_namespace_name(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

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

getAreaModel

Get Area Model

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
areaModelNamestring~ 128 charsArea Model Name

Result

TypeDescription
itemAreaModelArea Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mega_field"
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 := mega_field.Gs2MegaFieldRestClient{
    Session: &session,
}
result, err := client.GetAreaModel(
    &mega_field.GetAreaModelRequest {
        NamespaceName: pointy.String("namespace1"),
        AreaModelName: pointy.String("area-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\MegaField\Gs2MegaFieldRestClient;
use Gs2\MegaField\Request\GetAreaModelRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getAreaModel(
        (new GetAreaModelRequest())
            ->withNamespaceName(self::namespace1)
            ->withAreaModelName("area-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.megaField.rest.Gs2MegaFieldRestClient;
import io.gs2.megaField.request.GetAreaModelRequest;
import io.gs2.megaField.result.GetAreaModelResult;

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

try {
    GetAreaModelResult result = client.getAreaModel(
        new GetAreaModelRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
    );
    AreaModel 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.Gs2MegaField.Gs2MegaFieldRestClient;
using Gs2.Gs2MegaField.Request.GetAreaModelRequest;
using Gs2.Gs2MegaField.Result.GetAreaModelResult;

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

AsyncResult<Gs2.Gs2MegaField.Result.GetAreaModelResult> asyncResult = null;
yield return client.GetAreaModel(
    new Gs2.Gs2MegaField.Request.GetAreaModelRequest()
        .WithNamespaceName("namespace1")
        .WithAreaModelName("area-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 Gs2MegaField from '@/gs2/megaField';

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

try {
    const result = await client.getAreaModel(
        new Gs2MegaField.GetAreaModelRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mega_field

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

try:
    result = client.get_area_model(
        mega_field.GetAreaModelRequest()
            .with_namespace_name(self.hash1)
            .with_area_model_name('area-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.get_area_model({
    namespaceName="namespace1",
    areaModelName="area-0001",
})

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

result = api_result.result
item = result.item;

describeAreaModelMasters

Get list of area model masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<AreaModelMaster>List of Area Model Master
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mega_field"
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 := mega_field.Gs2MegaFieldRestClient{
    Session: &session,
}
result, err := client.DescribeAreaModelMasters(
    &mega_field.DescribeAreaModelMastersRequest {
        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\MegaField\Gs2MegaFieldRestClient;
use Gs2\MegaField\Request\DescribeAreaModelMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeAreaModelMasters(
        (new DescribeAreaModelMastersRequest())
            ->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.megaField.rest.Gs2MegaFieldRestClient;
import io.gs2.megaField.request.DescribeAreaModelMastersRequest;
import io.gs2.megaField.result.DescribeAreaModelMastersResult;

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

try {
    DescribeAreaModelMastersResult result = client.describeAreaModelMasters(
        new DescribeAreaModelMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<AreaModelMaster> 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.Gs2MegaField.Gs2MegaFieldRestClient;
using Gs2.Gs2MegaField.Request.DescribeAreaModelMastersRequest;
using Gs2.Gs2MegaField.Result.DescribeAreaModelMastersResult;

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

AsyncResult<Gs2.Gs2MegaField.Result.DescribeAreaModelMastersResult> asyncResult = null;
yield return client.DescribeAreaModelMasters(
    new Gs2.Gs2MegaField.Request.DescribeAreaModelMastersRequest()
        .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 Gs2MegaField from '@/gs2/megaField';

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

try {
    const result = await client.describeAreaModelMasters(
        new Gs2MegaField.DescribeAreaModelMastersRequest()
            .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 mega_field

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

try:
    result = client.describe_area_model_masters(
        mega_field.DescribeAreaModelMastersRequest()
            .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('megaField')

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

createAreaModelMaster

Create a new area model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
namestring~ 128 charsArea Model Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata

Result

TypeDescription
itemAreaModelMasterInventory model master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mega_field"
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 := mega_field.Gs2MegaFieldRestClient{
    Session: &session,
}
result, err := client.CreateAreaModelMaster(
    &mega_field.CreateAreaModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("area-0001"),
        Description: nil,
        Metadata: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\MegaField\Gs2MegaFieldRestClient;
use Gs2\MegaField\Request\CreateAreaModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createAreaModelMaster(
        (new CreateAreaModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("area-0001")
            ->withDescription(null)
            ->withMetadata(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.megaField.rest.Gs2MegaFieldRestClient;
import io.gs2.megaField.request.CreateAreaModelMasterRequest;
import io.gs2.megaField.result.CreateAreaModelMasterResult;

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

try {
    CreateAreaModelMasterResult result = client.createAreaModelMaster(
        new CreateAreaModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("area-0001")
            .withDescription(null)
            .withMetadata(null)
    );
    AreaModelMaster 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.Gs2MegaField.Gs2MegaFieldRestClient;
using Gs2.Gs2MegaField.Request.CreateAreaModelMasterRequest;
using Gs2.Gs2MegaField.Result.CreateAreaModelMasterResult;

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

AsyncResult<Gs2.Gs2MegaField.Result.CreateAreaModelMasterResult> asyncResult = null;
yield return client.CreateAreaModelMaster(
    new Gs2.Gs2MegaField.Request.CreateAreaModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithName("area-0001")
        .WithDescription(null)
        .WithMetadata(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2MegaField from '@/gs2/megaField';

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

try {
    const result = await client.createAreaModelMaster(
        new Gs2MegaField.CreateAreaModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("area-0001")
            .withDescription(null)
            .withMetadata(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mega_field

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

try:
    result = client.create_area_model_master(
        mega_field.CreateAreaModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('area-0001')
            .with_description(None)
            .with_metadata(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.create_area_model_master({
    namespaceName="namespace1",
    name="area-0001",
    description=nil,
    metadata=nil,
})

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

result = api_result.result
item = result.item;

getAreaModelMaster

Get area model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
areaModelNamestring~ 128 charsArea Model Name

Result

TypeDescription
itemAreaModelMasterArea Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mega_field"
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 := mega_field.Gs2MegaFieldRestClient{
    Session: &session,
}
result, err := client.GetAreaModelMaster(
    &mega_field.GetAreaModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        AreaModelName: pointy.String("area-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\MegaField\Gs2MegaFieldRestClient;
use Gs2\MegaField\Request\GetAreaModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getAreaModelMaster(
        (new GetAreaModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withAreaModelName("area-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.megaField.rest.Gs2MegaFieldRestClient;
import io.gs2.megaField.request.GetAreaModelMasterRequest;
import io.gs2.megaField.result.GetAreaModelMasterResult;

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

try {
    GetAreaModelMasterResult result = client.getAreaModelMaster(
        new GetAreaModelMasterRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
    );
    AreaModelMaster 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.Gs2MegaField.Gs2MegaFieldRestClient;
using Gs2.Gs2MegaField.Request.GetAreaModelMasterRequest;
using Gs2.Gs2MegaField.Result.GetAreaModelMasterResult;

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

AsyncResult<Gs2.Gs2MegaField.Result.GetAreaModelMasterResult> asyncResult = null;
yield return client.GetAreaModelMaster(
    new Gs2.Gs2MegaField.Request.GetAreaModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithAreaModelName("area-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 Gs2MegaField from '@/gs2/megaField';

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

try {
    const result = await client.getAreaModelMaster(
        new Gs2MegaField.GetAreaModelMasterRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mega_field

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

try:
    result = client.get_area_model_master(
        mega_field.GetAreaModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_area_model_name('area-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.get_area_model_master({
    namespaceName="namespace1",
    areaModelName="area-0001",
})

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

result = api_result.result
item = result.item;

updateAreaModelMaster

Update area model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
areaModelNamestring~ 128 charsArea Model Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata

Result

TypeDescription
itemAreaModelMasterUpdated area model master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mega_field"
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 := mega_field.Gs2MegaFieldRestClient{
    Session: &session,
}
result, err := client.UpdateAreaModelMaster(
    &mega_field.UpdateAreaModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        AreaModelName: pointy.String("area-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("AREA_MASTER"),
    }
)
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\MegaField\Gs2MegaFieldRestClient;
use Gs2\MegaField\Request\UpdateAreaModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateAreaModelMaster(
        (new UpdateAreaModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withAreaModelName("area-0001")
            ->withDescription("description1")
            ->withMetadata("AREA_MASTER")
    );
    $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.megaField.rest.Gs2MegaFieldRestClient;
import io.gs2.megaField.request.UpdateAreaModelMasterRequest;
import io.gs2.megaField.result.UpdateAreaModelMasterResult;

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

try {
    UpdateAreaModelMasterResult result = client.updateAreaModelMaster(
        new UpdateAreaModelMasterRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withDescription("description1")
            .withMetadata("AREA_MASTER")
    );
    AreaModelMaster 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.Gs2MegaField.Gs2MegaFieldRestClient;
using Gs2.Gs2MegaField.Request.UpdateAreaModelMasterRequest;
using Gs2.Gs2MegaField.Result.UpdateAreaModelMasterResult;

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

AsyncResult<Gs2.Gs2MegaField.Result.UpdateAreaModelMasterResult> asyncResult = null;
yield return client.UpdateAreaModelMaster(
    new Gs2.Gs2MegaField.Request.UpdateAreaModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithAreaModelName("area-0001")
        .WithDescription("description1")
        .WithMetadata("AREA_MASTER"),
    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 Gs2MegaField from '@/gs2/megaField';

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

try {
    const result = await client.updateAreaModelMaster(
        new Gs2MegaField.UpdateAreaModelMasterRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withDescription("description1")
            .withMetadata("AREA_MASTER")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mega_field

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

try:
    result = client.update_area_model_master(
        mega_field.UpdateAreaModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_area_model_name('area-0001')
            .with_description('description1')
            .with_metadata('AREA_MASTER')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.update_area_model_master({
    namespaceName="namespace1",
    areaModelName="area-0001",
    description="description1",
    metadata="AREA_MASTER",
})

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

result = api_result.result
item = result.item;

deleteAreaModelMaster

Delete area model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
areaModelNamestring~ 128 charsArea Model Name

Result

TypeDescription
itemAreaModelMasterDeleted area model master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mega_field"
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 := mega_field.Gs2MegaFieldRestClient{
    Session: &session,
}
result, err := client.DeleteAreaModelMaster(
    &mega_field.DeleteAreaModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        AreaModelName: pointy.String("area-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\MegaField\Gs2MegaFieldRestClient;
use Gs2\MegaField\Request\DeleteAreaModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteAreaModelMaster(
        (new DeleteAreaModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withAreaModelName("area-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.megaField.rest.Gs2MegaFieldRestClient;
import io.gs2.megaField.request.DeleteAreaModelMasterRequest;
import io.gs2.megaField.result.DeleteAreaModelMasterResult;

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

try {
    DeleteAreaModelMasterResult result = client.deleteAreaModelMaster(
        new DeleteAreaModelMasterRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
    );
    AreaModelMaster 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.Gs2MegaField.Gs2MegaFieldRestClient;
using Gs2.Gs2MegaField.Request.DeleteAreaModelMasterRequest;
using Gs2.Gs2MegaField.Result.DeleteAreaModelMasterResult;

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

AsyncResult<Gs2.Gs2MegaField.Result.DeleteAreaModelMasterResult> asyncResult = null;
yield return client.DeleteAreaModelMaster(
    new Gs2.Gs2MegaField.Request.DeleteAreaModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithAreaModelName("area-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 Gs2MegaField from '@/gs2/megaField';

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

try {
    const result = await client.deleteAreaModelMaster(
        new Gs2MegaField.DeleteAreaModelMasterRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mega_field

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

try:
    result = client.delete_area_model_master(
        mega_field.DeleteAreaModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_area_model_name('area-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.delete_area_model_master({
    namespaceName="namespace1",
    areaModelName="area-0001",
})

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

result = api_result.result
item = result.item;

describeLayerModels

Get list of layer models

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
areaModelNamestring~ 128 charsArea Model Name

Result

TypeDescription
itemsList<LayerModel>List of Layer Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mega_field"
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 := mega_field.Gs2MegaFieldRestClient{
    Session: &session,
}
result, err := client.DescribeLayerModels(
    &mega_field.DescribeLayerModelsRequest {
        NamespaceName: pointy.String("namespace1"),
        AreaModelName: pointy.String("area-0001"),
    }
)
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\MegaField\Gs2MegaFieldRestClient;
use Gs2\MegaField\Request\DescribeLayerModelsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeLayerModels(
        (new DescribeLayerModelsRequest())
            ->withNamespaceName(self::namespace1)
            ->withAreaModelName("area-0001")
    );
    $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.megaField.rest.Gs2MegaFieldRestClient;
import io.gs2.megaField.request.DescribeLayerModelsRequest;
import io.gs2.megaField.result.DescribeLayerModelsResult;

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

try {
    DescribeLayerModelsResult result = client.describeLayerModels(
        new DescribeLayerModelsRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
    );
    List<LayerModel> 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.Gs2MegaField.Gs2MegaFieldRestClient;
using Gs2.Gs2MegaField.Request.DescribeLayerModelsRequest;
using Gs2.Gs2MegaField.Result.DescribeLayerModelsResult;

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

AsyncResult<Gs2.Gs2MegaField.Result.DescribeLayerModelsResult> asyncResult = null;
yield return client.DescribeLayerModels(
    new Gs2.Gs2MegaField.Request.DescribeLayerModelsRequest()
        .WithNamespaceName("namespace1")
        .WithAreaModelName("area-0001"),
    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 Gs2MegaField from '@/gs2/megaField';

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

try {
    const result = await client.describeLayerModels(
        new Gs2MegaField.DescribeLayerModelsRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mega_field

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

try:
    result = client.describe_layer_models(
        mega_field.DescribeLayerModelsRequest()
            .with_namespace_name(self.hash1)
            .with_area_model_name('area-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.describe_layer_models({
    namespaceName="namespace1",
    areaModelName="area-0001",
})

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

result = api_result.result
items = result.items;

getLayerModel

Get layer model

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
areaModelNamestring~ 128 charsArea Model Name
layerModelNamestring~ 128 charsLayer Model Name

Result

TypeDescription
itemLayerModel

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mega_field"
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 := mega_field.Gs2MegaFieldRestClient{
    Session: &session,
}
result, err := client.GetLayerModel(
    &mega_field.GetLayerModelRequest {
        NamespaceName: pointy.String("namespace1"),
        AreaModelName: pointy.String("area-0001"),
        LayerModelName: pointy.String("layer-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\MegaField\Gs2MegaFieldRestClient;
use Gs2\MegaField\Request\GetLayerModelRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getLayerModel(
        (new GetLayerModelRequest())
            ->withNamespaceName(self::namespace1)
            ->withAreaModelName("area-0001")
            ->withLayerModelName("layer-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.megaField.rest.Gs2MegaFieldRestClient;
import io.gs2.megaField.request.GetLayerModelRequest;
import io.gs2.megaField.result.GetLayerModelResult;

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

try {
    GetLayerModelResult result = client.getLayerModel(
        new GetLayerModelRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
    );
    LayerModel 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.Gs2MegaField.Gs2MegaFieldRestClient;
using Gs2.Gs2MegaField.Request.GetLayerModelRequest;
using Gs2.Gs2MegaField.Result.GetLayerModelResult;

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

AsyncResult<Gs2.Gs2MegaField.Result.GetLayerModelResult> asyncResult = null;
yield return client.GetLayerModel(
    new Gs2.Gs2MegaField.Request.GetLayerModelRequest()
        .WithNamespaceName("namespace1")
        .WithAreaModelName("area-0001")
        .WithLayerModelName("layer-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 Gs2MegaField from '@/gs2/megaField';

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

try {
    const result = await client.getLayerModel(
        new Gs2MegaField.GetLayerModelRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mega_field

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

try:
    result = client.get_layer_model(
        mega_field.GetLayerModelRequest()
            .with_namespace_name(self.hash1)
            .with_area_model_name('area-0001')
            .with_layer_model_name('layer-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.get_layer_model({
    namespaceName="namespace1",
    areaModelName="area-0001",
    layerModelName="layer-0001",
})

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

result = api_result.result
item = result.item;

describeLayerModelMasters

Get list of layer model masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
areaModelNamestring~ 128 charsArea Model Name
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<LayerModelMaster>List of Layer Model Master
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mega_field"
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 := mega_field.Gs2MegaFieldRestClient{
    Session: &session,
}
result, err := client.DescribeLayerModelMasters(
    &mega_field.DescribeLayerModelMastersRequest {
        NamespaceName: pointy.String("namespace1"),
        AreaModelName: pointy.String("area-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\MegaField\Gs2MegaFieldRestClient;
use Gs2\MegaField\Request\DescribeLayerModelMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeLayerModelMasters(
        (new DescribeLayerModelMastersRequest())
            ->withNamespaceName(self::namespace1)
            ->withAreaModelName("area-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.megaField.rest.Gs2MegaFieldRestClient;
import io.gs2.megaField.request.DescribeLayerModelMastersRequest;
import io.gs2.megaField.result.DescribeLayerModelMastersResult;

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

try {
    DescribeLayerModelMastersResult result = client.describeLayerModelMasters(
        new DescribeLayerModelMastersRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<LayerModelMaster> 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.Gs2MegaField.Gs2MegaFieldRestClient;
using Gs2.Gs2MegaField.Request.DescribeLayerModelMastersRequest;
using Gs2.Gs2MegaField.Result.DescribeLayerModelMastersResult;

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

AsyncResult<Gs2.Gs2MegaField.Result.DescribeLayerModelMastersResult> asyncResult = null;
yield return client.DescribeLayerModelMasters(
    new Gs2.Gs2MegaField.Request.DescribeLayerModelMastersRequest()
        .WithNamespaceName("namespace1")
        .WithAreaModelName("area-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 Gs2MegaField from '@/gs2/megaField';

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

try {
    const result = await client.describeLayerModelMasters(
        new Gs2MegaField.DescribeLayerModelMastersRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-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 mega_field

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

try:
    result = client.describe_layer_model_masters(
        mega_field.DescribeLayerModelMastersRequest()
            .with_namespace_name(self.hash1)
            .with_area_model_name('area-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('megaField')

api_result = client.describe_layer_model_masters({
    namespaceName="namespace1",
    areaModelName="area-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;

createLayerModelMaster

Create a new layer model master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
areaModelNamestring~ 128 charsArea Model Name
namestring~ 128 charsLayer Model Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata

Result

TypeDescription
itemLayerModelMasterItem model master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mega_field"
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 := mega_field.Gs2MegaFieldRestClient{
    Session: &session,
}
result, err := client.CreateLayerModelMaster(
    &mega_field.CreateLayerModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        AreaModelName: pointy.String("area-0001"),
        Name: pointy.String("layer-0001"),
        Description: nil,
        Metadata: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\MegaField\Gs2MegaFieldRestClient;
use Gs2\MegaField\Request\CreateLayerModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createLayerModelMaster(
        (new CreateLayerModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withAreaModelName("area-0001")
            ->withName("layer-0001")
            ->withDescription(null)
            ->withMetadata(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.megaField.rest.Gs2MegaFieldRestClient;
import io.gs2.megaField.request.CreateLayerModelMasterRequest;
import io.gs2.megaField.result.CreateLayerModelMasterResult;

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

try {
    CreateLayerModelMasterResult result = client.createLayerModelMaster(
        new CreateLayerModelMasterRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withName("layer-0001")
            .withDescription(null)
            .withMetadata(null)
    );
    LayerModelMaster item = result.getItem();
} catch