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.
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceId | string | | ✓ | | ~ 1024 chars | Namespace GRN |
name | string | | ✓ | | ~ 32 chars | Namespace name |
description | string | | | | ~ 1024 chars | Description |
logSetting | LogSetting | | | | | Log output settings |
createdAt | long | | ✓ | | | Datetime of creation |
updatedAt | long | | ✓ | | | Datetime of last update |
revision | long | | | 0 | ~ 9223372036854775805 | Revision |
AreaModel
Area divides space, and different areas can be treated as different spaces even if they have the same coordinates.
| Type | Condition | Require | Default | Limitation | Description |
---|
areaModelId | string | | ✓ | | ~ 1024 chars | Area Model GRN |
name | string | | ✓ | | ~ 128 chars | Area Model Name |
metadata | string | | | | ~ 2048 chars | metadata |
layerModels | List<LayerModel> | | | | ~ 1000 items | List of layer models |
AreaModelMaster
Area divides space, and different areas can be treated as different spaces even if they have the same coordinates.
| Type | Condition | Require | Default | Limitation | Description |
---|
areaModelMasterId | string | | ✓ | | ~ 1024 chars | Area Model Master GRN |
name | string | | ✓ | | ~ 128 chars | Area Model Name |
description | string | | | | ~ 1024 chars | description of Namespace |
metadata | string | | | | ~ 2048 chars | metadata |
createdAt | long | | ✓ | | | Datetime of creation |
updatedAt | long | | ✓ | | | Datetime of last update |
revision | long | | | 0 | ~ 9223372036854775805 | Revision |
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.
| Type | Condition | Require | Default | Limitation | Description |
---|
layerModelId | string | | ✓ | | ~ 1024 chars | Layer Model GRN |
name | string | | ✓ | | ~ 128 chars | Layer Model Name |
metadata | string | | | | ~ 2048 chars | metadata |
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.
| Type | Condition | Require | Default | Limitation | Description |
---|
layerModelMasterId | string | | ✓ | | ~ 1024 chars | Layer Model Master GRN |
name | string | | ✓ | | ~ 128 chars | Layer Model Name |
description | string | | | | ~ 1024 chars | description of Namespace |
metadata | string | | | | ~ 2048 chars | metadata |
createdAt | long | | ✓ | | | Datetime of creation |
updatedAt | long | | ✓ | | | Datetime of last update |
revision | long | | | 0 | ~ 9223372036854775805 | Revision |
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.
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceId | string | | ✓ | | ~ 1024 chars | Namespace GRN |
settings | string | | ✓ | | ~ 5242880 chars | Master data |
Layer
| Type | Condition | Require | Default | Limitation | Description |
---|
layerId | string | | ✓ | | ~ 1024 chars | Layer GRN |
areaModelName | string | | ✓ | | ~ 128 chars | Area name |
layerModelName | string | | ✓ | | ~ 128 chars | Layer name |
numberOfMinEntries | int | | ✓ | 5 | 1 ~ 1000 | Attempts to join with other nodes when the number of entities in a node falls below a specified value |
numberOfMaxEntries | int | | ✓ | 20 | 1 ~ 1000 | Attempts to split a node if the number of entities in the node exceeds the specified value |
createdAt | long | | ✓ | | | Datetime of creation |
Spatial
| Type | Condition | Require | Default | Limitation | Description |
---|
spatialId | string | | ✓ | | ~ 1024 chars | Serial Key GRN |
userId | string | | ✓ | | ~ 128 chars | User Id |
areaModelName | string | | ✓ | | ~ 128 chars | Area name |
layerModelName | string | | ✓ | | ~ 128 chars | Layer name |
position | Position | | ✓ | | | Position |
vector | Vector | | ✓ | | | Vector |
r | float | | ✓ | 1 | ~ 10000 | Radius |
lastSyncAt | long | | | | | |
createdAt | long | | ✓ | | | Datetime of creation |
Position
Position
| Type | Condition | Require | Default | Limitation | Description |
---|
x | float | | ✓ | | ~ 1048574 | X position |
y | float | | ✓ | | ~ 1048574 | Y position |
z | float | | ✓ | | ~ 1048574 | Z position |
MyPosition
My Location
| Type | Condition | Require | Default | Limitation | Description |
---|
position | Position | | ✓ | | | Position |
vector | Vector | | ✓ | | | Vector |
r | float | | ✓ | 1 | ~ 10000 | Radius |
Scope
Surroundings to be acquired
| Type | Condition | Require | Default | Limitation | Description |
---|
layerName | string | | ✓ | | ~ 128 chars | Layer Model Name |
r | float | | ✓ | | 1 ~ 16777214 | Radius |
limit | int | | ✓ | | 1 ~ 100 | Maximum number of result |
Vector
Position
| Type | Condition | Require | Default | Limitation | Description |
---|
x | float | | ✓ | | ~ 1048574 | X position |
y | float | | ✓ | | ~ 1048574 | Y position |
z | float | | ✓ | | ~ 1048574 | Z position |
LogSetting
Log export settings
| Type | Condition | Require | Default | Limitation | Description |
---|
loggingNamespaceId | string | | ✓ | | ~ 1024 chars | Namespace GRN |
GitHubCheckoutSetting
| Type | Condition | Require | Default | Limitation | Description |
---|
apiKeyId | string | | ✓ | | ~ 1024 chars | GitHub API key GRN |
repositoryName | string | | ✓ | | ~ 1024 chars | Repository Name |
sourcePath | string | | ✓ | | ~ 1024 chars | Source code file path |
referenceType | enum [‘commit_hash’, ‘branch’, ’tag’] | | ✓ | | ~ 128 chars | Source of code |
commitHash | string | {referenceType} == “commit_hash” | ✓ | | ~ 1024 chars | Commit hash |
branchName | string | {referenceType} == “branch” | ✓ | | ~ 1024 chars | Branch Name |
tagName | string | {referenceType} == “tag” | ✓ | | ~ 1024 chars | Tag Name |
Methods
describeNamespaces
Get list of namespaces
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
pageToken | string | | | | ~ 1024 chars | Token specifying the position from which to start acquiring data |
limit | int | | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
| Type | Description |
---|
items | List<Namespace> | List of Namespace |
nextPageToken | string | Page 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
| Type | Condition | Require | Default | Limitation | Description |
---|
name | string | | ✓ | | ~ 32 chars | Namespace name |
description | string | | | | ~ 1024 chars | Description |
logSetting | LogSetting | | | | | Log output settings |
Result
| Type | Description |
---|
item | Namespace | Namespace 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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
Result
| Type | Description |
---|
status | string | |
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
description | string | | | | ~ 1024 chars | Description |
logSetting | LogSetting | | | | | Log output settings |
Result
| Type | Description |
---|
item | Namespace | Updated 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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
Result
| Type | Description |
---|
item | Namespace | Deleted 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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
areaModelName | string | | ✓ | | ~ 128 chars | Area Model Name |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
pageToken | string | | | | ~ 1024 chars | Token specifying the position from which to start acquiring data |
limit | int | | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
| Type | Description |
---|
items | List<AreaModelMaster> | List of Area Model Master |
nextPageToken | string | Page 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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
name | string | | ✓ | | ~ 128 chars | Area Model Name |
description | string | | | | ~ 1024 chars | description of Namespace |
metadata | string | | | | ~ 2048 chars | metadata |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
areaModelName | string | | ✓ | | ~ 128 chars | Area Model Name |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
areaModelName | string | | ✓ | | ~ 128 chars | Area Model Name |
description | string | | | | ~ 1024 chars | description of Namespace |
metadata | string | | | | ~ 2048 chars | metadata |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
areaModelName | string | | ✓ | | ~ 128 chars | Area Model Name |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
areaModelName | string | | ✓ | | ~ 128 chars | Area Model Name |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
areaModelName | string | | ✓ | | ~ 128 chars | Area Model Name |
layerModelName | string | | ✓ | | ~ 128 chars | Layer Model Name |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
areaModelName | string | | ✓ | | ~ 128 chars | Area model name |
pageToken | string | | | | ~ 1024 chars | Token specifying the position from which to start acquiring data |
limit | int | | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
| Type | Description |
---|
items | List<LayerModelMaster> | List of Layer Model Master |
nextPageToken | string | Page 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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
areaModelName | string | | ✓ | | ~ 128 chars | Area Model Name |
name | string | | ✓ | | ~ 128 chars | Layer Model Name |
description | string | | | | ~ 1024 chars | description of Namespace |
metadata | string | | | | ~ 2048 chars | metadata |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
areaModelName | string | | ✓ | | ~ 128 chars | Area Model Name |
layerModelName | string | | ✓ | | ~ 128 chars | Layer Model Name |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
areaModelName | string | | ✓ | | ~ 128 chars | Area Model Name |
layerModelName | string | | ✓ | | ~ 128 chars | Layer Model Name |
description | string | | | | ~ 1024 chars | description of Namespace |
metadata | string | | | | ~ 2048 chars | metadata |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
areaModelName | string | | ✓ | | ~ 128 chars | Area Model Name |
layerModelName | string | | ✓ | | ~ 128 chars | Layer Model Name |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
settings | string | | ✓ | | ~ 5242880 chars | Master data |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
checkoutSetting | GitHubCheckoutSetting | | ✓ | | | Setup to check out master data from GitHub |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
accessToken | string | | ✓ | | ~ 128 chars | User Id |
areaModelName | string | | ✓ | | ~ 128 chars | Area name |
layerModelName | string | | ✓ | | ~ 128 chars | Layer name |
position | Position | | ✓ | | | Position |
vector | Vector | | ✓ | | | Vector |
r | float | | ✓ | 1 | ~ 10000 | Radius |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
userId | string | | ✓ | | ~ 128 chars | User Id |
areaModelName | string | | ✓ | | ~ 128 chars | Area name |
layerModelName | string | | ✓ | | ~ 128 chars | Layer name |
position | Position | | ✓ | | | Position |
vector | Vector | | ✓ | | | Vector |
r | float | | ✓ | 1 | ~ 10000 | Radius |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
accessToken | string | | ✓ | | ~ 128 chars | User Id |
areaModelName | string | | ✓ | | ~ 128 chars | Area name |
layerModelName | string | | ✓ | | ~ 128 chars | Layer name |
userIds | List<string> | | ✓ | | 1 ~ 100 items | List of User Ids |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
areaModelName | string | | ✓ | | ~ 128 chars | Area name |
layerModelName | string | | ✓ | | ~ 128 chars | Layer name |
userIds | List<string> | | ✓ | | 1 ~ 100 items | List of User Ids |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
accessToken | string | | ✓ | | ~ 128 chars | User Id |
areaModelName | string | | ✓ | | ~ 128 chars | Area name |
layerModelName | string | | ✓ | | ~ 128 chars | Layer name |
point | Position | | ✓ | | | Point |
r | float | | ✓ | | 1 ~ 16777214 | Radius |
limit | int | | ✓ | | 1 ~ 100 | Maximum number of result |
Result
| Type | Description |
---|
items | List<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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
areaModelName | string | | ✓ | | ~ 128 chars | Area name |
layerModelName | string | | ✓ | | ~ 128 chars | Layer name |
point | Position | | ✓ | | | Point |
r | float | | ✓ | | 1 ~ 16777214 | Radius |
limit | int | | ✓ | | 1 ~ 100 | Maximum number of result |
Result
| Type | Description |
---|
items | List<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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
accessToken | string | | ✓ | | ~ 128 chars | User Id |
areaModelName | string | | ✓ | | ~ 128 chars | Area name |
layerModelName | string | | ✓ | | ~ 128 chars | Layer name |
position | MyPosition | | ✓ | | | My Location |
scopes | List<Scope> | | | | ~ 10 items | List of Scope of acquisition by other players |
Result
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
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
userId | string | | ✓ | | ~ 128 chars | User Id |
areaModelName | string | | ✓ | | ~ 128 chars | Area name |
layerModelName | string | | ✓ | | ~ 128 chars | Layer name |
position | MyPosition | | ✓ | | | My Location |
scopes | List<Scope> | | | | ~ 10 items | List of Scope of acquisition by other players |
Result
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;