GS2-MegaField SDK API リファレンス

モデル

Namespace

ネームスペース

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

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

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字ネームスペースGRN
namestring~ 32文字ネームスペース名
descriptionstring~ 1024文字説明文
logSettingLogSettingログの出力設定
createdAtlong作成日時
updatedAtlong最終更新日時
revisionlong0~ 9223372036854775805リビジョン


AreaModel

エリアは空間を分割するもので、同じ座標でもエリアが異なれば別空間として扱うことができます。

有効化条件必須デフォルト値の制限説明
areaModelIdstring~ 1024文字エリアモデルGRN
namestring~ 128文字エリアモデル名
metadatastring~ 2048文字メタデータ
layerModelsList<LayerModel>~ 1000 itemsレイヤーモデル一覧


AreaModelMaster

エリアは空間を分割するもので、同じ座標でもエリアが異なれば別空間として扱うことができます。

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


LayerModel

レイヤーは1つの空間内で複数の論理階層を実現します。 たとえば、キャラクターが大量に存在する空間で、エネミーが見えなくなってしまう問題を解決します。 レイヤー1 にはキャラクターを配置。レイヤー2にはエネミーを配置した場合、レイヤーごとに指定した距離内での取得数量を指定できるため、見えなくなる心配はありません。

有効化条件必須デフォルト値の制限説明
layerModelIdstring~ 1024文字レイヤーモデルGRN
namestring~ 128文字レイヤーモデル名
metadatastring~ 2048文字メタデータ


LayerModelMaster

レイヤーは1つの空間内で複数の論理階層を実現します。 たとえば、キャラクターが大量に存在する空間で、エネミーが見えなくなってしまう問題を解決します。 レイヤー1 にはキャラクターを配置。レイヤー2にはエネミーを配置した場合、レイヤーごとに指定した距離内での取得数量を指定できるため、見えなくなる心配はありません。

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


CurrentFieldMaster

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

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

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

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

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


Layer

有効化条件必須デフォルト値の制限説明
layerIdstring~ 1024文字レイヤーGRN
areaModelNamestring~ 128文字エリア名
layerModelNamestring~ 128文字レイヤー名
numberOfMinEntriesint51 ~ 1000ノード内のエンティティ数が指定値を下回ると、他のノードと結合を試みる
numberOfMaxEntriesint201 ~ 1000ノード内のエンティティ数が指定値を上回ると、ノードの分割を試みる
createdAtlong作成日時

Spatial

有効化条件必須デフォルト値の制限説明
spatialIdstring~ 1024文字シリアルキーGRN
userIdstring~ 128文字ユーザーID
areaModelNamestring~ 128文字エリア名
layerModelNamestring~ 128文字レイヤー名
positionPosition座標
vectorVector向き
rfloat1~ 10000半径
lastSyncAtlongレイヤーへの最終同期日時
createdAtlong作成日時

Position

座標

有効化条件必須デフォルト値の制限説明
xfloat~ 1048574X座標
yfloat~ 1048574Y座標
zfloat~ 1048574Z座標


MyPosition

自分の位置情報

有効化条件必須デフォルト値の制限説明
positionPosition座標
vectorVector向き
rfloat1~ 10000半径


Scope

取得する周囲の状況

有効化条件必須デフォルト値の制限説明
layerNamestring~ 128文字レイヤーモデル名
rfloat1 ~ 16777214半径
limitint1 ~ 100最大数


Vector

座標

有効化条件必須デフォルト値の制限説明
xfloat~ 1048574X座標
yfloat~ 1048574Y座標
zfloat~ 1048574Z座標


LogSetting

ログの書き出し設定

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


GitHubCheckoutSetting

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

メソッド

describeNamespaces

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

Request

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

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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

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

Request

有効化条件必須デフォルト値の制限説明
namestring~ 32文字ネームスペース名
descriptionstring~ 1024文字説明文
logSettingLogSettingログの出力設定

Result

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

実装例

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

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

Result

説明
statusstring

実装例

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

ネームスペースを取得

Request

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

Result

説明
itemNamespaceネームスペース

実装例

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

ネームスペースを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
descriptionstring~ 1024文字説明文
logSettingLogSettingログの出力設定

Result

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

実装例

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

ネームスペースを削除

Request

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

Result

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

実装例

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

エリアモデルの一覧を取得

Request

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

Result

説明
itemsList<AreaModel>エリアモデルのリスト

実装例

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

エリアモデルを取得

Request

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

Result

説明
itemAreaModelエリアモデル

実装例

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

エリアモデルマスターの一覧を取得

Request

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

Result

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

実装例

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

エリアモデルマスターを新規作成

Request

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

Result

説明
itemAreaModelMaster作成したエリアモデルマスター

実装例

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

エリアモデルマスターを取得

Request

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

Result

説明
itemAreaModelMasterエリアモデルマスター

実装例

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

エリアモデルマスターを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
areaModelNamestring~ 128文字エリアモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 2048文字メタデータ

Result

説明
itemAreaModelMaster更新したエリアモデルマスター

実装例

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

エリアモデルマスターを削除

Request

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

Result

説明
itemAreaModelMaster削除したエリアモデルマスター

実装例

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

レイヤーの一覧を取得

Request

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

Result

説明
itemsList<LayerModel>レイヤーのリスト

実装例

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

レイヤーを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
areaModelNamestring~ 128文字エリアモデル名
layerModelNamestring~ 128文字レイヤーモデル名

Result

説明
itemLayerModel

実装例

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

レイヤーマスターの一覧を取得

Request

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

Result

説明
itemsList<LayerModelMaster>レイヤーマスターのリスト
nextPageTokenstringリストの続きを取得するためのページトークン

実装例

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

レイヤーマスターを新規作成

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 32文字ネームスペース名
areaModelNamestring~ 128文字エリアモデル名
namestring~ 128文字レイヤーモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 2048文字メタデータ

Result

説明
itemLayerModelMaster作成したレイヤーマスター

実装例

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