NAV
go python java php typescript csharp GS2-Script

GS2-Dictionary

GS2-SDK のリファレンス

モデル

Namespace

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

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

説明
namespaceId string ネームスペースGRN
name string ネームスペース名
description string 説明文
entryScript ScriptSetting エントリー登録時に実行するスクリプト
duplicateEntryScript ScriptSetting 登録済みのエントリーを再度登録しようとした時に実行するスクリプト
logSetting LogSetting ログの出力設定
createdAt long 作成日時
updatedAt long 最終更新日時

EntryModel

エントリーモデルとは図鑑に記録するエンティティです。 ここではどんなエンティティが図鑑に記録可能かを定義します。

説明
entryModelId string エントリーモデルGRN
name string エントリーの種類名
metadata string メタデータ

EntryModelMaster

エントリーモデルとは図鑑に記録するエンティティです。 ここではどんなエンティティが図鑑に記録可能かを定義します。

説明
entryModelId string エントリーモデルマスターGRN
name string エントリーモデル名
description string 説明文
metadata string メタデータ
createdAt long 作成日時
updatedAt long 最終更新日時

Entry

ゲームプレイヤーが入手したエントリー。

説明
entryId string エントリーGRN
userId string ユーザーID
name string エントリーの種類名
acquiredAt long 入手日時

CurrentEntryMaster

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

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

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

説明
namespaceId string ネームスペースGRN
settings string マスターデータ

Config

説明
key string 名前
value string

GitHubCheckoutSetting

説明
apiKeyId string GitHub のAPIキーGRN
repositoryName string リポジトリ名
sourcePath string ソースコードのファイルパス
referenceType string コードの取得元
commitHash string コミットハッシュ
branchName string ブランチ名
tagName string タグ名

ScriptSetting

説明
triggerScriptId string スクリプトGRN
doneTriggerTargetType string 完了通知の通知先
doneTriggerScriptId string スクリプトGRN
doneTriggerQueueNamespaceId string ネームスペースGRN

LogSetting

説明
loggingNamespaceId string ネームスペースGRN

メソッド

describeNamespaces

describeNamespaces

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

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

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeNamespaces(
    new 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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.describeNamespaces(
        new Gs2Dictionary.DescribeNamespacesRequest()
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.describe_namespaces(
        new dictionary.DescribeNamespacesRequest()
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

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

Request

必須 デフォルト 値の制限 説明
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items Namespace[] ネームスペースのリスト
nextPageToken string リストの続きを取得するためのページトークン

createNamespace

createNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &dictionary.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        EntryScript: nil,
        DuplicateEntryScript: nil,
        LogSetting: &dictionary.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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\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)
            ->withEntryScript(null)
            ->withDuplicateEntryScript(null)
            ->withLogSetting((new \Gs2\Dictionary\Model\LogSetting())
                ->withLoggingNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.CreateNamespaceRequest;
import io.gs2.dictionary.result.CreateNamespaceResult;

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

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

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createNamespace(
    new CreateNamespaceRequest()
        .withName("namespace1")
        .withDescription(null)
        .withEntryScript(null)
        .withDuplicateEntryScript(null)
        .withLogSetting(new Gs2.Gs2Dictionary.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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.createNamespace(
        new Gs2Dictionary.CreateNamespaceRequest()
            .withName('namespace1')
            .withDescription(undefined)
            .withEntryScript(undefined)
            .withDuplicateEntryScript(undefined)
            .withLogSetting(new Gs2Dictionary.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 dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.create_namespace(
        new dictionary.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_entry_script(None)
            .with_duplicate_entry_script(None)
            .with_log_setting(
                dictionary.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

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

Request

必須 デフォルト 値の制限 説明
name string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
entryScript ScriptSetting エントリー登録時に実行するスクリプト
duplicateEntryScript ScriptSetting 登録済みのエントリーを再度登録しようとした時に実行するスクリプト
logSetting LogSetting ログの出力設定

Result

説明
item Namespace 作成したネームスペース

getNamespaceStatus

getNamespaceStatus

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

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

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespaceStatus(
    new 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 Gs2Dictionary from '@/gs2/dictionary';

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

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

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.get_namespace_status(
        new dictionary.GetNamespaceStatusRequest()
            .with_namespace_name(self.hash1)
    )
    status = result.status
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
status = result.status;

ネームスペースを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
status string

getNamespace

getNamespace

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

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

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespace(
    new 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 Gs2Dictionary from '@/gs2/dictionary';

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

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

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.get_namespace(
        new dictionary.GetNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item Namespace ネームスペース

updateNamespace

updateNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &dictionary.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        EntryScript: nil,
        DuplicateEntryScript: nil,
        LogSetting: &dictionary.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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\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')
            ->withEntryScript(null)
            ->withDuplicateEntryScript(null)
            ->withLogSetting((new \Gs2\Dictionary\Model\LogSetting())
                ->withLoggingNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.UpdateNamespaceRequest;
import io.gs2.dictionary.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withEntryScript(null)
            .withDuplicateEntryScript(null)
            .withLogSetting(new io.gs2.dictionary.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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.UpdateNamespaceRequest;
using Gs2.Gs2Dictionary.Result.UpdateNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateNamespace(
    new UpdateNamespaceRequest()
        .withNamespaceName("namespace1")
        .withDescription("description1")
        .withEntryScript(null)
        .withDuplicateEntryScript(null)
        .withLogSetting(new Gs2.Gs2Dictionary.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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.updateNamespace(
        new Gs2Dictionary.UpdateNamespaceRequest()
            .withNamespaceName('namespace1')
            .withDescription('description1')
            .withEntryScript(undefined)
            .withDuplicateEntryScript(undefined)
            .withLogSetting(new Gs2Dictionary.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 dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.update_namespace(
        new dictionary.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_entry_script(None)
            .with_duplicate_entry_script(None)
            .with_log_setting(
                dictionary.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
entryScript ScriptSetting エントリー登録時に実行するスクリプト
duplicateEntryScript ScriptSetting 登録済みのエントリーを再度登録しようとした時に実行するスクリプト
logSetting LogSetting ログの出力設定

Result

説明
item Namespace 更新したネームスペース

deleteNamespace

deleteNamespace

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

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

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteNamespace(
    new 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 Gs2Dictionary from '@/gs2/dictionary';

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

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

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.delete_namespace(
        new dictionary.DeleteNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item Namespace 削除したネームスペース

describeEntryModels

describeEntryModels

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.DescribeEntryModels(
    &dictionary.DescribeEntryModelsRequest {
        NamespaceName: pointy.String("namespace2"),
    }
)
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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\DescribeEntryModelsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeEntryModels(
        (new DescribeEntryModelsRequest())
            ->withNamespaceName(self::namespace2)
    );
    $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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.DescribeEntryModelsRequest;
import io.gs2.dictionary.result.DescribeEntryModelsResult;

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

try {
    DescribeEntryModelsResult result = client.describeEntryModels(
        new DescribeEntryModelsRequest()
            .withNamespaceName("namespace2")
    );
    List<EntryModel> 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DescribeEntryModelsRequest;
using Gs2.Gs2Dictionary.Result.DescribeEntryModelsResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeEntryModels(
    new DescribeEntryModelsRequest()
        .withNamespaceName("namespace2"),
    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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.describeEntryModels(
        new Gs2Dictionary.DescribeEntryModelsRequest()
            .withNamespaceName('namespace2')
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.describe_entry_models(
        new dictionary.DescribeEntryModelsRequest()
            .with_namespace_name(self.hash2)
    )
    items = result.items
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.describe_entry_models({
    namespaceName='namespace2',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;

エントリーモデルの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
items EntryModel[] エントリーモデルのリスト

getEntryModel

getEntryModel

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.GetEntryModel(
    &dictionary.GetEntryModelRequest {
        NamespaceName: pointy.String("namespace2"),
        EntryName: pointy.String("entry-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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\GetEntryModelRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getEntryModel(
        (new GetEntryModelRequest())
            ->withNamespaceName(self::namespace2)
            ->withEntryName('entry-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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.GetEntryModelRequest;
import io.gs2.dictionary.result.GetEntryModelResult;

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

try {
    GetEntryModelResult result = client.getEntryModel(
        new GetEntryModelRequest()
            .withNamespaceName("namespace2")
            .withEntryName("entry-0001")
    );
    EntryModel 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetEntryModelRequest;
using Gs2.Gs2Dictionary.Result.GetEntryModelResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getEntryModel(
    new GetEntryModelRequest()
        .withNamespaceName("namespace2")
        .withEntryName("entry-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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.getEntryModel(
        new Gs2Dictionary.GetEntryModelRequest()
            .withNamespaceName('namespace2')
            .withEntryName('entry-0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.get_entry_model(
        new dictionary.GetEntryModelRequest()
            .with_namespace_name(self.hash2)
            .with_entry_name('entry-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.get_entry_model({
    namespaceName='namespace2',
    entryName='entry-0001',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

エントリーモデルを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
entryName string ~ 128文字 エントリーの種類名

Result

説明
item EntryModel エントリーモデル

describeEntryModelMasters

describeEntryModelMasters

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.DescribeEntryModelMasters(
    &dictionary.DescribeEntryModelMastersRequest {
        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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\DescribeEntryModelMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeEntryModelMasters(
        (new DescribeEntryModelMastersRequest())
            ->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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.DescribeEntryModelMastersRequest;
import io.gs2.dictionary.result.DescribeEntryModelMastersResult;

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

try {
    DescribeEntryModelMastersResult result = client.describeEntryModelMasters(
        new DescribeEntryModelMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<EntryModelMaster> 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DescribeEntryModelMastersRequest;
using Gs2.Gs2Dictionary.Result.DescribeEntryModelMastersResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeEntryModelMasters(
    new DescribeEntryModelMastersRequest()
        .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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.describeEntryModelMasters(
        new Gs2Dictionary.DescribeEntryModelMastersRequest()
            .withNamespaceName('namespace1')
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.describe_entry_model_masters(
        new dictionary.DescribeEntryModelMastersRequest()
            .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:
    os.exit(1);

client = gs2('dictionary')

api_result = client.describe_entry_model_masters({
    namespaceName='namespace1',
    pageToken=nil,
    limit=nil,
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

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

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items EntryModelMaster[] エントリーモデルマスターのリスト
nextPageToken string リストの続きを取得するためのページトークン

createEntryModelMaster

createEntryModelMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.CreateEntryModelMaster(
    &dictionary.CreateEntryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("monster-0001"),
        Description: nil,
        Metadata: pointy.String("MONSTER-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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\CreateEntryModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createEntryModelMaster(
        (new CreateEntryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName('monster-0001')
            ->withDescription(null)
            ->withMetadata('MONSTER-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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.CreateEntryModelMasterRequest;
import io.gs2.dictionary.result.CreateEntryModelMasterResult;

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

try {
    CreateEntryModelMasterResult result = client.createEntryModelMaster(
        new CreateEntryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("monster-0001")
            .withDescription(null)
            .withMetadata("MONSTER-0001")
    );
    EntryModelMaster 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.CreateEntryModelMasterRequest;
using Gs2.Gs2Dictionary.Result.CreateEntryModelMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createEntryModelMaster(
    new CreateEntryModelMasterRequest()
        .withNamespaceName("namespace1")
        .withName("monster-0001")
        .withDescription(null)
        .withMetadata("MONSTER-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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.createEntryModelMaster(
        new Gs2Dictionary.CreateEntryModelMasterRequest()
            .withNamespaceName('namespace1')
            .withName('monster-0001')
            .withDescription(undefined)
            .withMetadata('MONSTER-0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.create_entry_model_master(
        new dictionary.CreateEntryModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('monster-0001')
            .with_description(None)
            .with_metadata('MONSTER-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.create_entry_model_master({
    namespaceName='namespace1',
    name='monster-0001',
    description=nil,
    metadata='MONSTER-0001',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

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

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
name string ~ 128文字 エントリーモデル名
description string ~ 1024文字 説明文
metadata string ~ 2048文字 メタデータ

Result

説明
item EntryModelMaster 作成したエントリーモデルマスター

getEntryModelMaster

getEntryModelMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.GetEntryModelMaster(
    &dictionary.GetEntryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        EntryName: pointy.String("monster-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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\GetEntryModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getEntryModelMaster(
        (new GetEntryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withEntryName('monster-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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.GetEntryModelMasterRequest;
import io.gs2.dictionary.result.GetEntryModelMasterResult;

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

try {
    GetEntryModelMasterResult result = client.getEntryModelMaster(
        new GetEntryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withEntryName("monster-0001")
    );
    EntryModelMaster 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetEntryModelMasterRequest;
using Gs2.Gs2Dictionary.Result.GetEntryModelMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getEntryModelMaster(
    new GetEntryModelMasterRequest()
        .withNamespaceName("namespace1")
        .withEntryName("monster-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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.getEntryModelMaster(
        new Gs2Dictionary.GetEntryModelMasterRequest()
            .withNamespaceName('namespace1')
            .withEntryName('monster-0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.get_entry_model_master(
        new dictionary.GetEntryModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_entry_name('monster-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.get_entry_model_master({
    namespaceName='namespace1',
    entryName='monster-0001',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

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

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
entryName string ~ 128文字 エントリーモデル名

Result

説明
item EntryModelMaster エントリーモデルマスター

updateEntryModelMaster

updateEntryModelMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.UpdateEntryModelMaster(
    &dictionary.UpdateEntryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        EntryName: pointy.String("monster-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("MONSTER-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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\UpdateEntryModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateEntryModelMaster(
        (new UpdateEntryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withEntryName('monster-0001')
            ->withDescription('description1')
            ->withMetadata('MONSTER-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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.UpdateEntryModelMasterRequest;
import io.gs2.dictionary.result.UpdateEntryModelMasterResult;

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

try {
    UpdateEntryModelMasterResult result = client.updateEntryModelMaster(
        new UpdateEntryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withEntryName("monster-0001")
            .withDescription("description1")
            .withMetadata("MONSTER-0001")
    );
    EntryModelMaster 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.UpdateEntryModelMasterRequest;
using Gs2.Gs2Dictionary.Result.UpdateEntryModelMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateEntryModelMaster(
    new UpdateEntryModelMasterRequest()
        .withNamespaceName("namespace1")
        .withEntryName("monster-0001")
        .withDescription("description1")
        .withMetadata("MONSTER-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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.updateEntryModelMaster(
        new Gs2Dictionary.UpdateEntryModelMasterRequest()
            .withNamespaceName('namespace1')
            .withEntryName('monster-0001')
            .withDescription('description1')
            .withMetadata('MONSTER-0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.update_entry_model_master(
        new dictionary.UpdateEntryModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_entry_name('monster-0001')
            .with_description('description1')
            .with_metadata('MONSTER-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.update_entry_model_master({
    namespaceName='namespace1',
    entryName='monster-0001',
    description='description1',
    metadata='MONSTER-0001',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

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

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
entryName string ~ 128文字 エントリーモデル名
description string ~ 1024文字 説明文
metadata string ~ 2048文字 メタデータ

Result

説明
item EntryModelMaster 更新したエントリーモデルマスター

deleteEntryModelMaster

deleteEntryModelMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.DeleteEntryModelMaster(
    &dictionary.DeleteEntryModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        EntryName: pointy.String("monster-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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\DeleteEntryModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteEntryModelMaster(
        (new DeleteEntryModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withEntryName('monster-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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.DeleteEntryModelMasterRequest;
import io.gs2.dictionary.result.DeleteEntryModelMasterResult;

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

try {
    DeleteEntryModelMasterResult result = client.deleteEntryModelMaster(
        new DeleteEntryModelMasterRequest()
            .withNamespaceName("namespace1")
            .withEntryName("monster-0001")
    );
    EntryModelMaster 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DeleteEntryModelMasterRequest;
using Gs2.Gs2Dictionary.Result.DeleteEntryModelMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteEntryModelMaster(
    new DeleteEntryModelMasterRequest()
        .withNamespaceName("namespace1")
        .withEntryName("monster-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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.deleteEntryModelMaster(
        new Gs2Dictionary.DeleteEntryModelMasterRequest()
            .withNamespaceName('namespace1')
            .withEntryName('monster-0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.delete_entry_model_master(
        new dictionary.DeleteEntryModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_entry_name('monster-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.delete_entry_model_master({
    namespaceName='namespace1',
    entryName='monster-0001',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

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

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
entryName string ~ 128文字 エントリーモデル名

Result

説明
item EntryModelMaster 削除したエントリーモデルマスター

describeEntries

describeEntries

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.DescribeEntries(
    &dictionary.DescribeEntriesRequest {
        NamespaceName: pointy.String("namespace2"),
        AccessToken: pointy.String("$access_token_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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\DescribeEntriesRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeEntries(
        (new DescribeEntriesRequest())
            ->withNamespaceName(self::namespace2)
            ->withAccessToken(self::$accessToken0001)
            ->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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.DescribeEntriesRequest;
import io.gs2.dictionary.result.DescribeEntriesResult;

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

try {
    DescribeEntriesResult result = client.describeEntries(
        new DescribeEntriesRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Entry> 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DescribeEntriesRequest;
using Gs2.Gs2Dictionary.Result.DescribeEntriesResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeEntries(
    new DescribeEntriesRequest()
        .withNamespaceName("namespace2")
        .withAccessToken("$access_token_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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.describeEntries(
        new Gs2Dictionary.DescribeEntriesRequest()
            .withNamespaceName('namespace2')
            .withAccessToken('$access_token_0001')
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.describe_entries(
        new dictionary.DescribeEntriesRequest()
            .with_namespace_name(self.hash2)
            .with_access_token(self.access_token_0001)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.describe_entries({
    namespaceName='namespace2',
    accessToken='$access_token_0001',
    pageToken=nil,
    limit=nil,
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

エントリーの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items Entry[] エントリーのリスト
nextPageToken string リストの続きを取得するためのページトークン

describeEntriesByUserId

describeEntriesByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.DescribeEntriesByUserId(
    &dictionary.DescribeEntriesByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\DescribeEntriesByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeEntriesByUserId(
        (new DescribeEntriesByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId('user-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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.DescribeEntriesByUserIdRequest;
import io.gs2.dictionary.result.DescribeEntriesByUserIdResult;

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

try {
    DescribeEntriesByUserIdResult result = client.describeEntriesByUserId(
        new DescribeEntriesByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Entry> 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DescribeEntriesByUserIdRequest;
using Gs2.Gs2Dictionary.Result.DescribeEntriesByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeEntriesByUserId(
    new DescribeEntriesByUserIdRequest()
        .withNamespaceName("namespace2")
        .withUserId("user-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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.describeEntriesByUserId(
        new Gs2Dictionary.DescribeEntriesByUserIdRequest()
            .withNamespaceName('namespace2')
            .withUserId('user-0001')
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.describe_entries_by_user_id(
        new dictionary.DescribeEntriesByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.describe_entries_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    pageToken=nil,
    limit=nil,
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

ユーザIDを指定してエントリーの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items Entry[] エントリーのリスト
nextPageToken string リストの続きを取得するためのページトークン

addEntriesByUserId

addEntriesByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.AddEntriesByUserId(
    &dictionary.AddEntriesByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        EntryModelNames: []string{
            "entry-0001",
        "entry-0002",
        "entry-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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\AddEntriesByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->addEntriesByUserId(
        (new AddEntriesByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId('user-0001')
            ->withEntryModelNames([    'entry-0001',
            'entry-0002',
            'entry-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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.AddEntriesByUserIdRequest;
import io.gs2.dictionary.result.AddEntriesByUserIdResult;

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

try {
    AddEntriesByUserIdResult result = client.addEntriesByUserId(
        new AddEntriesByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withEntryModelNames(Arrays.asList(
                "entry-0001",
            "entry-0002",
            "entry-0003"
            ))
    );
    List<Entry> 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.AddEntriesByUserIdRequest;
using Gs2.Gs2Dictionary.Result.AddEntriesByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.addEntriesByUserId(
    new AddEntriesByUserIdRequest()
        .withNamespaceName("namespace2")
        .withUserId("user-0001")
        .withEntryModelNames(new string[] {
            "entry-0001",
        "entry-0002",
        "entry-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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.addEntriesByUserId(
        new Gs2Dictionary.AddEntriesByUserIdRequest()
            .withNamespaceName('namespace2')
            .withUserId('user-0001')
            .withEntryModelNames([
                'entry-0001',
            'entry-0002',
            'entry-0003'
            ])
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.add_entries_by_user_id(
        new dictionary.AddEntriesByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_entry_model_names([    'entry-0001',
            'entry-0002',
            'entry-0003',
            ])
    )
    items = result.items
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.add_entries_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    entryModelNames={
        'entry-0001',
    'entry-0002',
    'entry-0003'
    },
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;

ユーザIDを指定してエントリーを入手済みとして登録

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
entryModelNames string[] [] エントリー名のリスト

Result

説明
items Entry[] 登録した{model_name}のリスト

getEntry

getEntry

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.GetEntry(
    &dictionary.GetEntryRequest {
        NamespaceName: pointy.String("namespace2"),
        AccessToken: pointy.String("$access_token_0001"),
        EntryModelName: pointy.String("entry-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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\GetEntryRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getEntry(
        (new GetEntryRequest())
            ->withNamespaceName(self::namespace2)
            ->withAccessToken(self::$accessToken0001)
            ->withEntryModelName('entry-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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.GetEntryRequest;
import io.gs2.dictionary.result.GetEntryResult;

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

try {
    GetEntryResult result = client.getEntry(
        new GetEntryRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withEntryModelName("entry-0001")
    );
    Entry 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetEntryRequest;
using Gs2.Gs2Dictionary.Result.GetEntryResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getEntry(
    new GetEntryRequest()
        .withNamespaceName("namespace2")
        .withAccessToken("$access_token_0001")
        .withEntryModelName("entry-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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.getEntry(
        new Gs2Dictionary.GetEntryRequest()
            .withNamespaceName('namespace2')
            .withAccessToken('$access_token_0001')
            .withEntryModelName('entry-0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.get_entry(
        new dictionary.GetEntryRequest()
            .with_namespace_name(self.hash2)
            .with_access_token(self.access_token_0001)
            .with_entry_model_name('entry-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.get_entry({
    namespaceName='namespace2',
    accessToken='$access_token_0001',
    entryModelName='entry-0001',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

エントリーを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
entryModelName string ~ 128文字 エントリーの種類名

Result

説明
item Entry エントリー

getEntryByUserId

getEntryByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.GetEntryByUserId(
    &dictionary.GetEntryByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        EntryModelName: pointy.String("entry-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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\GetEntryByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getEntryByUserId(
        (new GetEntryByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId('user-0001')
            ->withEntryModelName('entry-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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.GetEntryByUserIdRequest;
import io.gs2.dictionary.result.GetEntryByUserIdResult;

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

try {
    GetEntryByUserIdResult result = client.getEntryByUserId(
        new GetEntryByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withEntryModelName("entry-0001")
    );
    Entry 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetEntryByUserIdRequest;
using Gs2.Gs2Dictionary.Result.GetEntryByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getEntryByUserId(
    new GetEntryByUserIdRequest()
        .withNamespaceName("namespace2")
        .withUserId("user-0001")
        .withEntryModelName("entry-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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.getEntryByUserId(
        new Gs2Dictionary.GetEntryByUserIdRequest()
            .withNamespaceName('namespace2')
            .withUserId('user-0001')
            .withEntryModelName('entry-0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.get_entry_by_user_id(
        new dictionary.GetEntryByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_entry_model_name('entry-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.get_entry_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    entryModelName='entry-0001',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ユーザIDを指定してエントリーを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
entryModelName string ~ 128文字 エントリーの種類名

Result

説明
item Entry エントリー

getEntryWithSignature

getEntryWithSignature

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.GetEntryWithSignature(
    &dictionary.GetEntryWithSignatureRequest {
        NamespaceName: pointy.String("namespace2"),
        AccessToken: pointy.String("$access_token_0001"),
        EntryModelName: pointy.String("entry-0001"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\GetEntryWithSignatureRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getEntryWithSignature(
        (new GetEntryWithSignatureRequest())
            ->withNamespaceName(self::namespace2)
            ->withAccessToken(self::$accessToken0001)
            ->withEntryModelName('entry-0001')
            ->withKeyId(self::$key1.keyId)
    );
    $item = $result->getItem();
    $body = $result->getBody();
    $signature = $result->getSignature();
} 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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.GetEntryWithSignatureRequest;
import io.gs2.dictionary.result.GetEntryWithSignatureResult;

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

try {
    GetEntryWithSignatureResult result = client.getEntryWithSignature(
        new GetEntryWithSignatureRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withEntryModelName("entry-0001")
            .withKeyId("$key1.keyId")
    );
    Entry item = result.getItem();
    String body = result.getBody();
    String signature = result.getSignature();
} 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetEntryWithSignatureRequest;
using Gs2.Gs2Dictionary.Result.GetEntryWithSignatureResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getEntryWithSignature(
    new GetEntryWithSignatureRequest()
        .withNamespaceName("namespace2")
        .withAccessToken("$access_token_0001")
        .withEntryModelName("entry-0001")
        .withKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.getEntryWithSignature(
        new Gs2Dictionary.GetEntryWithSignatureRequest()
            .withNamespaceName('namespace2')
            .withAccessToken('$access_token_0001')
            .withEntryModelName('entry-0001')
            .withKeyId('$key1.keyId')
    );
    const item = result.getItem();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.get_entry_with_signature(
        new dictionary.GetEntryWithSignatureRequest()
            .with_namespace_name(self.hash2)
            .with_access_token(self.access_token_0001)
            .with_entry_model_name('entry-0001')
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.get_entry_with_signature({
    namespaceName='namespace2',
    accessToken='$access_token_0001',
    entryModelName='entry-0001',
    keyId='$key1.keyId',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;

エントリーを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
entryModelName string ~ 128文字 エントリーの種類名
keyId string ~ 1024文字 暗号鍵GRN

Result

説明
item Entry エントリー
body string 署名対象のエントリー情報
signature string 署名

getEntryWithSignatureByUserId

getEntryWithSignatureByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.GetEntryWithSignatureByUserId(
    &dictionary.GetEntryWithSignatureByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        EntryModelName: pointy.String("entry-0001"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
body := result.Body
signature := result.Signature
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\GetEntryWithSignatureByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getEntryWithSignatureByUserId(
        (new GetEntryWithSignatureByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId('user-0001')
            ->withEntryModelName('entry-0001')
            ->withKeyId(self::$key1.keyId)
    );
    $item = $result->getItem();
    $body = $result->getBody();
    $signature = $result->getSignature();
} 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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.GetEntryWithSignatureByUserIdRequest;
import io.gs2.dictionary.result.GetEntryWithSignatureByUserIdResult;

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

try {
    GetEntryWithSignatureByUserIdResult result = client.getEntryWithSignatureByUserId(
        new GetEntryWithSignatureByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withEntryModelName("entry-0001")
            .withKeyId("$key1.keyId")
    );
    Entry item = result.getItem();
    String body = result.getBody();
    String signature = result.getSignature();
} 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetEntryWithSignatureByUserIdRequest;
using Gs2.Gs2Dictionary.Result.GetEntryWithSignatureByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getEntryWithSignatureByUserId(
    new GetEntryWithSignatureByUserIdRequest()
        .withNamespaceName("namespace2")
        .withUserId("user-0001")
        .withEntryModelName("entry-0001")
        .withKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var body = result.Body;
var signature = result.Signature;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.getEntryWithSignatureByUserId(
        new Gs2Dictionary.GetEntryWithSignatureByUserIdRequest()
            .withNamespaceName('namespace2')
            .withUserId('user-0001')
            .withEntryModelName('entry-0001')
            .withKeyId('$key1.keyId')
    );
    const item = result.getItem();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.get_entry_with_signature_by_user_id(
        new dictionary.GetEntryWithSignatureByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_entry_model_name('entry-0001')
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.get_entry_with_signature_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    entryModelName='entry-0001',
    keyId='$key1.keyId',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;

ユーザIDを指定してエントリーを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
entryModelName string ~ 128文字 エントリーの種類名
keyId string ~ 1024文字 暗号鍵GRN

Result

説明
item Entry エントリー
body string 署名対象のエントリー情報
signature string 署名

resetByUserId

resetByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.ResetByUserId(
    &dictionary.ResetByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\ResetByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->resetByUserId(
        (new ResetByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId('user-0001')
    );
} 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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.ResetByUserIdRequest;
import io.gs2.dictionary.result.ResetByUserIdResult;

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

try {
    ResetByUserIdResult result = client.resetByUserId(
        new ResetByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
    );
} 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.ResetByUserIdRequest;
using Gs2.Gs2Dictionary.Result.ResetByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.resetByUserId(
    new ResetByUserIdRequest()
        .withNamespaceName("namespace2")
        .withUserId("user-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.resetByUserId(
        new Gs2Dictionary.ResetByUserIdRequest()
            .withNamespaceName('namespace2')
            .withUserId('user-0001')
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.reset_by_user_id(
        new dictionary.ResetByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
    )
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.reset_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result

エントリーをリセット

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID

Result

説明

addEntriesByStampSheet

addEntriesByStampSheet

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.AddEntriesByStampSheet(
    &dictionary.AddEntriesByStampSheetRequest {
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\AddEntriesByStampSheetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->addEntriesByStampSheet(
        (new AddEntriesByStampSheetRequest())
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.AddEntriesByStampSheetRequest;
import io.gs2.dictionary.result.AddEntriesByStampSheetResult;

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

try {
    AddEntriesByStampSheetResult result = client.addEntriesByStampSheet(
        new AddEntriesByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    List<Entry> 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.AddEntriesByStampSheetRequest;
using Gs2.Gs2Dictionary.Result.AddEntriesByStampSheetResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.addEntriesByStampSheet(
    new AddEntriesByStampSheetRequest()
        .withStampSheet("$stampSheet")
        .withKeyId("$key1.keyId"),
    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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.addEntriesByStampSheet(
        new Gs2Dictionary.AddEntriesByStampSheetRequest()
            .withStampSheet('$stampSheet')
            .withKeyId('$key1.keyId')
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.add_entries_by_stamp_sheet(
        new dictionary.AddEntriesByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    items = result.items
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.add_entries_by_stamp_sheet({
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;

スタンプシートでエントリーを追加

Request

必須 デフォルト 値の制限 説明
stampSheet string ~ 5242880文字 スタンプシート
keyId string ~ 1024文字 暗号鍵GRN

Result

説明
items Entry[] 追加後のエントリーのリスト

exportMaster

exportMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &dictionary.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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.ExportMasterRequest;
import io.gs2.dictionary.result.ExportMasterResult;

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

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

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.exportMaster(
    new 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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.exportMaster(
        new Gs2Dictionary.ExportMasterRequest()
            .withNamespaceName('namespace1')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.export_master(
        new dictionary.ExportMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

現在有効なエントリー設定のマスターデータをエクスポートします

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item CurrentEntryMaster 現在有効なエントリー設定

getCurrentEntryMaster

getCurrentEntryMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.GetCurrentEntryMaster(
    &dictionary.GetCurrentEntryMasterRequest {
        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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\GetCurrentEntryMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCurrentEntryMaster(
        (new GetCurrentEntryMasterRequest())
            ->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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.GetCurrentEntryMasterRequest;
import io.gs2.dictionary.result.GetCurrentEntryMasterResult;

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

try {
    GetCurrentEntryMasterResult result = client.getCurrentEntryMaster(
        new GetCurrentEntryMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentEntryMaster 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetCurrentEntryMasterRequest;
using Gs2.Gs2Dictionary.Result.GetCurrentEntryMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getCurrentEntryMaster(
    new GetCurrentEntryMasterRequest()
        .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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.getCurrentEntryMaster(
        new Gs2Dictionary.GetCurrentEntryMasterRequest()
            .withNamespaceName('namespace1')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.get_current_entry_master(
        new dictionary.GetCurrentEntryMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

現在有効なエントリー設定を取得します

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item CurrentEntryMaster 現在有効なエントリー設定

updateCurrentEntryMaster

updateCurrentEntryMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentEntryMaster(
    &dictionary.UpdateCurrentEntryMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Settings: pointy.String(`{
          "version": "2020-04-30",
          "entryModels": [
            {
              "name": "monster-0001",
              "metadata": "MONSTER-0001"
            },
            {
              "name": "monster-0002",
              "metadata": "MONSTER-0002"
            }
          ]
        }`),
    }
)
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\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\UpdateCurrentEntryMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentEntryMaster(
        (new UpdateCurrentEntryMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSettings("{
              \"version\": \"2020-04-30\",
              \"entryModels\": [
                {
                  \"name\": \"monster-0001\",
                  \"metadata\": \"MONSTER-0001\"
                },
                {
                  \"name\": \"monster-0002\",
                  \"metadata\": \"MONSTER-0002\"
                }
              ]
            }")
    );
    $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.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.UpdateCurrentEntryMasterRequest;
import io.gs2.dictionary.result.UpdateCurrentEntryMasterResult;

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

try {
    UpdateCurrentEntryMasterResult result = client.updateCurrentEntryMaster(
        new UpdateCurrentEntryMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n  \"version\": \"2020-04-30\",\n  \"entryModels\": [\n    {\n      \"name\": \"monster-0001\",\n      \"metadata\": \"MONSTER-0001\"\n    },\n    {\n      \"name\": \"monster-0002\",\n      \"metadata\": \"MONSTER-0002\"\n    }\n  ]\n}")
    );
    CurrentEntryMaster 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.UpdateCurrentEntryMasterRequest;
using Gs2.Gs2Dictionary.Result.UpdateCurrentEntryMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCurrentEntryMaster(
    new UpdateCurrentEntryMasterRequest()
        .withNamespaceName("namespace1")
        .withSettings("{\n  \"version\": \"2020-04-30\",\n  \"entryModels\": [\n    {\n      \"name\": \"monster-0001\",\n      \"metadata\": \"MONSTER-0001\"\n    },\n    {\n      \"name\": \"monster-0002\",\n      \"metadata\": \"MONSTER-0002\"\n    }\n  ]\n}"),
    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 Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.updateCurrentEntryMaster(
        new Gs2Dictionary.UpdateCurrentEntryMasterRequest()
            .withNamespaceName('namespace1')
            .withSettings(`{
              "version": "2020-04-30",
              "entryModels": [
                {
                  "name": "monster-0001",
                  "metadata": "MONSTER-0001"
                },
                {
                  "name": "monster-0002",
                  "metadata": "MONSTER-0002"
                }
              ]
            }`)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.update_current_entry_master(
        new dictionary.UpdateCurrentEntryMasterRequest()
            .with_namespace_name(self.hash1)
            .with_settings('{\n  "version": "2020-04-30",\n  "entryModels": [\n    {\n      "name": "monster-0001",\n      "metadata": "MONSTER-0001"\n    },\n    {\n      "name": "monster-0002",\n      "metadata": "MONSTER-0002"\n    }\n  ]\n}')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

api_result = client.update_current_entry_master({
    namespaceName='namespace1',
    settings='{\n  "version": "2020-04-30",\n  "entryModels": [\n    {\n      "name": "monster-0001",\n      "metadata": "MONSTER-0001"\n    },\n    {\n      "name": "monster-0002",\n      "metadata": "MONSTER-0002"\n    }\n  ]\n}',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

現在有効なエントリー設定を更新します

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
settings string ~ 5242880文字 マスターデータ

Result

説明
item CurrentEntryMaster 更新した現在有効なエントリー設定

updateCurrentEntryMasterFromGitHub

updateCurrentEntryMasterFromGitHub

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
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 := dictionary.Gs2DictionaryRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentEntryMasterFromGitHub(
    &dictionary.UpdateCurrentEntryMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace1"),
        CheckoutSetting: {'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'},
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\UpdateCurrentEntryMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    UpdateCurrentEntryMasterFromGitHubResult result = client.updateCurrentEntryMasterFromGitHub(
        new UpdateCurrentEntryMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    CurrentEntryMaster 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.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.UpdateCurrentEntryMasterFromGitHubRequest;
using Gs2.Gs2Dictionary.Result.UpdateCurrentEntryMasterFromGitHubResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCurrentEntryMasterFromGitHub(
    new UpdateCurrentEntryMasterFromGitHubRequest()
        .withNamespaceName("namespace1")
        .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'}),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.updateCurrentEntryMasterFromGitHub(
        new Gs2Dictionary.UpdateCurrentEntryMasterFromGitHubRequest()
            .withNamespaceName('namespace1')
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new dictionary.Gs2DictionaryRestClient(session)

try:
    result = client.update_current_entry_master_from_git_hub(
        new dictionary.UpdateCurrentEntryMasterFromGitHubRequest()
            .with_namespace_name(self.hash1)
            .with_checkout_setting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('dictionary')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

現在有効なエントリー設定を更新します

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
checkoutSetting GitHubCheckoutSetting GitHubからマスターデータをチェックアウトしてくる設定

Result

説明
item CurrentEntryMaster 更新した現在有効なエントリー設定