GS2-Dictionary SDK API リファレンス

モデル

Namespace

ネームスペース

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

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

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字ネームスペースGRN
namestring~ 128文字ネームスペース名
descriptionstring~ 1024文字説明文
entryScriptScriptSettingエントリー登録時に実行するスクリプト
duplicateEntryScriptstring~ 1024文字登録済みのエントリーを再度登録しようとした時に実行するスクリプト
logSettingLogSettingログの出力設定
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

EntryModel

エントリーモデル

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

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

EntryModelMaster

エントリーモデル

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

有効化条件必須デフォルト値の制限説明
entryModelIdstring~ 1024文字エントリーモデルマスターGRN
namestring~ 128文字エントリーモデル名
descriptionstring~ 1024文字説明文
metadatastring~ 2048文字メタデータ
createdAtlong現在時刻作成日時 (UNIX時間 単位:ミリ秒)
updatedAtlong現在時刻最終更新日時 (UNIX時間 単位:ミリ秒)
revisionlong0~ 9223372036854775805リビジョン

Entry

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

有効化条件必須デフォルト値の制限説明
entryIdstring~ 1024文字エントリーGRN
userIdstring~ 128文字ユーザーID
namestring~ 128文字エントリー名
acquiredAtlong現在時刻入手日時 (UNIX時間 単位:ミリ秒)

CurrentEntryMaster

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

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

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

有効化条件必須デフォルト値の制限説明
namespaceIdstring~ 1024文字現在有効なエントリー設定GRN
settingsstring~ 5242880文字マスターデータ

Config

コンフィグ設定

トランザクションの変数に適用する設定値

有効化条件必須デフォルト値の制限説明
keystring~ 64文字名前
valuestring~ 51200文字

GitHubCheckoutSetting

GitHubからマスターデータをチェックアウトする設定

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

referenceType に指定する列挙型の定義

定義説明
commit_hashコミットハッシュ
branchブランチ
tagタグ

ScriptSetting

スクリプト設定

GS2 ではマイクロサービスのイベントに関連づけて、カスタムスクリプトを実行することができます。
このモデルは、スクリプトの実行をトリガーするための設定を保持します。

スクリプトの実行方式は大きく2種類あり、それは「同期実行」と「非同期実行」です。
同期実行は、スクリプトの実行が完了するまで処理がブロックされます。
かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることができます。

一方、非同期実行は、スクリプトの実行が完了するまで処理がブロックされません。
かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることはできません。
しかし、非同期実行は、スクリプトの実行が完了するまで処理がブロックされないため、APIの応答に影響を与えないため、原則非同期実行を使用することをおすすめします。

非同期実行には実行方式が2種類あり、GS2-Script と Amazon EventBridge があります。
Amazon EventBridge を使用することで、Lua 以外の言語で処理を記述することができます。

有効化条件必須デフォルト値の制限説明
triggerScriptIdstring~ 1024文字スクリプトGRN
doneTriggerTargetTypeenum {
    “none”,
    “gs2_script”,
    “aws”
}
“none”~ 128文字完了通知の通知先
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024文字スクリプトGRN
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024文字ネームスペースGRN

doneTriggerTargetType に指定する列挙型の定義

定義説明
noneなし
gs2_scriptGS2-Script
awsAmazon EventBridge

LogSetting

ログの書き出し設定

ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用されるログ名前空間の識別子(Namespace ID)を保持します。
ログ名前空間IDは、ログデータを集約し、保存する対象の GS2-Log の名前空間を指定します。
この設定を通じて、この名前空間以下のAPIリクエスト・レスポンスログデータが対象の GS2-Log へ出力されるようになります。
GS2-Log にはリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。

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

メソッド

describeNamespaces

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

Request

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

Result

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

実装例

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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.Gs2Dictionary.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Dictionary.Request.DescribeNamespacesRequest()
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

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

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

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('dictionary')

api_result_handler = client.describe_namespaces_async({
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

createNamespace

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

Request

有効化条件必須デフォルト値の制限説明
namestring~ 128文字ネームスペース名
descriptionstring~ 1024文字説明文
entryScriptScriptSettingエントリー登録時に実行するスクリプト
duplicateEntryScriptstring~ 1024文字登録済みのエントリーを再度登録しようとした時に実行するスクリプト
logSettingLogSettingログの出力設定

Result

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

実装例

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.Gs2Dictionary.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Dictionary.Request.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(null)
            .withEntryScript(null)
            .withDuplicateEntryScript(null)
            .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

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

try:
    result = client.create_namespace(
        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:
    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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.create_namespace_async({
    name="namespace1",
    description=nil,
    entryScript=nil,
    duplicateEntryScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

getNamespaceStatus

ネームスペースの状態を取得

Request

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

Result

説明
statusstring

実装例

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.Gs2Dictionary.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Dictionary.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as 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

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

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

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

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

result = api_result.result
status = result.status;
client = gs2('dictionary')

api_result_handler = client.get_namespace_status_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
status = result.status;

getNamespace

ネームスペースを取得

Request

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

Result

説明
itemNamespaceネームスペース

実装例

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.Gs2Dictionary.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Dictionary.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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

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

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

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

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

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.get_namespace_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

updateNamespace

ネームスペースを更新

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
descriptionstring~ 1024文字説明文
entryScriptScriptSettingエントリー登録時に実行するスクリプト
duplicateEntryScriptstring~ 1024文字登録済みのエントリーを再度登録しようとした時に実行するスクリプト
logSettingLogSettingログの出力設定

Result

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

実装例

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.Gs2Dictionary.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Dictionary.Request.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(null)
            .withDuplicateEntryScript(null)
            .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

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

try:
    result = client.update_namespace(
        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:
    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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace1",
    description="description1",
    entryScript=nil,
    duplicateEntryScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

deleteNamespace

ネームスペースを削除

Request

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

Result

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

実装例

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.Gs2Dictionary.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Dictionary.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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

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

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

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

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

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.delete_namespace_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

dumpUserDataByUserId

指定したユーザーIDに紐づくデータのダンプを取得

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明

実装例

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.DumpUserDataByUserId(
    &dictionary.DumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
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\DumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->dumpUserDataByUserId(
        (new DumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} 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.DumpUserDataByUserIdRequest;
import io.gs2.dictionary.result.DumpUserDataByUserIdResult;

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

try {
    DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
        new DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} 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.DumpUserDataByUserIdRequest;
using Gs2.Gs2Dictionary.Result.DumpUserDataByUserIdResult;

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.Gs2Dictionary.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Dictionary.Request.DumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    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.dumpUserDataByUserId(
        new Gs2Dictionary.DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.dump_user_data_by_user_id(
        dictionary.DumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
client = gs2('dictionary')

api_result_handler = client.dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result

checkDumpUserDataByUserId

指定したユーザーIDに紐づくデータのダンプが完了しているか確認

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
urlstring出力データのURL

実装例

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.CheckDumpUserDataByUserId(
    &dictionary.CheckDumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
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\CheckDumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkDumpUserDataByUserId(
        (new CheckDumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} 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.CheckDumpUserDataByUserIdRequest;
import io.gs2.dictionary.result.CheckDumpUserDataByUserIdResult;

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

try {
    CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
        new CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} 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.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Dictionary.Result.CheckDumpUserDataByUserIdResult;

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.Gs2Dictionary.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Dictionary.Request.CheckDumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
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.checkDumpUserDataByUserId(
        new Gs2Dictionary.CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.check_dump_user_data_by_user_id(
        dictionary.CheckDumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.check_dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
url = result.url;
client = gs2('dictionary')

api_result_handler = client.check_dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
url = result.url;

cleanUserDataByUserId

指定したユーザーIDに紐づくデータのダンプを取得

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明

実装例

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.CleanUserDataByUserId(
    &dictionary.CleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
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\CleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->cleanUserDataByUserId(
        (new CleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} 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.CleanUserDataByUserIdRequest;
import io.gs2.dictionary.result.CleanUserDataByUserIdResult;

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

try {
    CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
        new CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} 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.CleanUserDataByUserIdRequest;
using Gs2.Gs2Dictionary.Result.CleanUserDataByUserIdResult;

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.Gs2Dictionary.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Dictionary.Request.CleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    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.cleanUserDataByUserId(
        new Gs2Dictionary.CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.clean_user_data_by_user_id(
        dictionary.CleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
client = gs2('dictionary')

api_result_handler = client.clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result

checkCleanUserDataByUserId

指定したユーザーIDに紐づくデータのダンプが完了しているか確認

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明

実装例

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.CheckCleanUserDataByUserId(
    &dictionary.CheckCleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
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\CheckCleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkCleanUserDataByUserId(
        (new CheckCleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} 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.CheckCleanUserDataByUserIdRequest;
import io.gs2.dictionary.result.CheckCleanUserDataByUserIdResult;

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

try {
    CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
        new CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} 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.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Dictionary.Result.CheckCleanUserDataByUserIdResult;

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.Gs2Dictionary.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Dictionary.Request.CheckCleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    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.checkCleanUserDataByUserId(
        new Gs2Dictionary.CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.check_clean_user_data_by_user_id(
        dictionary.CheckCleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.check_clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
client = gs2('dictionary')

api_result_handler = client.check_clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result

prepareImportUserDataByUserId

指定したユーザーIDに紐づくデータのインポートを開始

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
uploadTokenstringアップロード後に結果を反映する際に使用するトークン
uploadUrlstringユーザーデータアップロード処理の実行に使用するURL

実装例

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.PrepareImportUserDataByUserId(
    &dictionary.PrepareImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
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\PrepareImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareImportUserDataByUserId(
        (new PrepareImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} 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.PrepareImportUserDataByUserIdRequest;
import io.gs2.dictionary.result.PrepareImportUserDataByUserIdResult;

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

try {
    PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
        new PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} 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.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Dictionary.Result.PrepareImportUserDataByUserIdResult;

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.Gs2Dictionary.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Dictionary.Request.PrepareImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
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.prepareImportUserDataByUserId(
        new Gs2Dictionary.PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.prepare_import_user_data_by_user_id(
        dictionary.PrepareImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.prepare_import_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('dictionary')

api_result_handler = client.prepare_import_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

importUserDataByUserId

指定したユーザーIDに紐づくデータのインポートを開始

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
uploadTokenstring~ 1024文字アップロード準備で受け取ったトークン
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明

実装例

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.ImportUserDataByUserId(
    &dictionary.ImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
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\ImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->importUserDataByUserId(
        (new ImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
} 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.ImportUserDataByUserIdRequest;
import io.gs2.dictionary.result.ImportUserDataByUserIdResult;

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

try {
    ImportUserDataByUserIdResult result = client.importUserDataByUserId(
        new ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} 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.ImportUserDataByUserIdRequest;
using Gs2.Gs2Dictionary.Result.ImportUserDataByUserIdResult;

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.Gs2Dictionary.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2Dictionary.Request.ImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    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.importUserDataByUserId(
        new Gs2Dictionary.ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.import_user_data_by_user_id(
        dictionary.ImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
client = gs2('dictionary')

api_result_handler = client.import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result

checkImportUserDataByUserId

指定したユーザーIDに紐づくデータのインポートが完了しているか確認

Request

有効化条件必須デフォルト値の制限説明
userIdstring~ 128文字ユーザーID
uploadTokenstring~ 1024文字アップロード準備で受け取ったトークン
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
urlstring出力ログのURL

実装例

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.CheckImportUserDataByUserId(
    &dictionary.CheckImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
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\CheckImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkImportUserDataByUserId(
        (new CheckImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} 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.CheckImportUserDataByUserIdRequest;
import io.gs2.dictionary.result.CheckImportUserDataByUserIdResult;

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

try {
    CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
        new CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} 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.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Dictionary.Result.CheckImportUserDataByUserIdResult;

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.Gs2Dictionary.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2Dictionary.Request.CheckImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
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.checkImportUserDataByUserId(
        new Gs2Dictionary.CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.check_import_user_data_by_user_id(
        dictionary.CheckImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.check_import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
url = result.url;
client = gs2('dictionary')

api_result_handler = client.check_import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
url = result.url;

describeEntryModels

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

Request

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

Result

説明
itemsList<EntryModel>エントリーモデルのリスト

実装例

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.Gs2Dictionary.Result.DescribeEntryModelsResult> asyncResult = null;
yield return client.DescribeEntryModels(
    new Gs2.Gs2Dictionary.Request.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

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

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

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

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

result = api_result.result
items = result.items;
client = gs2('dictionary')

api_result_handler = client.describe_entry_models_async({
    namespaceName="namespace2",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;

getEntryModel

エントリーモデルを取得

Request

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

Result

説明
itemEntryModelエントリーモデル

実装例

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.Gs2Dictionary.Result.GetEntryModelResult> asyncResult = null;
yield return client.GetEntryModel(
    new Gs2.Gs2Dictionary.Request.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

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

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

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

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

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.get_entry_model_async({
    namespaceName="namespace2",
    entryName="entry-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

describeEntryModelMasters

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

Request

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

Result

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

実装例

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.Gs2Dictionary.Result.DescribeEntryModelMastersResult> asyncResult = null;
yield return client.DescribeEntryModelMasters(
    new Gs2.Gs2Dictionary.Request.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(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.describe_entry_model_masters(
        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:
    exit(1)
client = gs2('dictionary')

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

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('dictionary')

api_result_handler = client.describe_entry_model_masters_async({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

createEntryModelMaster

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

Request

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

Result

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

実装例

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.Gs2Dictionary.Result.CreateEntryModelMasterResult> asyncResult = null;
yield return client.CreateEntryModelMaster(
    new Gs2.Gs2Dictionary.Request.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(null)
            .withMetadata("MONSTER-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.create_entry_model_master(
        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:
    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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.create_entry_model_master_async({
    namespaceName="namespace1",
    name="monster-0001",
    description=nil,
    metadata="MONSTER-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

getEntryModelMaster

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

Request

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

Result

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

実装例

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: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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(null)
    );
    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.Gs2Dictionary.Result.GetEntryModelMasterResult> asyncResult = null;
yield return client.GetEntryModelMaster(
    new Gs2.Gs2Dictionary.Request.GetEntryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithEntryName(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.get_entry_model_master(
        dictionary.GetEntryModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_entry_name(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.get_entry_model_master({
    namespaceName="namespace1",
    entryName=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.get_entry_model_master_async({
    namespaceName="namespace1",
    entryName=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

updateEntryModelMaster

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

Request

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

Result

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

実装例

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: nil,
        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(null)
            ->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(null)
            .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.Gs2Dictionary.Result.UpdateEntryModelMasterResult> asyncResult = null;
yield return client.UpdateEntryModelMaster(
    new Gs2.Gs2Dictionary.Request.UpdateEntryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithEntryName(null)
        .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(null)
            .withDescription("description1")
            .withMetadata("MONSTER-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

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

api_result = client.update_entry_model_master({
    namespaceName="namespace1",
    entryName=nil,
    description="description1",
    metadata="MONSTER-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.update_entry_model_master_async({
    namespaceName="namespace1",
    entryName=nil,
    description="description1",
    metadata="MONSTER-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

deleteEntryModelMaster

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

Request

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

Result

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

実装例

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: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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(null)
    );
    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.Gs2Dictionary.Result.DeleteEntryModelMasterResult> asyncResult = null;
yield return client.DeleteEntryModelMaster(
    new Gs2.Gs2Dictionary.Request.DeleteEntryModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithEntryName(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.delete_entry_model_master(
        dictionary.DeleteEntryModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_entry_name(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.delete_entry_model_master({
    namespaceName="namespace1",
    entryName=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.delete_entry_model_master_async({
    namespaceName="namespace1",
    entryName=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

describeEntries

エントリーの一覧を取得

Request

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

Result

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

実装例

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("accessToken-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("accessToken-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.Gs2Dictionary.Result.DescribeEntriesResult> asyncResult = null;
yield return client.DescribeEntries(
    new Gs2.Gs2Dictionary.Request.DescribeEntriesRequest()
        .WithNamespaceName("namespace2")
        .WithAccessToken("accessToken-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("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.describe_entries(
        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:
    exit(1)
client = gs2('dictionary')

api_result = client.describe_entries({
    namespaceName="namespace2",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('dictionary')

api_result_handler = client.describe_entries_async({
    namespaceName="namespace2",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

describeEntriesByUserId

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

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
pageTokenstring~ 1024文字データの取得を開始する位置を指定するトークン
limitint301 ~ 10000データの取得件数
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

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

実装例

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,
        TimeOffsetToken: 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)
            ->withTimeOffsetToken(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)
            .withTimeOffsetToken(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.Gs2Dictionary.Result.DescribeEntriesByUserIdResult> asyncResult = null;
yield return client.DescribeEntriesByUserId(
    new Gs2.Gs2Dictionary.Request.DescribeEntriesByUserIdRequest()
        .WithNamespaceName("namespace2")
        .WithUserId("user-0001")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(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(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

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

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

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('dictionary')

api_result_handler = client.describe_entries_by_user_id_async({
    namespaceName="namespace2",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

addEntriesByUserId

ユーザIDを指定してエントリーを追加

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
entryModelNamesList<string>[]~ 100 itemsエントリー名のリスト
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemsList<Entry>登録したエントリーのリスト

実装例

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{
            pointy.String("entry-0001"),
            pointy.String("entry-0002"),
            pointy.String("entry-0003"),
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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",
            ])
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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"
            ))
            .withTimeOffsetToken(null)
    );
    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.Gs2Dictionary.Result.AddEntriesByUserIdResult> asyncResult = null;
yield return client.AddEntriesByUserId(
    new Gs2.Gs2Dictionary.Request.AddEntriesByUserIdRequest()
        .WithNamespaceName("namespace2")
        .WithUserId("user-0001")
        .WithEntryModelNames(new string[] {
            "entry-0001",
            "entry-0002",
            "entry-0003",
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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",
            ])
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.add_entries_by_user_id(
        dictionary.AddEntriesByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_entry_model_names([
                'entry-0001',
                'entry-0002',
                'entry-0003',
            ])
            .with_time_offset_token(None)
    )
    items = result.items
except core.Gs2Exception as e:
    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"
    },
    timeOffsetToken=nil,
})

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

result = api_result.result
items = result.items;
client = gs2('dictionary')

api_result_handler = client.add_entries_by_user_id_async({
    namespaceName="namespace2",
    userId="user-0001",
    entryModelNames={
        "entry-0001",
        "entry-0002",
        "entry-0003"
    },
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;

getEntry

エントリーを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字ユーザーID
entryModelNamestring~ 128文字エントリー名

Result

説明
itemEntryエントリー

実装例

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("accessToken-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("accessToken-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.Gs2Dictionary.Result.GetEntryResult> asyncResult = null;
yield return client.GetEntry(
    new Gs2.Gs2Dictionary.Request.GetEntryRequest()
        .WithNamespaceName("namespace2")
        .WithAccessToken("accessToken-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("accessToken-0001")
            .withEntryModelName("entry-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.get_entry(
        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:
    exit(1)
client = gs2('dictionary')

api_result = client.get_entry({
    namespaceName="namespace2",
    accessToken="accessToken-0001",
    entryModelName="entry-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.get_entry_async({
    namespaceName="namespace2",
    accessToken="accessToken-0001",
    entryModelName="entry-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

getEntryByUserId

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

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
entryModelNamestring~ 128文字エントリー名
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemEntryエントリー

実装例

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"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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")
            .withTimeOffsetToken(null)
    );
    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.Gs2Dictionary.Result.GetEntryByUserIdResult> asyncResult = null;
yield return client.GetEntryByUserId(
    new Gs2.Gs2Dictionary.Request.GetEntryByUserIdRequest()
        .WithNamespaceName("namespace2")
        .WithUserId("user-0001")
        .WithEntryModelName("entry-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

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

api_result = client.get_entry_by_user_id({
    namespaceName="namespace2",
    userId="user-0001",
    entryModelName="entry-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.get_entry_by_user_id_async({
    namespaceName="namespace2",
    userId="user-0001",
    entryModelName="entry-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

getEntryWithSignature

署名情報と共にエントリーを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字ユーザーID
entryModelNamestring~ 128文字エントリー名
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024文字暗号鍵GRN

Result

説明
itemEntryエントリー
bodystring署名対象のエントリー情報
signaturestring署名

実装例

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("accessToken-0001"),
        EntryModelName: pointy.String("entry-0001"),
        KeyId: pointy.String("key-0001"),
    }
)
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::key-0001)
    );
    $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("accessToken-0001")
            .withEntryModelName("entry-0001")
            .withKeyId("key-0001")
    );
    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.Gs2Dictionary.Result.GetEntryWithSignatureResult> asyncResult = null;
yield return client.GetEntryWithSignature(
    new Gs2.Gs2Dictionary.Request.GetEntryWithSignatureRequest()
        .WithNamespaceName("namespace2")
        .WithAccessToken("accessToken-0001")
        .WithEntryModelName("entry-0001")
        .WithKeyId("key-0001"),
    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("accessToken-0001")
            .withEntryModelName("entry-0001")
            .withKeyId("key-0001")
    );
    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

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

try:
    result = client.get_entry_with_signature(
        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:
    exit(1)
client = gs2('dictionary')

api_result = client.get_entry_with_signature({
    namespaceName="namespace2",
    accessToken="accessToken-0001",
    entryModelName="entry-0001",
    keyId="key-0001",
})

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

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;
client = gs2('dictionary')

api_result_handler = client.get_entry_with_signature_async({
    namespaceName="namespace2",
    accessToken="accessToken-0001",
    entryModelName="entry-0001",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

getEntryWithSignatureByUserId

ユーザIDを指定して署名情報と共にエントリーを取得

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
entryModelNamestring~ 128文字エントリー名
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024文字暗号鍵GRN
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemEntryエントリー
bodystring署名対象のエントリー情報
signaturestring署名

実装例

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("key-0001"),
        TimeOffsetToken: nil,
    }
)
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::key-0001)
            ->withTimeOffsetToken(null)
    );
    $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("key-0001")
            .withTimeOffsetToken(null)
    );
    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.Gs2Dictionary.Result.GetEntryWithSignatureByUserIdResult> asyncResult = null;
yield return client.GetEntryWithSignatureByUserId(
    new Gs2.Gs2Dictionary.Request.GetEntryWithSignatureByUserIdRequest()
        .WithNamespaceName("namespace2")
        .WithUserId("user-0001")
        .WithEntryModelName("entry-0001")
        .WithKeyId("key-0001")
        .WithTimeOffsetToken(null),
    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("key-0001")
            .withTimeOffsetToken(null)
    );
    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

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

try:
    result = client.get_entry_with_signature_by_user_id(
        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)
            .with_time_offset_token(None)
    )
    item = result.item
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.get_entry_with_signature_by_user_id({
    namespaceName="namespace2",
    userId="user-0001",
    entryModelName="entry-0001",
    keyId="key-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;
client = gs2('dictionary')

api_result_handler = client.get_entry_with_signature_by_user_id_async({
    namespaceName="namespace2",
    userId="user-0001",
    entryModelName="entry-0001",
    keyId="key-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

resetByUserId

エントリーをリセット

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明

実装例

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"),
        TimeOffsetToken: nil,
    }
)
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")
            ->withTimeOffsetToken(null)
    );
} 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")
            .withTimeOffsetToken(null)
    );
} 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.Gs2Dictionary.Result.ResetByUserIdResult> asyncResult = null;
yield return client.ResetByUserId(
    new Gs2.Gs2Dictionary.Request.ResetByUserIdRequest()
        .WithNamespaceName("namespace2")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    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")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

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

api_result = client.reset_by_user_id({
    namespaceName="namespace2",
    userId="user-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
client = gs2('dictionary')

api_result_handler = client.reset_by_user_id_async({
    namespaceName="namespace2",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result

verifyEntry

エントリーを検証

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字ユーザーID
entryModelNamestring~ 128文字エントリー名
verifyTypeenum {
    “havent”,
    “have”
}
~ 128文字検証の種類

verifyType に指定する列挙型の定義

定義説明
havent指定したエントリーを保有していないこと
have指定したエントリーを保有していること

Result

説明

実装例

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.VerifyEntry(
    &dictionary.VerifyEntryRequest {
        NamespaceName: pointy.String("namespace2"),
        AccessToken: pointy.String("accessToken-0001"),
        EntryModelName: pointy.String("entry-0001"),
        VerifyType: pointy.String("havent"),
    }
)
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\VerifyEntryRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyEntry(
        (new VerifyEntryRequest())
            ->withNamespaceName(self::namespace2)
            ->withAccessToken(self::$accessToken0001)
            ->withEntryModelName("entry-0001")
            ->withVerifyType("havent")
    );
} 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.VerifyEntryRequest;
import io.gs2.dictionary.result.VerifyEntryResult;

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

try {
    VerifyEntryResult result = client.verifyEntry(
        new VerifyEntryRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("accessToken-0001")
            .withEntryModelName("entry-0001")
            .withVerifyType("havent")
    );
} 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.VerifyEntryRequest;
using Gs2.Gs2Dictionary.Result.VerifyEntryResult;

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.Gs2Dictionary.Result.VerifyEntryResult> asyncResult = null;
yield return client.VerifyEntry(
    new Gs2.Gs2Dictionary.Request.VerifyEntryRequest()
        .WithNamespaceName("namespace2")
        .WithAccessToken("accessToken-0001")
        .WithEntryModelName("entry-0001")
        .WithVerifyType("havent"),
    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.verifyEntry(
        new Gs2Dictionary.VerifyEntryRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("accessToken-0001")
            .withEntryModelName("entry-0001")
            .withVerifyType("havent")
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.verify_entry(
        dictionary.VerifyEntryRequest()
            .with_namespace_name(self.hash2)
            .with_access_token(self.access_token_0001)
            .with_entry_model_name('entry-0001')
            .with_verify_type('havent')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.verify_entry({
    namespaceName="namespace2",
    accessToken="accessToken-0001",
    entryModelName="entry-0001",
    verifyType="havent",
})

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

result = api_result.result
client = gs2('dictionary')

api_result_handler = client.verify_entry_async({
    namespaceName="namespace2",
    accessToken="accessToken-0001",
    entryModelName="entry-0001",
    verifyType="havent",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result

verifyEntryByUserId

ユーザーIDを指定してエントリーを検証

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
entryModelNamestring~ 128文字エントリー名
verifyTypeenum {
    “havent”,
    “have”
}
~ 128文字検証の種類
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

verifyType に指定する列挙型の定義

定義説明
havent指定したエントリーを保有していないこと
have指定したエントリーを保有していること

Result

説明

実装例

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.VerifyEntryByUserId(
    &dictionary.VerifyEntryByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        EntryModelName: pointy.String("entry-0001"),
        VerifyType: pointy.String("havent"),
        TimeOffsetToken: nil,
    }
)
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\VerifyEntryByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyEntryByUserId(
        (new VerifyEntryByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withEntryModelName("entry-0001")
            ->withVerifyType("havent")
            ->withTimeOffsetToken(null)
    );
} 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.VerifyEntryByUserIdRequest;
import io.gs2.dictionary.result.VerifyEntryByUserIdResult;

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

try {
    VerifyEntryByUserIdResult result = client.verifyEntryByUserId(
        new VerifyEntryByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withEntryModelName("entry-0001")
            .withVerifyType("havent")
            .withTimeOffsetToken(null)
    );
} 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.VerifyEntryByUserIdRequest;
using Gs2.Gs2Dictionary.Result.VerifyEntryByUserIdResult;

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.Gs2Dictionary.Result.VerifyEntryByUserIdResult> asyncResult = null;
yield return client.VerifyEntryByUserId(
    new Gs2.Gs2Dictionary.Request.VerifyEntryByUserIdRequest()
        .WithNamespaceName("namespace2")
        .WithUserId("user-0001")
        .WithEntryModelName("entry-0001")
        .WithVerifyType("havent")
        .WithTimeOffsetToken(null),
    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.verifyEntryByUserId(
        new Gs2Dictionary.VerifyEntryByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withEntryModelName("entry-0001")
            .withVerifyType("havent")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.verify_entry_by_user_id(
        dictionary.VerifyEntryByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_entry_model_name('entry-0001')
            .with_verify_type('havent')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.verify_entry_by_user_id({
    namespaceName="namespace2",
    userId="user-0001",
    entryModelName="entry-0001",
    verifyType="havent",
    timeOffsetToken=nil,
})

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

result = api_result.result
client = gs2('dictionary')

api_result_handler = client.verify_entry_by_user_id_async({
    namespaceName="namespace2",
    userId="user-0001",
    entryModelName="entry-0001",
    verifyType="havent",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result

deleteEntries

エントリーを削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字ユーザーID
entryModelNamesList<string>[]~ 100 itemsエントリー名のリスト

Result

説明
itemsList<Entry>削除したエントリーのリスト

実装例

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.DeleteEntries(
    &dictionary.DeleteEntriesRequest {
        NamespaceName: pointy.String("namespace2"),
        AccessToken: pointy.String("accessToken-0001"),
        EntryModelNames: []*string{
            pointy.String("entry-0001"),
            pointy.String("entry-0002"),
            pointy.String("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\DeleteEntriesRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteEntries(
        (new DeleteEntriesRequest())
            ->withNamespaceName(self::namespace2)
            ->withAccessToken(self::$accessToken0001)
            ->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.DeleteEntriesRequest;
import io.gs2.dictionary.result.DeleteEntriesResult;

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

try {
    DeleteEntriesResult result = client.deleteEntries(
        new DeleteEntriesRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("accessToken-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.DeleteEntriesRequest;
using Gs2.Gs2Dictionary.Result.DeleteEntriesResult;

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.Gs2Dictionary.Result.DeleteEntriesResult> asyncResult = null;
yield return client.DeleteEntries(
    new Gs2.Gs2Dictionary.Request.DeleteEntriesRequest()
        .WithNamespaceName("namespace2")
        .WithAccessToken("accessToken-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.deleteEntries(
        new Gs2Dictionary.DeleteEntriesRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("accessToken-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

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

try:
    result = client.delete_entries(
        dictionary.DeleteEntriesRequest()
            .with_namespace_name(self.hash2)
            .with_access_token(self.access_token_0001)
            .with_entry_model_names([
                'entry-0001',
                'entry-0002',
                'entry-0003',
            ])
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.delete_entries({
    namespaceName="namespace2",
    accessToken="accessToken-0001",
    entryModelNames={
        "entry-0001",
        "entry-0002",
        "entry-0003"
    },
})

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

result = api_result.result
items = result.items;
client = gs2('dictionary')

api_result_handler = client.delete_entries_async({
    namespaceName="namespace2",
    accessToken="accessToken-0001",
    entryModelNames={
        "entry-0001",
        "entry-0002",
        "entry-0003"
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;

deleteEntriesByUserId

ユーザーIDを指定してエントリーを削除

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
userIdstring~ 128文字ユーザーID
entryModelNamesList<string>[]~ 100 itemsエントリー名のリスト
timeOffsetTokenstring~ 1024文字タイムオフセットトークン

Result

説明
itemsList<Entry>削除したエントリーのリスト

実装例

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.DeleteEntriesByUserId(
    &dictionary.DeleteEntriesByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        EntryModelNames: []*string{
            pointy.String("entry-0001"),
            pointy.String("entry-0002"),
            pointy.String("entry-0003"),
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\DeleteEntriesByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteEntriesByUserId(
        (new DeleteEntriesByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withEntryModelNames([
                "entry-0001",
                "entry-0002",
                "entry-0003",
            ])
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.DeleteEntriesByUserIdRequest;
import io.gs2.dictionary.result.DeleteEntriesByUserIdResult;

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

try {
    DeleteEntriesByUserIdResult result = client.deleteEntriesByUserId(
        new DeleteEntriesByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withEntryModelNames(Arrays.asList(
                "entry-0001",
                "entry-0002",
                "entry-0003"
            ))
            .withTimeOffsetToken(null)
    );
    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.DeleteEntriesByUserIdRequest;
using Gs2.Gs2Dictionary.Result.DeleteEntriesByUserIdResult;

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.Gs2Dictionary.Result.DeleteEntriesByUserIdResult> asyncResult = null;
yield return client.DeleteEntriesByUserId(
    new Gs2.Gs2Dictionary.Request.DeleteEntriesByUserIdRequest()
        .WithNamespaceName("namespace2")
        .WithUserId("user-0001")
        .WithEntryModelNames(new string[] {
            "entry-0001",
            "entry-0002",
            "entry-0003",
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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.deleteEntriesByUserId(
        new Gs2Dictionary.DeleteEntriesByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withEntryModelNames([
                "entry-0001",
                "entry-0002",
                "entry-0003",
            ])
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.delete_entries_by_user_id(
        dictionary.DeleteEntriesByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_entry_model_names([
                'entry-0001',
                'entry-0002',
                'entry-0003',
            ])
            .with_time_offset_token(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.delete_entries_by_user_id({
    namespaceName="namespace2",
    userId="user-0001",
    entryModelNames={
        "entry-0001",
        "entry-0002",
        "entry-0003"
    },
    timeOffsetToken=nil,
})

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

result = api_result.result
items = result.items;
client = gs2('dictionary')

api_result_handler = client.delete_entries_by_user_id_async({
    namespaceName="namespace2",
    userId="user-0001",
    entryModelNames={
        "entry-0001",
        "entry-0002",
        "entry-0003"
    },
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;

addEntriesByStampSheet

入手アクションとしてエントリーの追加を実行

Request

有効化条件必須デフォルト値の制限説明
stampSheetstring~ 5242880文字トランザクション
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
itemsList<Entry>登録したエントリーのリスト

実装例

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("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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::key-0001)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("key-0001")
    );
    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.Gs2Dictionary.Result.AddEntriesByStampSheetResult> asyncResult = null;
yield return client.AddEntriesByStampSheet(
    new Gs2.Gs2Dictionary.Request.AddEntriesByStampSheetRequest()
        .WithStampSheet("stampSheet")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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("key-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

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

api_result = client.add_entries_by_stamp_sheet({
    stampSheet="stampSheet",
    keyId="key-0001",
})

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

result = api_result.result
items = result.items;
client = gs2('dictionary')

api_result_handler = client.add_entries_by_stamp_sheet_async({
    stampSheet="stampSheet",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;

deleteEntriesByStampTask

消費アクションとしてエントリーの削除を実行

Request

有効化条件必須デフォルト値の制限説明
stampTaskstring~ 5242880文字消費アクション
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
itemsList<Entry>削除したエントリーのリスト
newContextStackstring消費アクションの実行結果を記録したコンテキスト

実装例

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.DeleteEntriesByStampTask(
    &dictionary.DeleteEntriesByStampTaskRequest {
        StampTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
newContextStack := result.NewContextStack
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\DeleteEntriesByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteEntriesByStampTask(
        (new DeleteEntriesByStampTaskRequest())
            ->withStampTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $items = $result->getItems();
    $newContextStack = $result->getNewContextStack();
} 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.DeleteEntriesByStampTaskRequest;
import io.gs2.dictionary.result.DeleteEntriesByStampTaskResult;

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

try {
    DeleteEntriesByStampTaskResult result = client.deleteEntriesByStampTask(
        new DeleteEntriesByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    List<Entry> items = result.getItems();
    String newContextStack = result.getNewContextStack();
} 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.DeleteEntriesByStampTaskRequest;
using Gs2.Gs2Dictionary.Result.DeleteEntriesByStampTaskResult;

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.Gs2Dictionary.Result.DeleteEntriesByStampTaskResult> asyncResult = null;
yield return client.DeleteEntriesByStampTask(
    new Gs2.Gs2Dictionary.Request.DeleteEntriesByStampTaskRequest()
        .WithStampTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var newContextStack = result.NewContextStack;
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.deleteEntriesByStampTask(
        new Gs2Dictionary.DeleteEntriesByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    const items = result.getItems();
    const newContextStack = result.getNewContextStack();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.delete_entries_by_stamp_task(
        dictionary.DeleteEntriesByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    items = result.items
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.delete_entries_by_stamp_task({
    stampTask="stampTask",
    keyId="key-0001",
})

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

result = api_result.result
items = result.items;
newContextStack = result.newContextStack;
client = gs2('dictionary')

api_result_handler = client.delete_entries_by_stamp_task_async({
    stampTask="stampTask",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
items = result.items;
newContextStack = result.newContextStack;

verifyEntryByStampTask

検証アクションとしてエントリーの検証を実行

Request

有効化条件必須デフォルト値の制限説明
stampTaskstring~ 5242880文字検証アクション
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
newContextStackstring検証アクションの実行結果を記録したコンテキスト

実装例

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.VerifyEntryByStampTask(
    &dictionary.VerifyEntryByStampTaskRequest {
        StampTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
newContextStack := result.NewContextStack
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\VerifyEntryByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->verifyEntryByStampTask(
        (new VerifyEntryByStampTaskRequest())
            ->withStampTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $newContextStack = $result->getNewContextStack();
} 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.VerifyEntryByStampTaskRequest;
import io.gs2.dictionary.result.VerifyEntryByStampTaskResult;

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

try {
    VerifyEntryByStampTaskResult result = client.verifyEntryByStampTask(
        new VerifyEntryByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    String newContextStack = result.getNewContextStack();
} 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.VerifyEntryByStampTaskRequest;
using Gs2.Gs2Dictionary.Result.VerifyEntryByStampTaskResult;

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.Gs2Dictionary.Result.VerifyEntryByStampTaskResult> asyncResult = null;
yield return client.VerifyEntryByStampTask(
    new Gs2.Gs2Dictionary.Request.VerifyEntryByStampTaskRequest()
        .WithStampTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.verifyEntryByStampTask(
        new Gs2Dictionary.VerifyEntryByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    const newContextStack = result.getNewContextStack();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.verify_entry_by_stamp_task(
        dictionary.VerifyEntryByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.verify_entry_by_stamp_task({
    stampTask="stampTask",
    keyId="key-0001",
})

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

result = api_result.result
newContextStack = result.newContextStack;
client = gs2('dictionary')

api_result_handler = client.verify_entry_by_stamp_task_async({
    stampTask="stampTask",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
newContextStack = result.newContextStack;

exportMaster

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

Request

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

Result

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

実装例

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.Gs2Dictionary.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Dictionary.Request.ExportMasterRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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

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

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

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

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

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.export_master_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

getCurrentEntryMaster

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

Request

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

Result

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

実装例

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.Gs2Dictionary.Result.GetCurrentEntryMasterResult> asyncResult = null;
yield return client.GetCurrentEntryMaster(
    new Gs2.Gs2Dictionary.Request.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

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

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

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

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

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.get_current_entry_master_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

updateCurrentEntryMaster

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

Request

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

Result

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

実装例

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("{\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 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("{\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->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.Gs2Dictionary.Result.UpdateCurrentEntryMasterResult> asyncResult = null;
yield return client.UpdateCurrentEntryMaster(
    new Gs2.Gs2Dictionary.Request.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("{\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}")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.update_current_entry_master(
        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:
    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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.update_current_entry_master_async({
    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}",
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

updateCurrentEntryMasterFromGitHub

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

Request

有効化条件必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
checkoutSettingGitHubCheckoutSettingGitHubからマスターデータをチェックアウトしてくる設定

Result

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

実装例

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: &dictionary.GitHubCheckoutSetting{
            ApiKeyId: pointy.String("$gitHubApiKey1.apiKeyId"),
            RepositoryName: pointy.String("gs2io/master-data"),
            SourcePath: pointy.String("path/to/file.json"),
            ReferenceType: pointy.String("branch"),
            BranchName: pointy.String("develop"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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((new GitHubCheckoutSetting())
                ->withApiKeyId(self::$gitHubApiKey1.apiKeyId)
                ->withRepositoryName("gs2io/master-data")
                ->withSourcePath("path/to/file.json")
                ->withReferenceType("branch")
                ->withBranchName("develop")
            )
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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(new GitHubCheckoutSetting()
                .withApiKeyId("$gitHubApiKey1.apiKeyId")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("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.Gs2Dictionary.Result.UpdateCurrentEntryMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentEntryMasterFromGitHub(
    new Gs2.Gs2Dictionary.Request.UpdateCurrentEntryMasterFromGitHubRequest()
        .WithNamespaceName("namespace1")
        .WithCheckoutSetting(new Gs2.Gs2Dictionary.Model.GitHubCheckoutSetting()
            .WithApiKeyId("$gitHubApiKey1.apiKeyId")
            .WithRepositoryName("gs2io/master-data")
            .WithSourcePath("path/to/file.json")
            .WithReferenceType("branch")
            .WithBranchName("develop")
        ),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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(new Gs2Dictionary.model.GitHubCheckoutSetting()
                .withApiKeyId("$gitHubApiKey1.apiKeyId")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import dictionary

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

try:
    result = client.update_current_entry_master_from_git_hub(
        dictionary.UpdateCurrentEntryMasterFromGitHubRequest()
            .with_namespace_name(self.hash1)
            .with_checkout_setting(dictionary.GitHubCheckoutSetting()
                .with_api_key_id(self.git_hub_api_key1.api_key_id)
                .with_repository_name('gs2io/master-data')
                .with_source_path('path/to/file.json')
                .with_reference_type('branch')
                .with_branch_name('develop')
            )
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.update_current_entry_master_from_git_hub({
    namespaceName="namespace1",
    checkoutSetting={
        api_key_id="$gitHubApiKey1.apiKeyId",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

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

result = api_result.result
item = result.item;
client = gs2('dictionary')

api_result_handler = client.update_current_entry_master_from_git_hub_async({
    namespaceName="namespace1",
    checkoutSetting={
        api_key_id="$gitHubApiKey1.apiKeyId",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;