GS2-MegaField SDK API リファレンス モデル Namespace ネームスペース
ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。 GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
型 有効化条件 必須 デフォルト 値の制限 説明 namespaceId string ✓ ~ 1024文字 ネームスペースGRN name string ✓ ~ 128文字 ネームスペース名 description string ~ 1024文字 説明文 logSetting LogSetting ログの出力設定 createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒) updatedAt long ✓ 現在時刻 最終更新日時 (UNIX時間 単位:ミリ秒) revision long 0 ~ 9223372036854775805 リビジョン
AreaModel エリアは空間を分割するもので、同じ座標でもエリアが異なれば別空間として扱うことができます。
型 有効化条件 必須 デフォルト 値の制限 説明 areaModelId string ✓ ~ 1024文字 エリアモデルGRN name string ✓ ~ 128文字 エリアモデル名 metadata string ~ 2048文字 メタデータ layerModels List<LayerModel> ~ 1000 items レイヤーモデル一覧
AreaModelMaster エリアは空間を分割するもので、同じ座標でもエリアが異なれば別空間として扱うことができます。
型 有効化条件 必須 デフォルト 値の制限 説明 areaModelMasterId string ✓ ~ 1024文字 エリアモデルマスターGRN name string ✓ ~ 128文字 エリアモデル名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒) updatedAt long ✓ 現在時刻 最終更新日時 (UNIX時間 単位:ミリ秒) revision long 0 ~ 9223372036854775805 リビジョン
LayerModel レイヤーは1つの空間内で複数の論理階層を実現します。 たとえば、キャラクターが大量に存在する空間で、エネミーが見えなくなってしまう問題を解決します。 レイヤー1 にはキャラクターを配置。レイヤー2にはエネミーを配置した場合、レイヤーごとに指定した距離内での取得数量を指定できるため、見えなくなる心配はありません。
型 有効化条件 必須 デフォルト 値の制限 説明 layerModelId string ✓ ~ 1024文字 レイヤーモデルGRN name string ✓ ~ 128文字 レイヤーモデル名 metadata string ~ 2048文字 メタデータ
LayerModelMaster レイヤーは1つの空間内で複数の論理階層を実現します。 たとえば、キャラクターが大量に存在する空間で、エネミーが見えなくなってしまう問題を解決します。 レイヤー1 にはキャラクターを配置。レイヤー2にはエネミーを配置した場合、レイヤーごとに指定した距離内での取得数量を指定できるため、見えなくなる心配はありません。
型 有効化条件 必須 デフォルト 値の制限 説明 layerModelMasterId string ✓ ~ 1024文字 レイヤーモデルマスターGRN name string ✓ ~ 128文字 レイヤーモデル名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒) updatedAt long ✓ 現在時刻 最終更新日時 (UNIX時間 単位:ミリ秒) revision long 0 ~ 9223372036854775805 リビジョン
CurrentFieldMaster 現在有効なマスターデータ
GS2ではマスターデータの管理にJSON形式のファイルを使用します。 ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
型 有効化条件 必須 デフォルト 値の制限 説明 namespaceId string ✓ ~ 1024文字 現在有効なフィールドマスターGRN settings string ✓ ~ 5242880文字 マスターデータ
Layer レイヤー
型 有効化条件 必須 デフォルト 値の制限 説明 layerId string ✓ ~ 1024文字 レイヤーGRN areaModelName string ✓ ~ 128文字 エリア名 layerModelName string ✓ ~ 128文字 レイヤー名 numberOfMinEntries int ✓ 5 1 ~ 1000 ノード内のエンティティ数が指定値を下回ると、他のノードと結合を試みる numberOfMaxEntries int ✓ 20 1 ~ 1000 ノード内のエンティティ数が指定値を上回ると、ノードの分割を試みる createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒)
Spatial 空間情報
型 有効化条件 必須 デフォルト 値の制限 説明 spatialId string ✓ ~ 1024文字 シリアルキーGRN userId string ✓ ~ 128文字 ユーザーID areaModelName string ✓ ~ 128文字 エリア名 layerModelName string ✓ ~ 128文字 レイヤー名 position Position ✓ 座標 vector Vector ✓ 向き r float ✓ 1 ~ 10000 半径 lastSyncAt long レイヤーへの最終同期日時 (UNIX時間 単位:ミリ秒) createdAt long ✓ 現在時刻 作成日時 (UNIX時間 単位:ミリ秒)
Position 座標
型 有効化条件 必須 デフォルト 値の制限 説明 x float ✓ ~ 1048574 X座標 y float ✓ ~ 1048574 Y座標 z float ✓ ~ 1048574 Z座標
MyPosition 自分の位置情報
型 有効化条件 必須 デフォルト 値の制限 説明 position Position ✓ 座標 vector Vector ✓ 向き r float ✓ 1 ~ 10000 半径
Scope 取得する周囲の状況
型 有効化条件 必須 デフォルト 値の制限 説明 layerName string ✓ ~ 128文字 レイヤーモデル名 r float ✓ 1 ~ 16777214 半径 limit int ✓ 1 ~ 100 最大数
Vector 座標
型 有効化条件 必須 デフォルト 値の制限 説明 x float ✓ ~ 1048574 X座標 y float ✓ ~ 1048574 Y座標 z float ✓ ~ 1048574 Z座標
LogSetting ログの書き出し設定
ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用されるログ名前空間の識別子(Namespace ID)を保持します。 ログ名前空間IDは、ログデータを集約し、保存する対象の GS2-Log の名前空間を指定します。 この設定を通じて、この名前空間以下のAPIリクエスト・レスポンスログデータが対象の GS2-Log へ出力されるようになります。 GS2-Log にはリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。
型 有効化条件 必須 デフォルト 値の制限 説明 loggingNamespaceId string ✓ ~ 1024文字 ネームスペースGRN
GitHubCheckoutSetting GitHubからマスターデータをチェックアウトする設定
型 有効化条件 必須 デフォルト 値の制限 説明 apiKeyId string ✓ ~ 1024文字 GitHub のAPIキーGRN repositoryName string ✓ ~ 1024文字 リポジトリ名 sourcePath string ✓ ~ 1024文字 ソースコードのファイルパス referenceType enum { “commit_hash”, “branch”, “tag” } ✓ ~ 128文字 コードの取得元 commitHash string {referenceType} == “commit_hash” ✓ ~ 1024文字 コミットハッシュ branchName string {referenceType} == “branch” ✓ ~ 1024文字 ブランチ名 tagName string {referenceType} == “tag” ✓ ~ 1024文字 タグ名
referenceType に指定する列挙型の定義 定義 説明 commit_hash コミットハッシュ branch ブランチ tag タグ
メソッド describeNamespaces ネームスペースの一覧を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン limit int ✓ 30 1 ~ 1000 データの取得件数
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.describe_namespaces_async ({
pageToken = nil ,
limit = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
createNamespace ネームスペースを新規作成
Request 型 有効化条件 必須 デフォルト 値の制限 説明 name string ✓ ~ 128文字 ネームスペース名 description string ~ 1024文字 説明文 logSetting LogSetting ログの出力設定
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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: \n amespace1" ))
);
$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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.create_namespace_async ({
name = "namespace1" ,
description = nil ,
logSetting = {
loggingNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ,
},
})
api_result = api_result_handler () -- Call the handler to get the result
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 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.get_namespace_status_async ({
namespaceName = "namespace1" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
status = result.status ;
getNamespace ネームスペースを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.get_namespace_async ({
namespaceName = "namespace1" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
updateNamespace ネームスペースを更新
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 description string ~ 1024文字 説明文 logSetting LogSetting ログの出力設定
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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: \n amespace1" ))
);
$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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.update_namespace_async ({
namespaceName = "namespace1" ,
description = "description1" ,
logSetting = {
loggingNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ,
},
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
deleteNamespace ネームスペースを削除
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.delete_namespace_async ({
namespaceName = "namespace1" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
describeAreaModels エリアモデルの一覧を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.describe_area_models_async ({
namespaceName = "namespace1" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
getAreaModel エリアモデルを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 areaModelName string ✓ ~ 128文字 エリアモデル名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.get_area_model_async ({
namespaceName = "namespace1" ,
areaModelName = "area-0001" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
describeAreaModelMasters エリアモデルマスターの一覧を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン limit int ✓ 30 1 ~ 1000 データの取得件数
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.describe_area_model_masters_async ({
namespaceName = "namespace1" ,
pageToken = nil ,
limit = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
createAreaModelMaster エリアモデルマスターを新規作成
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 name string ✓ ~ 128文字 エリアモデル名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.create_area_model_master_async ({
namespaceName = "namespace1" ,
name = "area-0001" ,
description = nil ,
metadata = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
getAreaModelMaster エリアモデルマスターを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 areaModelName string ✓ ~ 128文字 エリアモデル名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.get_area_model_master_async ({
namespaceName = "namespace1" ,
areaModelName = "area-0001" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
updateAreaModelMaster エリアモデルマスターを更新
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 areaModelName string ✓ ~ 128文字 エリアモデル名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.update_area_model_master_async ({
namespaceName = "namespace1" ,
areaModelName = "area-0001" ,
description = "description1" ,
metadata = "AREA_MASTER" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
deleteAreaModelMaster エリアモデルマスターを削除
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 areaModelName string ✓ ~ 128文字 エリアモデル名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.delete_area_model_master_async ({
namespaceName = "namespace1" ,
areaModelName = "area-0001" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
describeLayerModels レイヤーの一覧を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 areaModelName string ✓ ~ 128文字 エリアモデル名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.describe_layer_models_async ({
namespaceName = "namespace1" ,
areaModelName = "area-0001" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
getLayerModel レイヤーを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 areaModelName string ✓ ~ 128文字 エリアモデル名 layerModelName string ✓ ~ 128文字 レイヤーモデル名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.get_layer_model_async ({
namespaceName = "namespace1" ,
areaModelName = "area-0001" ,
layerModelName = "layer-0001" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
describeLayerModelMasters レイヤーマスターの一覧を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 areaModelName string ✓ ~ 128文字 エリアモデル名 pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン limit int ✓ 30 1 ~ 1000 データの取得件数
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.describe_layer_model_masters_async ({
namespaceName = "namespace1" ,
areaModelName = "area-0001" ,
pageToken = nil ,
limit = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
createLayerModelMaster レイヤーマスターを新規作成
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 areaModelName string ✓ ~ 128文字 エリアモデル名 name string ✓ ~ 128文字 レイヤーモデル名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.create_layer_model_master_async ({
namespaceName = "namespace1" ,
areaModelName = "area-0001" ,
name = "layer-0001" ,
description = nil ,
metadata = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
getLayerModelMaster レイヤーマスターを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 areaModelName string ✓ ~ 128文字 エリアモデル名 layerModelName string ✓ ~ 128文字 レイヤーモデル名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.get_layer_model_master_async ({
namespaceName = "namespace1" ,
areaModelName = "area-0001" ,
layerModelName = "layer-0001" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
updateLayerModelMaster レイヤーマスターを更新
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 areaModelName string ✓ ~ 128文字 エリアモデル名 layerModelName string ✓ ~ 128文字 レイヤーモデル名 description string ~ 1024文字 説明文 metadata string ~ 2048文字 メタデータ
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.update_layer_model_master_async ({
namespaceName = "namespace1" ,
areaModelName = "area-0001" ,
layerModelName = "layer-0001" ,
description = "description1" ,
metadata = "LAYER_0001" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
deleteLayerModelMaster レイヤーマスターを削除
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 areaModelName string ✓ ~ 128文字 エリアモデル名 layerModelName string ✓ ~ 128文字 レイヤーモデル名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.delete_layer_model_master_async ({
namespaceName = "namespace1" ,
areaModelName = "area-0001" ,
layerModelName = "layer-0001" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
exportMaster 現在有効な所持品マスターのマスターデータをエクスポート
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.export_master_async ({
namespaceName = "namespace1" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
getCurrentFieldMaster 現在有効な所持品マスターを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.get_current_field_master_async ({
namespaceName = "namespace1" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
updateCurrentFieldMaster 現在有効な所持品マスターを更新
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 settings string ✓ ~ 5242880文字 マスターデータ
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.update_current_field_master_async ({
namespaceName = "namespace1" ,
settings = "{ \" version \" : \" 2022-08-28 \" , \" areaModels \" : [{ \" name \" : \" area-0001 \" , \" metadata \" : \" AREA_0001 \" , \" layerModels \" : [{ \" name \" : \" layer-0001 \" , \" metadata \" : \" LAYER_0001 \" }]}]}" ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
updateCurrentFieldMasterFromGitHub 現在有効な所持品マスターを更新
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 checkoutSetting GitHubCheckoutSetting ✓ GitHubからマスターデータをチェックアウトしてくる設定
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 : & megaField . GitHubCheckoutSetting {
ApiKeyId : pointy . String ( "$gitHubApiKey1.apiKeyId" ),
RepositoryName : pointy . String ( "gs2io/master-data" ),
SourcePath : pointy . String ( "path/to/file.json" ),
ReferenceType : pointy . String ( "branch" ),
BranchName : pointy . String ( "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 (( new GitHubCheckoutSetting ())
-> withApiKeyId ( self :: $gitHubApiKey1 . apiKeyId )
-> withRepositoryName ( "gs2io/master-data" )
-> withSourcePath ( "path/to/file.json" )
-> withReferenceType ( "branch" )
-> withBranchName ( "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 ( new GitHubCheckoutSetting ()
. withApiKeyId ( "$gitHubApiKey1.apiKeyId" )
. withRepositoryName ( "gs2io/master-data" )
. withSourcePath ( "path/to/file.json" )
. withReferenceType ( "branch" )
. withBranchName ( "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 ( new Gs2 . Gs2MegaField . Model . GitHubCheckoutSetting ()
. WithApiKeyId ( "$gitHubApiKey1.apiKeyId" )
. WithRepositoryName ( "gs2io/master-data" )
. WithSourcePath ( "path/to/file.json" )
. WithReferenceType ( "branch" )
. WithBranchName ( "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 ( new Gs2MegaField . model . GitHubCheckoutSetting ()
. withApiKeyId ( "$gitHubApiKey1.apiKeyId" )
. withRepositoryName ( "gs2io/master-data" )
. withSourcePath ( "path/to/file.json" )
. withReferenceType ( "branch" )
. withBranchName ( "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 ( mega_field . GitHubCheckoutSetting ()
. with_api_key_id ( self . git_hub_api_key1 . api_key_id )
. with_repository_name ( 'gs2io/master-data' )
. with_source_path ( 'path/to/file.json' )
. with_reference_type ( 'branch' )
. with_branch_name ( '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 = {
api_key_id = "$gitHubApiKey1.apiKeyId" ,
repository_name = "gs2io/master-data" ,
source_path = "path/to/file.json" ,
reference_type = "branch" ,
branch_name = "develop" ,
},
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'megaField' )
api_result_handler = client.update_current_field_master_from_git_hub_async ({
namespaceName = "namespace1" ,
checkoutSetting = {
api_key_id = "$gitHubApiKey1.apiKeyId" ,
repository_name = "gs2io/master-data" ,
source_path = "path/to/file.json" ,
reference_type = "branch" ,
branch_name = "develop" ,
},
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
putPosition 座標を設定
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 accessToken string ✓ ~ 128文字 ユーザーID areaModelName string ✓ ~ 128文字 エリア名 layerModelName string ✓ ~ 128文字 レイヤー名 position Position ✓ 座標 vector Vector ✓ 向き r float ✓ 1 ~ 10000 半径
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ( "accessToken-0001" ),
AreaModelName : pointy . String ( "area-0001" ),
LayerModelName : pointy . String ( "layer-0001" ),
Position : & megaField . Position {
X : pointy . Float32 ( 0 ),
Y : pointy . Float32 ( 1 ),
Z : pointy . Float32 ( 2 ),
},
Vector : & megaField . Vector {
X : pointy . Float32 ( 10 ),
Y : pointy . Float32 ( 11 ),
Z : pointy . Float32 ( 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 (( new Position ())
-> withX ( 0 )
-> withY ( 1 )
-> withZ ( 2 )
)
-> withVector (( new Vector ())
-> withX ( 10 )
-> withY ( 11 )
-> withZ ( 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 ( "accessToken-0001" )
. withAreaModelName ( "area-0001" )
. withLayerModelName ( "layer-0001" )
. withPosition ( new Position ()
. withX ( 0f )
. withY ( 1f )
. withZ ( 2f )
)
. withVector ( new Vector ()
. withX ( 10f )
. withY ( 11f )
. withZ ( 12f )
)
. 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 ( "accessToken-0001" )
. WithAreaModelName ( "area-0001" )
. WithLayerModelName ( "layer-0001" )
. WithPosition ( new Gs2 . Gs2MegaField . Model . Position ()
. WithX ( 0f )
. WithY ( 1f )
. WithZ ( 2f )
)
. WithVector ( new Gs2 . Gs2MegaField . Model . Vector ()
. WithX ( 10f )
. WithY ( 11f )
. WithZ ( 12f )
)
. 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 ( "accessToken-0001" )
. withAreaModelName ( "area-0001" )
. withLayerModelName ( "layer-0001" )
. withPosition ( new Gs2MegaField . model . Position ()
. withX ( 0 )
. withY ( 1 )
. withZ ( 2 )
)
. withVector ( new Gs2MegaField . model . Vector ()
. withX ( 10 )
. withY ( 11 )
. withZ ( 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 ( mega_field . Position ()
. with_x ( 0 )
. with_y ( 1 )
. with_z ( 2 )
)
. with_vector ( mega_field . Vector ()
. with_x ( 10 )
. with_y ( 11 )
. with_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 = "accessToken-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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.put_position_async ({
namespaceName = "namespace1" ,
accessToken = "accessToken-0001" ,
areaModelName = "area-0001" ,
layerModelName = "layer-0001" ,
position = {
x = 0 ,
y = 1 ,
z = 2 ,
},
vector = {
x = 10 ,
y = 11 ,
z = 12 ,
},
r = 5 ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
putPositionByUserId ユーザーIDを指定して座標を設定
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 userId string ✓ ~ 128文字 ユーザーID areaModelName string ✓ ~ 128文字 エリア名 layerModelName string ✓ ~ 128文字 レイヤー名 position Position ✓ 座標 vector Vector ✓ 向き r float ✓ 1 ~ 10000 半径 timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 : & megaField . Position {
X : pointy . Float32 ( 0 ),
Y : pointy . Float32 ( 1 ),
Z : pointy . Float32 ( 2 ),
},
Vector : & megaField . Vector {
X : pointy . Float32 ( 10 ),
Y : pointy . Float32 ( 11 ),
Z : pointy . Float32 ( 12 ),
},
R : pointy . Float32 ( 5 ),
TimeOffsetToken : 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\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 (( new Position ())
-> withX ( 0 )
-> withY ( 1 )
-> withZ ( 2 )
)
-> withVector (( new Vector ())
-> withX ( 10 )
-> withY ( 11 )
-> withZ ( 12 )
)
-> withR ( 5 )
-> withTimeOffsetToken ( 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.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 ( new Position ()
. withX ( 0f )
. withY ( 1f )
. withZ ( 2f )
)
. withVector ( new Vector ()
. withX ( 10f )
. withY ( 11f )
. withZ ( 12f )
)
. withR ( 5f )
. withTimeOffsetToken ( null )
);
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 ( new Gs2 . Gs2MegaField . Model . Position ()
. WithX ( 0f )
. WithY ( 1f )
. WithZ ( 2f )
)
. WithVector ( new Gs2 . Gs2MegaField . Model . Vector ()
. WithX ( 10f )
. WithY ( 11f )
. WithZ ( 12f )
)
. WithR ( 5f )
. WithTimeOffsetToken ( 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 . putPositionByUserId (
new Gs2MegaField . PutPositionByUserIdRequest ()
. withNamespaceName ( "namespace1" )
. withUserId ( "user-0001" )
. withAreaModelName ( "area-0001" )
. withLayerModelName ( "layer-0001" )
. withPosition ( new Gs2MegaField . model . Position ()
. withX ( 0 )
. withY ( 1 )
. withZ ( 2 )
)
. withVector ( new Gs2MegaField . model . Vector ()
. withX ( 10 )
. withY ( 11 )
. withZ ( 12 )
)
. withR ( 5 )
. withTimeOffsetToken ( 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 . 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 ( mega_field . Position ()
. with_x ( 0 )
. with_y ( 1 )
. with_z ( 2 )
)
. with_vector ( mega_field . Vector ()
. with_x ( 10 )
. with_y ( 11 )
. with_z ( 12 )
)
. with_r ( 5 )
. with_time_offset_token ( None )
)
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 ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'megaField' )
api_result_handler = client.put_position_by_user_id_async ({
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 ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
fetchPosition 座標を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 accessToken string ✓ ~ 128文字 ユーザーID areaModelName string ✓ ~ 128文字 エリア名 layerModelName string ✓ ~ 128文字 レイヤー名 userIds List<string> ✓ 1 ~ 100 items ユーザーIDリスト
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ( "accessToken-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 ( "accessToken-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 ( "accessToken-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 ( "accessToken-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 = "accessToken-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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.fetch_position_async ({
namespaceName = "namespace1" ,
accessToken = "accessToken-0001" ,
areaModelName = "area-0001" ,
layerModelName = "layer-0001" ,
userIds = {
"user-0001" ,
"user-0002" ,
"user-0003"
},
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
fetchPositionFromSystem 座標を取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 areaModelName string ✓ ~ 128文字 エリア名 layerModelName string ✓ ~ 128文字 レイヤー名 userIds List<string> ✓ 1 ~ 100 items ユーザーIDリスト
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.fetch_position_from_system_async ({
namespaceName = "namespace1" ,
areaModelName = "area-0001" ,
layerModelName = "layer-0001" ,
userIds = {
"user-0001" ,
"user-0002" ,
"user-0003"
},
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
nearUserIds 近くにいるユーザーIDリストを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 accessToken string ✓ ~ 128文字 ユーザーID areaModelName string ✓ ~ 128文字 エリア名 layerModelName string ✓ ~ 128文字 レイヤー名 point Position ✓ 座標 r float ✓ 1 ~ 16777214 半径 limit int ✓ 1 ~ 100 最大数
Result 型 説明 items List<string> 近くにいるユーザーIDリスト
実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ( "accessToken-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 ( "accessToken-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 ( "accessToken-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 ( "accessToken-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 = "accessToken-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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.near_user_ids_async ({
namespaceName = "namespace1" ,
accessToken = "accessToken-0001" ,
areaModelName = "area-0001" ,
layerModelName = "layer-0001" ,
point = nil ,
r = 5 ,
limit = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
nearUserIdsFromSystem 近くにいるユーザーIDリストを取得
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 areaModelName string ✓ ~ 128文字 エリア名 layerModelName string ✓ ~ 128文字 レイヤー名 point Position ✓ 座標 r float ✓ 1 ~ 16777214 半径 limit int ✓ 1 ~ 100 最大数
Result 型 説明 items List<string> 近くにいるユーザーIDリスト
実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.near_user_ids_from_system_async ({
namespaceName = "namespace1" ,
areaModelName = "area-0001" ,
layerModelName = "layer-0001" ,
point = nil ,
r = 5 ,
limit = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
action 座標を設定
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 accessToken string ✓ ~ 128文字 ユーザーID areaModelName string ✓ ~ 128文字 エリア名 layerModelName string ✓ ~ 128文字 レイヤー名 position MyPosition ✓ 自分の位置情報 scopes List<Scope> ~ 10 items 他プレイヤーの取得範囲リスト
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ( "accessToken-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 ( "accessToken-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 ( "accessToken-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 ( "accessToken-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 = "accessToken-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 ;
client = gs2 ( 'megaField' )
api_result_handler = client.action_async ({
namespaceName = "namespace1" ,
accessToken = "accessToken-0001" ,
areaModelName = "area-0001" ,
layerModelName = "layer-0001" ,
position = nil ,
scopes = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
actionByUserId ユーザーIDを指定して座標を設定
Request 型 有効化条件 必須 デフォルト 値の制限 説明 namespaceName string ✓ ~ 128文字 ネームスペース名 userId string ✓ ~ 128文字 ユーザーID areaModelName string ✓ ~ 128文字 エリア名 layerModelName string ✓ ~ 128文字 レイヤー名 position MyPosition ✓ 自分の位置情報 scopes List<Scope> ~ 10 items 他プレイヤーの取得範囲リスト timeOffsetToken string ~ 1024文字 タイムオフセットトークン
Result 実装例
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ,
TimeOffsetToken : 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 )
-> withTimeOffsetToken ( 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 )
. withTimeOffsetToken ( 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 )
. WithTimeOffsetToken ( 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 )
. withTimeOffsetToken ( 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 )
. with_time_offset_token ( 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 ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
client = gs2 ( 'megaField' )
api_result_handler = client.action_by_user_id_async ({
namespaceName = "namespace1" ,
userId = "user-0001" ,
areaModelName = "area-0001" ,
layerModelName = "layer-0001" ,
position = nil ,
scopes = nil ,
timeOffsetToken = nil ,
})
api_result = api_result_handler () -- Call the handler to get the result
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;