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 of Namespace
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 of Namespace
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 charsNamespace 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 export settings

TypeConditionRequireDefaultLimitationDescription
loggingNamespaceIdstring~ 1024 charsNamespace GRN

GitHubCheckoutSetting

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 of Namespace
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 of Namespace
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 of Namespace
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 (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.CreateLayerModelMasterRequest;
using Gs2.Gs2MegaField.Result.CreateLayerModelMasterResult;

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.CreateLayerModelMasterResult> asyncResult = null;
yield return client.CreateLayerModelMaster(
    new Gs2.Gs2MegaField.Request.CreateLayerModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithAreaModelName("area-0001")
        .WithName("layer-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.createLayerModelMaster(
        new Gs2MegaField.CreateLayerModelMasterRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withName("layer-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_layer_model_master(
        mega_field.CreateLayerModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_area_model_name('area-0001')
            .with_name('layer-0001')
            .with_description(None)
            .with_metadata(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.create_layer_model_master({
    namespaceName='namespace1',
    areaModelName='area-0001',
    name='layer-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;

getLayerModelMaster

Get layer model master

Request

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

Result

TypeDescription
itemLayerModelMasterLayer 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.GetLayerModelMaster(
    &mega_field.GetLayerModelMasterRequest {
        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\GetLayerModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getLayerModelMaster(
        (new GetLayerModelMasterRequest())
            ->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.GetLayerModelMasterRequest;
import io.gs2.megaField.result.GetLayerModelMasterResult;

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

try {
    GetLayerModelMasterResult result = client.getLayerModelMaster(
        new GetLayerModelMasterRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
    );
    LayerModelMaster 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.GetLayerModelMasterRequest;
using Gs2.Gs2MegaField.Result.GetLayerModelMasterResult;

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.GetLayerModelMasterResult> asyncResult = null;
yield return client.GetLayerModelMaster(
    new Gs2.Gs2MegaField.Request.GetLayerModelMasterRequest()
        .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.getLayerModelMaster(
        new Gs2MegaField.GetLayerModelMasterRequest()
            .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_master(
        mega_field.GetLayerModelMasterRequest()
            .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_master({
    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;

updateLayerModelMaster

Update Layer Model Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
areaModelNamestring~ 128 charsArea Model Name
layerModelNamestring~ 128 charsLayer Model Name
descriptionstring~ 1024 charsdescription of Namespace
metadatastring~ 2048 charsmetadata

Result

TypeDescription
itemLayerModelMasterUpdated Layer 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.UpdateLayerModelMaster(
    &mega_field.UpdateLayerModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        AreaModelName: pointy.String("area-0001"),
        LayerModelName: pointy.String("layer-0001"),
        Description: pointy.String("description1"),
        Metadata: 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\UpdateLayerModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateLayerModelMaster(
        (new UpdateLayerModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withAreaModelName("area-0001")
            ->withLayerModelName("layer-0001")
            ->withDescription("description1")
            ->withMetadata("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.UpdateLayerModelMasterRequest;
import io.gs2.megaField.result.UpdateLayerModelMasterResult;

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

try {
    UpdateLayerModelMasterResult result = client.updateLayerModelMaster(
        new UpdateLayerModelMasterRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withDescription("description1")
            .withMetadata("LAYER_0001")
    );
    LayerModelMaster 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.UpdateLayerModelMasterRequest;
using Gs2.Gs2MegaField.Result.UpdateLayerModelMasterResult;

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.UpdateLayerModelMasterResult> asyncResult = null;
yield return client.UpdateLayerModelMaster(
    new Gs2.Gs2MegaField.Request.UpdateLayerModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithAreaModelName("area-0001")
        .WithLayerModelName("layer-0001")
        .WithDescription("description1")
        .WithMetadata("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.updateLayerModelMaster(
        new Gs2MegaField.UpdateLayerModelMasterRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withDescription("description1")
            .withMetadata("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.update_layer_model_master(
        mega_field.UpdateLayerModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_area_model_name('area-0001')
            .with_layer_model_name('layer-0001')
            .with_description('description1')
            .with_metadata('LAYER_0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.update_layer_model_master({
    namespaceName='namespace1',
    areaModelName='area-0001',
    layerModelName='layer-0001',
    description='description1',
    metadata='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;

deleteLayerModelMaster

Delete Layer Model Master

Request

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

Result

TypeDescription
itemLayerModelMasterDeleted Layer 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.DeleteLayerModelMaster(
    &mega_field.DeleteLayerModelMasterRequest {
        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\DeleteLayerModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteLayerModelMaster(
        (new DeleteLayerModelMasterRequest())
            ->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.DeleteLayerModelMasterRequest;
import io.gs2.megaField.result.DeleteLayerModelMasterResult;

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

try {
    DeleteLayerModelMasterResult result = client.deleteLayerModelMaster(
        new DeleteLayerModelMasterRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
    );
    LayerModelMaster 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.DeleteLayerModelMasterRequest;
using Gs2.Gs2MegaField.Result.DeleteLayerModelMasterResult;

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.DeleteLayerModelMasterResult> asyncResult = null;
yield return client.DeleteLayerModelMaster(
    new Gs2.Gs2MegaField.Request.DeleteLayerModelMasterRequest()
        .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.deleteLayerModelMaster(
        new Gs2MegaField.DeleteLayerModelMasterRequest()
            .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.delete_layer_model_master(
        mega_field.DeleteLayerModelMasterRequest()
            .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.delete_layer_model_master({
    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;

exportMaster

Export master data for the currently available possession master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

result = api_result.result
item = result.item;

getCurrentFieldMaster

Retrieve the currently available possession master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemCurrentFieldMasterCurrently available possession 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.GetCurrentFieldMaster(
    &mega_field.GetCurrentFieldMasterRequest {
        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\GetCurrentFieldMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCurrentFieldMaster(
        (new GetCurrentFieldMasterRequest())
            ->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.GetCurrentFieldMasterRequest;
import io.gs2.megaField.result.GetCurrentFieldMasterResult;

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

try {
    GetCurrentFieldMasterResult result = client.getCurrentFieldMaster(
        new GetCurrentFieldMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentFieldMaster 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.GetCurrentFieldMasterRequest;
using Gs2.Gs2MegaField.Result.GetCurrentFieldMasterResult;

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.GetCurrentFieldMasterResult> asyncResult = null;
yield return client.GetCurrentFieldMaster(
    new Gs2.Gs2MegaField.Request.GetCurrentFieldMasterRequest()
        .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.getCurrentFieldMaster(
        new Gs2MegaField.GetCurrentFieldMasterRequest()
            .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_current_field_master(
        mega_field.GetCurrentFieldMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

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

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

result = api_result.result
item = result.item;

updateCurrentFieldMaster

Update the currently available possession master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
settingsstring~ 5242880 charsMaster data

Result

TypeDescription
itemCurrentFieldMasterUpdated and currently available possession 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.UpdateCurrentFieldMaster(
    &mega_field.UpdateCurrentFieldMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Settings: pointy.String("{\"version\": \"2022-08-28\", \"areaModels\": [{\"name\": \"area-0001\", \"metadata\": \"AREA_0001\", \"layerModels\": [{\"name\": \"layer-0001\", \"metadata\": \"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\UpdateCurrentFieldMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentFieldMaster(
        (new UpdateCurrentFieldMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSettings("{\"version\": \"2022-08-28\", \"areaModels\": [{\"name\": \"area-0001\", \"metadata\": \"AREA_0001\", \"layerModels\": [{\"name\": \"layer-0001\", \"metadata\": \"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.UpdateCurrentFieldMasterRequest;
import io.gs2.megaField.result.UpdateCurrentFieldMasterResult;

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

try {
    UpdateCurrentFieldMasterResult result = client.updateCurrentFieldMaster(
        new UpdateCurrentFieldMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\"version\": \"2022-08-28\", \"areaModels\": [{\"name\": \"area-0001\", \"metadata\": \"AREA_0001\", \"layerModels\": [{\"name\": \"layer-0001\", \"metadata\": \"LAYER_0001\"}]}]}")
    );
    CurrentFieldMaster 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.UpdateCurrentFieldMasterRequest;
using Gs2.Gs2MegaField.Result.UpdateCurrentFieldMasterResult;

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.UpdateCurrentFieldMasterResult> asyncResult = null;
yield return client.UpdateCurrentFieldMaster(
    new Gs2.Gs2MegaField.Request.UpdateCurrentFieldMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSettings("{\"version\": \"2022-08-28\", \"areaModels\": [{\"name\": \"area-0001\", \"metadata\": \"AREA_0001\", \"layerModels\": [{\"name\": \"layer-0001\", \"metadata\": \"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.updateCurrentFieldMaster(
        new Gs2MegaField.UpdateCurrentFieldMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\"version\": \"2022-08-28\", \"areaModels\": [{\"name\": \"area-0001\", \"metadata\": \"AREA_0001\", \"layerModels\": [{\"name\": \"layer-0001\", \"metadata\": \"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.update_current_field_master(
        mega_field.UpdateCurrentFieldMasterRequest()
            .with_namespace_name(self.hash1)
            .with_settings('{"version": "2022-08-28", "areaModels": [{"name": "area-0001", "metadata": "AREA_0001", "layerModels": [{"name": "layer-0001", "metadata": "LAYER_0001"}]}]}')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.update_current_field_master({
    namespaceName='namespace1',
    settings='{"version": "2022-08-28", "areaModels": [{"name": "area-0001", "metadata": "AREA_0001", "layerModels": [{"name": "layer-0001", "metadata": "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;

updateCurrentFieldMasterFromGitHub

Update the currently available possession master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
checkoutSettingGitHubCheckoutSettingSetup to check out master data from GitHub

Result

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

result = api_result.result
item = result.item;

putPosition

Put position

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
areaModelNamestring~ 128 charsArea name
layerModelNamestring~ 128 charsLayer name
positionPositionPosition
vectorVectorVector
rfloat1~ 10000Radius

Result

TypeDescription
itemSpatialSpatial

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.PutPosition(
    &mega_field.PutPositionRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        AreaModelName: pointy.String("area-0001"),
        LayerModelName: pointy.String("layer-0001"),
        Position: {'x': 0, 'y': 1, 'z': 2},
        Vector: {'x': 10, 'y': 11, 'z': 12},
        R: pointy.Float32(5),
    }
)
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\PutPositionRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->putPosition(
        (new PutPositionRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withAreaModelName("area-0001")
            ->withLayerModelName("layer-0001")
            ->withPosition({'x': 0, 'y': 1, 'z': 2})
            ->withVector({'x': 10, 'y': 11, 'z': 12})
            ->withR(5)
    );
    $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.PutPositionRequest;
import io.gs2.megaField.result.PutPositionResult;

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

try {
    PutPositionResult result = client.putPosition(
        new PutPositionRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withPosition({'x': 0, 'y': 1, 'z': 2})
            .withVector({'x': 10, 'y': 11, 'z': 12})
            .withR(5f)
    );
    Spatial 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.PutPositionRequest;
using Gs2.Gs2MegaField.Result.PutPositionResult;

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.PutPositionResult> asyncResult = null;
yield return client.PutPosition(
    new Gs2.Gs2MegaField.Request.PutPositionRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithAreaModelName("area-0001")
        .WithLayerModelName("layer-0001")
        .WithPosition({'x': 0, 'y': 1, 'z': 2})
        .WithVector({'x': 10, 'y': 11, 'z': 12})
        .WithR(5f),
    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.putPosition(
        new Gs2MegaField.PutPositionRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withPosition({'x': 0, 'y': 1, 'z': 2})
            .withVector({'x': 10, 'y': 11, 'z': 12})
            .withR(5)
    );
    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.put_position(
        mega_field.PutPositionRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_area_model_name('area-0001')
            .with_layer_model_name('layer-0001')
            .with_position({'x': 0, 'y': 1, 'z': 2})
            .with_vector({'x': 10, 'y': 11, 'z': 12})
            .with_r(5)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.put_position({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    areaModelName='area-0001',
    layerModelName='layer-0001',
    position={'x': 0, 'y': 1, 'z': 2},
    vector={'x': 10, 'y': 11, 'z': 12},
    r=5,
})

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

result = api_result.result
item = result.item;

putPositionByUserId

Put position by specifying user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
areaModelNamestring~ 128 charsArea name
layerModelNamestring~ 128 charsLayer name
positionPositionPosition
vectorVectorVector
rfloat1~ 10000Radius

Result

TypeDescription
itemSpatialSpatial

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.PutPositionByUserId(
    &mega_field.PutPositionByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        AreaModelName: pointy.String("area-0001"),
        LayerModelName: pointy.String("layer-0001"),
        Position: {'x': 0, 'y': 1, 'z': 2},
        Vector: {'x': 10, 'y': 11, 'z': 12},
        R: pointy.Float32(5),
    }
)
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\PutPositionByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->putPositionByUserId(
        (new PutPositionByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withAreaModelName("area-0001")
            ->withLayerModelName("layer-0001")
            ->withPosition({'x': 0, 'y': 1, 'z': 2})
            ->withVector({'x': 10, 'y': 11, 'z': 12})
            ->withR(5)
    );
    $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.PutPositionByUserIdRequest;
import io.gs2.megaField.result.PutPositionByUserIdResult;

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

try {
    PutPositionByUserIdResult result = client.putPositionByUserId(
        new PutPositionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withPosition({'x': 0, 'y': 1, 'z': 2})
            .withVector({'x': 10, 'y': 11, 'z': 12})
            .withR(5f)
    );
    Spatial 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.PutPositionByUserIdRequest;
using Gs2.Gs2MegaField.Result.PutPositionByUserIdResult;

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.PutPositionByUserIdResult> asyncResult = null;
yield return client.PutPositionByUserId(
    new Gs2.Gs2MegaField.Request.PutPositionByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithAreaModelName("area-0001")
        .WithLayerModelName("layer-0001")
        .WithPosition({'x': 0, 'y': 1, 'z': 2})
        .WithVector({'x': 10, 'y': 11, 'z': 12})
        .WithR(5f),
    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.putPositionByUserId(
        new Gs2MegaField.PutPositionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withPosition({'x': 0, 'y': 1, 'z': 2})
            .withVector({'x': 10, 'y': 11, 'z': 12})
            .withR(5)
    );
    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.put_position_by_user_id(
        mega_field.PutPositionByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_area_model_name('area-0001')
            .with_layer_model_name('layer-0001')
            .with_position({'x': 0, 'y': 1, 'z': 2})
            .with_vector({'x': 10, 'y': 11, 'z': 12})
            .with_r(5)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.put_position_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    areaModelName='area-0001',
    layerModelName='layer-0001',
    position={'x': 0, 'y': 1, 'z': 2},
    vector={'x': 10, 'y': 11, 'z': 12},
    r=5,
})

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

result = api_result.result
item = result.item;

fetchPosition

Fetch position

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
areaModelNamestring~ 128 charsArea name
layerModelNamestring~ 128 charsLayer name
userIdsList<string>1 ~ 100 itemsList of User Ids

Result

TypeDescription
itemsList<Spatial>List of Spatial

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.FetchPosition(
    &mega_field.FetchPositionRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        AreaModelName: pointy.String("area-0001"),
        LayerModelName: pointy.String("layer-0001"),
        UserIds: []*string{
            pointy.String("user-0001"),
        pointy.String("user-0002"),
        pointy.String("user-0003"),
        },
    }
)
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\FetchPositionRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->fetchPosition(
        (new FetchPositionRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withAreaModelName("area-0001")
            ->withLayerModelName("layer-0001")
            ->withUserIds([    "user-0001",
            "user-0002",
            "user-0003",
            ])
    );
    $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.FetchPositionRequest;
import io.gs2.megaField.result.FetchPositionResult;

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

try {
    FetchPositionResult result = client.fetchPosition(
        new FetchPositionRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withUserIds(Arrays.asList(
                "user-0001",
            "user-0002",
            "user-0003"
            ))
    );
    List<Spatial> 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.FetchPositionRequest;
using Gs2.Gs2MegaField.Result.FetchPositionResult;

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.FetchPositionResult> asyncResult = null;
yield return client.FetchPosition(
    new Gs2.Gs2MegaField.Request.FetchPositionRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithAreaModelName("area-0001")
        .WithLayerModelName("layer-0001")
        .WithUserIds(new string[] {
            "user-0001",
        "user-0002",
        "user-0003"
        }),
    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.fetchPosition(
        new Gs2MegaField.FetchPositionRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withUserIds([
                "user-0001",
            "user-0002",
            "user-0003"
            ])
    );
    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.fetch_position(
        mega_field.FetchPositionRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_area_model_name('area-0001')
            .with_layer_model_name('layer-0001')
            .with_user_ids([    'user-0001',
            'user-0002',
            'user-0003',
            ])
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.fetch_position({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    areaModelName='area-0001',
    layerModelName='layer-0001',
    userIds={
        'user-0001',
    'user-0002',
    'user-0003'
    },
})

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

result = api_result.result
items = result.items;

fetchPositionFromSystem

Fetch position

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
areaModelNamestring~ 128 charsArea name
layerModelNamestring~ 128 charsLayer name
userIdsList<string>1 ~ 100 itemsList of User Ids

Result

TypeDescription
itemsList<Spatial>List of Spatial

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.FetchPositionFromSystem(
    &mega_field.FetchPositionFromSystemRequest {
        NamespaceName: pointy.String("namespace1"),
        AreaModelName: pointy.String("area-0001"),
        LayerModelName: pointy.String("layer-0001"),
        UserIds: []*string{
            pointy.String("user-0001"),
        pointy.String("user-0002"),
        pointy.String("user-0003"),
        },
    }
)
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\FetchPositionFromSystemRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->fetchPositionFromSystem(
        (new FetchPositionFromSystemRequest())
            ->withNamespaceName(self::namespace1)
            ->withAreaModelName("area-0001")
            ->withLayerModelName("layer-0001")
            ->withUserIds([    "user-0001",
            "user-0002",
            "user-0003",
            ])
    );
    $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.FetchPositionFromSystemRequest;
import io.gs2.megaField.result.FetchPositionFromSystemResult;

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

try {
    FetchPositionFromSystemResult result = client.fetchPositionFromSystem(
        new FetchPositionFromSystemRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withUserIds(Arrays.asList(
                "user-0001",
            "user-0002",
            "user-0003"
            ))
    );
    List<Spatial> 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.FetchPositionFromSystemRequest;
using Gs2.Gs2MegaField.Result.FetchPositionFromSystemResult;

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.FetchPositionFromSystemResult> asyncResult = null;
yield return client.FetchPositionFromSystem(
    new Gs2.Gs2MegaField.Request.FetchPositionFromSystemRequest()
        .WithNamespaceName("namespace1")
        .WithAreaModelName("area-0001")
        .WithLayerModelName("layer-0001")
        .WithUserIds(new string[] {
            "user-0001",
        "user-0002",
        "user-0003"
        }),
    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.fetchPositionFromSystem(
        new Gs2MegaField.FetchPositionFromSystemRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withUserIds([
                "user-0001",
            "user-0002",
            "user-0003"
            ])
    );
    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.fetch_position_from_system(
        mega_field.FetchPositionFromSystemRequest()
            .with_namespace_name(self.hash1)
            .with_area_model_name('area-0001')
            .with_layer_model_name('layer-0001')
            .with_user_ids([    'user-0001',
            'user-0002',
            'user-0003',
            ])
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.fetch_position_from_system({
    namespaceName='namespace1',
    areaModelName='area-0001',
    layerModelName='layer-0001',
    userIds={
        'user-0001',
    'user-0002',
    'user-0003'
    },
})

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

result = api_result.result
items = result.items;

nearUserIds

Fetch list of nearby user IDs

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
areaModelNamestring~ 128 charsArea name
layerModelNamestring~ 128 charsLayer name
pointPositionPoint
rfloat1 ~ 16777214Radius
limitint1 ~ 100Maximum number of result

Result

TypeDescription
itemsList<string>List of nearby user IDs

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.NearUserIds(
    &mega_field.NearUserIdsRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        AreaModelName: pointy.String("area-0001"),
        LayerModelName: pointy.String("layer-0001"),
        Point: nil,
        R: pointy.Float32(5),
        Limit: nil,
    }
)
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\NearUserIdsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->nearUserIds(
        (new NearUserIdsRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withAreaModelName("area-0001")
            ->withLayerModelName("layer-0001")
            ->withPoint(null)
            ->withR(5)
            ->withLimit(null)
    );
    $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.NearUserIdsRequest;
import io.gs2.megaField.result.NearUserIdsResult;

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

try {
    NearUserIdsResult result = client.nearUserIds(
        new NearUserIdsRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withPoint(null)
            .withR(5f)
            .withLimit(null)
    );
    List<String> 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.NearUserIdsRequest;
using Gs2.Gs2MegaField.Result.NearUserIdsResult;

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.NearUserIdsResult> asyncResult = null;
yield return client.NearUserIds(
    new Gs2.Gs2MegaField.Request.NearUserIdsRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithAreaModelName("area-0001")
        .WithLayerModelName("layer-0001")
        .WithPoint(null)
        .WithR(5f)
        .WithLimit(null),
    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.nearUserIds(
        new Gs2MegaField.NearUserIdsRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withPoint(null)
            .withR(5)
            .withLimit(null)
    );
    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.near_user_ids(
        mega_field.NearUserIdsRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_area_model_name('area-0001')
            .with_layer_model_name('layer-0001')
            .with_point(None)
            .with_r(5)
            .with_limit(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.near_user_ids({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    areaModelName='area-0001',
    layerModelName='layer-0001',
    point=nil,
    r=5,
    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;

nearUserIdsFromSystem

Fetch list of nearby user IDs

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
areaModelNamestring~ 128 charsArea name
layerModelNamestring~ 128 charsLayer name
pointPositionPoint
rfloat1 ~ 16777214Radius
limitint1 ~ 100Maximum number of result

Result

TypeDescription
itemsList<string>List of nearby user IDs

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.NearUserIdsFromSystem(
    &mega_field.NearUserIdsFromSystemRequest {
        NamespaceName: pointy.String("namespace1"),
        AreaModelName: pointy.String("area-0001"),
        LayerModelName: pointy.String("layer-0001"),
        Point: nil,
        R: pointy.Float32(5),
        Limit: nil,
    }
)
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\NearUserIdsFromSystemRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->nearUserIdsFromSystem(
        (new NearUserIdsFromSystemRequest())
            ->withNamespaceName(self::namespace1)
            ->withAreaModelName("area-0001")
            ->withLayerModelName("layer-0001")
            ->withPoint(null)
            ->withR(5)
            ->withLimit(null)
    );
    $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.NearUserIdsFromSystemRequest;
import io.gs2.megaField.result.NearUserIdsFromSystemResult;

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

try {
    NearUserIdsFromSystemResult result = client.nearUserIdsFromSystem(
        new NearUserIdsFromSystemRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withPoint(null)
            .withR(5f)
            .withLimit(null)
    );
    List<String> 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.NearUserIdsFromSystemRequest;
using Gs2.Gs2MegaField.Result.NearUserIdsFromSystemResult;

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.NearUserIdsFromSystemResult> asyncResult = null;
yield return client.NearUserIdsFromSystem(
    new Gs2.Gs2MegaField.Request.NearUserIdsFromSystemRequest()
        .WithNamespaceName("namespace1")
        .WithAreaModelName("area-0001")
        .WithLayerModelName("layer-0001")
        .WithPoint(null)
        .WithR(5f)
        .WithLimit(null),
    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.nearUserIdsFromSystem(
        new Gs2MegaField.NearUserIdsFromSystemRequest()
            .withNamespaceName("namespace1")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withPoint(null)
            .withR(5)
            .withLimit(null)
    );
    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.near_user_ids_from_system(
        mega_field.NearUserIdsFromSystemRequest()
            .with_namespace_name(self.hash1)
            .with_area_model_name('area-0001')
            .with_layer_model_name('layer-0001')
            .with_point(None)
            .with_r(5)
            .with_limit(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.near_user_ids_from_system({
    namespaceName='namespace1',
    areaModelName='area-0001',
    layerModelName='layer-0001',
    point=nil,
    r=5,
    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;

action

Put position

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
areaModelNamestring~ 128 charsArea name
layerModelNamestring~ 128 charsLayer name
positionMyPositionMy Location
scopesList<Scope>~ 10 itemsList of Scope of acquisition by other players

Result

TypeDescription
itemsList<Spatial>List of Spatial

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.Action(
    &mega_field.ActionRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        AreaModelName: pointy.String("area-0001"),
        LayerModelName: pointy.String("layer-0001"),
        Position: nil,
        Scopes: nil,
    }
)
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\ActionRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->action(
        (new ActionRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withAreaModelName("area-0001")
            ->withLayerModelName("layer-0001")
            ->withPosition(null)
            ->withScopes(null)
    );
    $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.ActionRequest;
import io.gs2.megaField.result.ActionResult;

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

try {
    ActionResult result = client.action(
        new ActionRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withPosition(null)
            .withScopes(null)
    );
    List<Spatial> 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.ActionRequest;
using Gs2.Gs2MegaField.Result.ActionResult;

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.ActionResult> asyncResult = null;
yield return client.Action(
    new Gs2.Gs2MegaField.Request.ActionRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$access_token_0001")
        .WithAreaModelName("area-0001")
        .WithLayerModelName("layer-0001")
        .WithPosition(null)
        .WithScopes(null),
    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.action(
        new Gs2MegaField.ActionRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withPosition(null)
            .withScopes(null)
    );
    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.action(
        mega_field.ActionRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_area_model_name('area-0001')
            .with_layer_model_name('layer-0001')
            .with_position(None)
            .with_scopes(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.action({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    areaModelName='area-0001',
    layerModelName='layer-0001',
    position=nil,
    scopes=nil,
})

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

result = api_result.result
items = result.items;

actionByUserId

Put position by specifying user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
areaModelNamestring~ 128 charsArea name
layerModelNamestring~ 128 charsLayer name
positionMyPositionMy Location
scopesList<Scope>~ 10 itemsList of Scope of acquisition by other players

Result

TypeDescription
itemsList<Spatial>List of Spatial

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.ActionByUserId(
    &mega_field.ActionByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        AreaModelName: pointy.String("area-0001"),
        LayerModelName: pointy.String("layer-0001"),
        Position: nil,
        Scopes: nil,
    }
)
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\ActionByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->actionByUserId(
        (new ActionByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withAreaModelName("area-0001")
            ->withLayerModelName("layer-0001")
            ->withPosition(null)
            ->withScopes(null)
    );
    $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.ActionByUserIdRequest;
import io.gs2.megaField.result.ActionByUserIdResult;

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

try {
    ActionByUserIdResult result = client.actionByUserId(
        new ActionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withPosition(null)
            .withScopes(null)
    );
    List<Spatial> 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.ActionByUserIdRequest;
using Gs2.Gs2MegaField.Result.ActionByUserIdResult;

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.ActionByUserIdResult> asyncResult = null;
yield return client.ActionByUserId(
    new Gs2.Gs2MegaField.Request.ActionByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithAreaModelName("area-0001")
        .WithLayerModelName("layer-0001")
        .WithPosition(null)
        .WithScopes(null),
    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.actionByUserId(
        new Gs2MegaField.ActionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withAreaModelName("area-0001")
            .withLayerModelName("layer-0001")
            .withPosition(null)
            .withScopes(null)
    );
    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.action_by_user_id(
        mega_field.ActionByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_area_model_name('area-0001')
            .with_layer_model_name('layer-0001')
            .with_position(None)
            .with_scopes(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('megaField')

api_result = client.action_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    areaModelName='area-0001',
    layerModelName='layer-0001',
    position=nil,
    scopes=nil,
})

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

result = api_result.result
items = result.items;