GS2-Dictionary SDK API Reference

Specification of models and API references for GS2-Dictionary SDK for various programming languages

Model

Namespace

Namespace

A Namespace allows multiple independent instances of the same service within a single project by separating data spaces and usage contexts. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the namespace differs, the data is treated as a completely independent data space.

Therefore, you must create a namespace before you can start using each service.

Details
TypeConditionRequiredDefaultValue LimitsDescription
namespaceIdstring
*
~ 1024 charsNamespace GRN
* Set automatically by the server
namestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction Setting
Configuration for controlling how distributed transactions are executed when processing dictionary entry registration. Supports auto-run, atomic commit, and async processing options.
entryScriptScriptSettingScript setting to be executed when registering an entry
Script Trigger Reference - entry
duplicateEntryScriptstring~ 1024 charsScript GRN to run when an attempt is made to re-register an entry that has already been registered
Script Trigger Reference - duplicateEntry
logSettingLogSettingLog Output Settings
Configuration for outputting log data of dictionary operations to GS2-Log. By specifying a GS2-Log namespace, API request and response logs for entry registration, like operations, and other dictionary activities can be collected.
createdAtlong
*
NowDatetime of creation
Unix time, milliseconds
* Set automatically by the server
updatedAtlong
*
NowDatetime of last update
Unix time, milliseconds
* Set automatically by the server
revisionlong00 ~ 9223372036854775805Revision

TransactionSetting

Transaction Setting

Transaction Settings control how transactions are executed, their consistency, asynchronous processing, and conflict avoidance mechanisms. Combining features like AutoRun, AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, and asynchronous Acquire Actions via GS2-JobQueue enables robust transaction management tailored to game logic.

Details
TypeConditionRequiredDefaultValue LimitsDescription
enableAutoRunboolfalseWhether to automatically execute issued transactions on the server side
enableAtomicCommitbool{enableAutoRun} == truefalseWhether to commit the execution of transactions atomically
* Applicable only if enableAutoRun is true
transactionUseDistributorbool{enableAtomicCommit} == truefalseWhether to execute transactions asynchronously
* Applicable only if enableAtomicCommit is true
commitScriptResultInUseDistributorbool{transactionUseDistributor} == truefalseWhether to execute the commit processing of the script result asynchronously
* Applicable only if transactionUseDistributor is true
acquireActionUseJobQueuebool{enableAtomicCommit} == truefalseWhether to use GS2-JobQueue to execute the acquire action
* Applicable only if enableAtomicCommit is true
distributorNamespaceIdstring“grn:gs2:{region}:{ownerId}:distributor:default”~ 1024 charsGS2-Distributor Namespace GRN used to execute transactions
queueNamespaceIdstring“grn:gs2:{region}:{ownerId}:queue:default”~ 1024 charsGS2-JobQueue Namespace GRN used to execute transactions

ScriptSetting

Script Setting

In GS2, you can associate custom scripts with microservice events and execute them. This model holds the settings for triggering script execution.

There are two main ways to execute a script: synchronous execution and asynchronous execution. Synchronous execution blocks processing until the script has finished executing. Instead, you can use the script’s execution results to halt API execution or control the API’s response content.

In contrast, asynchronous execution does not block processing until the script has finished executing. However, because the script result cannot be used to stop the API execution or modify the API response, asynchronous execution does not affect the API response flow and is generally recommended.

There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge. By using Amazon EventBridge, you can write processing in languages other than Lua.

Details
TypeConditionRequiredDefaultValue LimitsDescription
triggerScriptIdstring~ 1024 charsGS2-Script script GRN executed synchronously when the API is executed
Must be specified in GRN format starting with “grn:gs2:”.
doneTriggerTargetTypeString Enum
enum {
  “none”,
  “gs2_script”,
  “aws”
}
“none”How to execute asynchronous scripts
Specifies the type of script to use for asynchronous execution.
You can choose from “Do not use asynchronous execution (none)”, “Use GS2-Script (gs2_script)”, and “Use Amazon EventBridge (aws)”.
DefinitionDescription
“none”None
“gs2_script”GS2-Script
“aws”Amazon EventBridge
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsGS2-Script script GRN for asynchronous execution
Must be specified in GRN format starting with “grn:gs2:”.
* Applicable only if doneTriggerTargetType is “gs2_script”
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsGS2-JobQueue namespace GRN to execute asynchronous execution scripts
If you want to execute asynchronous execution scripts via GS2-JobQueue instead of executing them directly, specify the GS2-JobQueue namespace GRN.
There are not many cases where GS2-JobQueue is required, so you generally do not need to specify it unless you have a specific reason.
* Applicable only if doneTriggerTargetType is “gs2_script”

LogSetting

Log Output Setting

Manages log output setting. This type holds the identifier of the log namespace used to output log data. The log namespace ID specifies the GS2-Log namespace to aggregate and store the log data. Through this setting, API request and response log data under this namespace will be output to the target GS2-Log. GS2-Log provides logs in real time, which can be used for system monitoring, analysis, debugging, etc.

Details
TypeConditionRequiredDefaultValue LimitsDescription
loggingNamespaceIdstring
~ 1024 charsGS2-Log namespace GRN to output logs
Must be specified in GRN format starting with “grn:gs2:”.

GitHubCheckoutSetting

Setup to check out master data from GitHub

Details
TypeConditionRequiredDefaultValue LimitsDescription
apiKeyIdstring
~ 1024 charsGitHub API Key GRN
repositoryNamestring
~ 1024 charsRepository Name
sourcePathstring
~ 1024 charsMaster data (JSON) file path
referenceTypeString Enum
enum {
  “commit_hash”,
  “branch”,
  “tag”
}
Source of code
DefinitionDescription
“commit_hash”Commit hash
“branch”Branch
“tag”Tag
commitHashstring{referenceType} == “commit_hash”
✓*
~ 1024 charsCommit hash
* Required if referenceType is “commit_hash”
branchNamestring{referenceType} == “branch”
✓*
~ 1024 charsBranch Name
* Required if referenceType is “branch”
tagNamestring{referenceType} == “tag”
✓*
~ 1024 charsTag Name
* Required if referenceType is “tag”

Entry

Entry acquired by game player

Represents a single dictionary entry that a game player has collected. Each entry corresponds to an EntryModel and records the acquisition timestamp. The possession state is binary—either the entry exists (collected) or it does not—with no concept of quantity.

Details
TypeConditionRequiredDefaultValue LimitsDescription
entryIdstring
*
~ 1024 charsEntry GRN
* Set automatically by the server
userIdstring~ 128 charsUser ID
namestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
acquiredAtlong
*
NowDate of acquisition
The timestamp when this entry was first collected by the game player. Automatically set to the current time at the moment of registration and cannot be modified afterwards.

Like

Entry registered as a favorite

Represents a dictionary entry that a game player has marked as a favorite (liked). Allows players to bookmark specific entries in the dictionary for quick access. Each like references an EntryModel by name and is unique per user—the same entry cannot be liked twice.

Details
TypeConditionRequiredDefaultValue LimitsDescription
likeIdstring
*
~ 1024 charsLike Entry GRN
* Set automatically by the server
userIdstring~ 128 charsUser ID
namestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).

EntryModel

Entry Model

An Entry Model is master data that defines what can be recorded in the Dictionary within GS2-Dictionary. Each Entry Model represents a type of entity recorded in the Dictionary, such as monsters, items, or avatar parts.

The possession state of an entry is managed as a binary state—recorded or not recorded—and there is no concept of quantity or stacking for a single Entry Model.

Details
TypeConditionRequiredDefaultValue LimitsDescription
entryModelIdstring
*
~ 1024 charsEntry Model GRN
* Set automatically by the server
namestring
~ 128 charsEntry Model name
metadatastring~ 2048 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.

Config

Configuration

A key-value pair applied to transaction variables during distributed transaction execution. Allows dynamic substitution of placeholder values in transaction parameters at runtime.

Details
TypeConditionRequiredDefaultValue LimitsDescription
keystring
~ 64 charsName
The variable name used as the placeholder key in transaction parameters. Must match the placeholder defined in the transaction template.
valuestring~ 51200 charsValue
The value to substitute for the placeholder key at transaction execution time. This value replaces the corresponding placeholder in the transaction parameters.

CurrentEntryMaster

Currently active Entry Model master data

This master data describes the definitions of Entry Models currently active within the namespace. GS2 uses JSON format files for managing master data. By uploading these files, the master data settings are updated on the server.

To create JSON files, GS2 provides a master data editor within the management console. Additionally, you can create tools better suited for game operations and export JSON files in the appropriate format.

Details
TypeConditionRequiredDefaultValue LimitsDescription
namespaceIdstring
*
~ 1024 charsNamespace GRN
* Set automatically by the server
settingsstring
~ 5242880 bytes (5MB)Master Data

EntryModelMaster

Entry Model Master

Entry Model Master is data used to edit and manage entry model within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as entry model actually referenced by the game.

An Entry Model is master data that defines what can be recorded in the Dictionary within GS2-Dictionary. Each Entry Model represents a type of entity recorded in the Dictionary, such as monsters, items, or avatar parts.

The possession state of an entry is managed as a binary state—recorded or not recorded—and there is no concept of quantity or stacking for a single Entry Model.

Details
TypeConditionRequiredDefaultValue LimitsDescription
entryModelIdstring
*
~ 1024 charsEntry Model Master GRN
* Set automatically by the server
namestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
createdAtlong
*
NowDatetime of creation
Unix time, milliseconds
* Set automatically by the server
updatedAtlong
*
NowDatetime of last update
Unix time, milliseconds
* Set automatically by the server
revisionlong00 ~ 9223372036854775805Revision

Methods

describeNamespaces

Get a list of Namespaces

Retrieves a list of namespaces that have been created on a per-service basis within the project. You can use the optional page token to start acquiring data from a specific location in the list. You can also limit the number of namespaces to be acquired.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namePrefixstring~ 64 charsFilter by Namespace name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<Namespace>List of Namespace
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 {
        NamePrefix: nil,
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->describeNamespaces(
        (new DescribeNamespacesRequest())
            ->withNamePrefix(null)
            ->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()
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<Namespace> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Dictionary.Request.DescribeNamespacesRequest()
        .WithNamePrefix(null)
        .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()
            .withNamePrefix(null)
            .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_name_prefix(None)
            .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({
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

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

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

api_result_handler = client.describe_namespaces_async({
    namePrefix=nil,
    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['errorMessage'])
end

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

createNamespace

Create a new Namespace

You must specify detailed information including the name, description, and various settings of the namespace.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction Setting
Configuration for controlling how distributed transactions are executed when processing dictionary entry registration. Supports auto-run, atomic commit, and async processing options.
entryScriptScriptSettingScript setting to be executed when registering an entry
Script Trigger Reference - entry
duplicateEntryScriptstring~ 1024 charsScript GRN to run when an attempt is made to re-register an entry that has already been registered
Script Trigger Reference - duplicateEntry
logSettingLogSettingLog Output Settings
Configuration for outputting log data of dictionary operations to GS2-Log. By specifying a GS2-Log namespace, API request and response logs for entry registration, like operations, and other dictionary activities can be collected.

Result

TypeDescription
itemNamespaceNamespace created

Implementation Example

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("namespace-0001"),
        Description: nil,
        TransactionSetting: nil,
        EntryScript: nil,
        DuplicateEntryScript: nil,
        LogSetting: &dictionary.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withEntryScript(null)
            ->withDuplicateEntryScript(null)
            ->withLogSetting((new \Gs2\Dictionary\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.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("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withEntryScript(null)
            .withDuplicateEntryScript(null)
            .withLogSetting(new io.gs2.dictionary.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Dictionary.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithEntryScript(null)
        .WithDuplicateEntryScript(null)
        .WithLogSetting(new Gs2.Gs2Dictionary.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.createNamespace(
        new Gs2Dictionary.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withEntryScript(null)
            .withDuplicateEntryScript(null)
            .withLogSetting(new Gs2Dictionary.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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_namespace(
        dictionary.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting(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:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    entryScript=nil,
    duplicateEntryScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

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

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

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    entryScript=nil,
    duplicateEntryScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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['errorMessage'])
end

result = api_result.result
item = result.item;

getNamespaceStatus

Get Namespace status

Get the current status of the specified namespace. This includes whether the Namespace is active, pending, or in some other state.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
statusstring

Implementation Example

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("namespace-0001"),
    }
)
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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName("namespace-0001")
    );
    $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("namespace-0001")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Dictionary.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace-0001"),
    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("namespace-0001")
    );
    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('namespace-0001')
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.get_namespace_status({
    namespaceName="namespace-0001",
})

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

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

api_result_handler = client.get_namespace_status_async({
    namespaceName="namespace-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['errorMessage'])
end

result = api_result.result
status = result.status;

getNamespace

Get namespace

Get detailed information about the specified namespace. This includes the name, description, and other settings of the namespace.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemNamespaceNamespace

Implementation Example

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("namespace-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\GetNamespaceRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName("namespace-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.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("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Dictionary.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace-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.getNamespace(
        new Gs2Dictionary.GetNamespaceRequest()
            .withNamespaceName("namespace-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_namespace(
        dictionary.GetNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.get_namespace({
    namespaceName="namespace-0001",
})

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

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

api_result_handler = client.get_namespace_async({
    namespaceName="namespace-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['errorMessage'])
end

result = api_result.result
item = result.item;

updateNamespace

Update Namespace

Update the settings of the specified namespace. You can change the description of the Namespace and specific settings.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction Setting
Configuration for controlling how distributed transactions are executed when processing dictionary entry registration. Supports auto-run, atomic commit, and async processing options.
entryScriptScriptSettingScript setting to be executed when registering an entry
Script Trigger Reference - entry
duplicateEntryScriptstring~ 1024 charsScript GRN to run when an attempt is made to re-register an entry that has already been registered
Script Trigger Reference - duplicateEntry
logSettingLogSettingLog Output Settings
Configuration for outputting log data of dictionary operations to GS2-Log. By specifying a GS2-Log namespace, API request and response logs for entry registration, like operations, and other dictionary activities can be collected.

Result

TypeDescription
itemNamespaceNamespace updated

Implementation Example

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("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        EntryScript: nil,
        DuplicateEntryScript: nil,
        LogSetting: &dictionary.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withEntryScript(null)
            ->withDuplicateEntryScript(null)
            ->withLogSetting((new \Gs2\Dictionary\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.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("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withEntryScript(null)
            .withDuplicateEntryScript(null)
            .withLogSetting(new io.gs2.dictionary.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Dictionary.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithEntryScript(null)
        .WithDuplicateEntryScript(null)
        .WithLogSetting(new Gs2.Gs2Dictionary.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.updateNamespace(
        new Gs2Dictionary.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withEntryScript(null)
            .withDuplicateEntryScript(null)
            .withLogSetting(new Gs2Dictionary.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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_namespace(
        dictionary.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(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:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    entryScript=nil,
    duplicateEntryScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

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

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

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    entryScript=nil,
    duplicateEntryScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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['errorMessage'])
end

result = api_result.result
item = result.item;

deleteNamespace

Delete Namespace

Delete the specified namespace. This operation is irreversible and all data associated with the deleted Namespace will be lost.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemNamespaceThe deleted Namespace

Implementation Example

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("namespace-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\DeleteNamespaceRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName("namespace-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.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("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Dictionary.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace-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.deleteNamespace(
        new Gs2Dictionary.DeleteNamespaceRequest()
            .withNamespaceName("namespace-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.delete_namespace(
        dictionary.DeleteNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.delete_namespace({
    namespaceName="namespace-0001",
})

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

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

api_result_handler = client.delete_namespace_async({
    namespaceName="namespace-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['errorMessage'])
end

result = api_result.result
item = result.item;

getServiceVersion

Get the microservice version

Details

Request

Request parameters: None

Result

TypeDescription
itemstringVersion

Implementation Example

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.GetServiceVersion(
    &dictionary.GetServiceVersionRequest {
    }
)
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\GetServiceVersionRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->getServiceVersion(
        (new GetServiceVersionRequest())
    );
    $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.GetServiceVersionRequest;
import io.gs2.dictionary.result.GetServiceVersionResult;

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

try {
    GetServiceVersionResult result = client.getServiceVersion(
        new GetServiceVersionRequest()
    );
    String item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
    new Gs2.Gs2Dictionary.Request.GetServiceVersionRequest(),
    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.getServiceVersion(
        new Gs2Dictionary.GetServiceVersionRequest()
    );
    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_service_version(
        dictionary.GetServiceVersionRequest()
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.get_service_version({
})

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

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

api_result_handler = client.get_service_version_async({
})

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['errorMessage'])
end

result = api_result.result
item = result.item;

dumpUserDataByUserId

Dump data associated with the specified user ID

Can be used to meet legal requirements for the protection of personal information, or to back up or migrate data.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

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 Gs2DictionaryRestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
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['errorMessage'])
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['errorMessage'])
end

result = api_result.result

checkDumpUserDataByUserId

Check if the dump of the data associated with the specified user ID is complete

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL of output data

Implementation Example

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 Gs2DictionaryRestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
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['errorMessage'])
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['errorMessage'])
end

result = api_result.result
url = result.url;

cleanUserDataByUserId

Delete user data

Execute cleaning of data associated with the specified user ID This allows you to safely delete specific user data from the project.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

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 Gs2DictionaryRestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
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['errorMessage'])
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['errorMessage'])
end

result = api_result.result

checkCleanUserDataByUserId

Check if the cleaning of the data associated with the specified user ID is complete

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

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 Gs2DictionaryRestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
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['errorMessage'])
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['errorMessage'])
end

result = api_result.result

prepareImportUserDataByUserId

Execute import of data associated with the specified user ID

The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.

You can start the actual import process by uploading the exported zip file to the URL returned in the return value of this API and calling importUserDataByUserId.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
uploadTokenstringToken used to reflect results after upload
uploadUrlstringURL used to upload user data

Implementation Example

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 Gs2DictionaryRestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
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['errorMessage'])
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['errorMessage'])
end

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

importUserDataByUserId

Execute import of data associated with the specified user ID

The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.

Before calling this API, you must call prepareImportUserDataByUserId to complete the upload preparation.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
uploadTokenstring
~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

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 Gs2DictionaryRestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
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['errorMessage'])
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['errorMessage'])
end

result = api_result.result

checkImportUserDataByUserId

Check if the import of the data associated with the specified user ID is complete

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser ID
uploadTokenstring
~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL of log data

Implementation Example

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 Gs2DictionaryRestClient(
    $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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
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['errorMessage'])
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['errorMessage'])
end

result = api_result.result
url = result.url;

describeEntries

Get a list of Entries

Retrieves a paginated list of entries collected by the currently logged-in user. Each entry represents a dictionary item that the user has unlocked or acquired. Use pagination with a page token and limit to retrieve the results incrementally.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 10000Number of data items to retrieve

Result

TypeDescription
itemsList<Entry>List of Entries
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->describeEntries(
        (new DescribeEntriesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.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("namespace-0001")
            .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.DescribeEntriesResult> asyncResult = null;
yield return client.DescribeEntries(
    new Gs2.Gs2Dictionary.Request.DescribeEntriesRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .with_access_token('accessToken-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="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

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

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

api_result_handler = client.describe_entries_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

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

describeEntriesByUserId

Get a list of Entries by specifying a user ID

Retrieves a paginated list of entries collected by the specified user. Each entry represents a dictionary item that the user has unlocked or acquired.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 10000Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<Entry>List of Entries
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->describeEntriesByUserId(
        (new DescribeEntriesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.DescribeEntriesByUserIdResult> asyncResult = null;
yield return client.DescribeEntriesByUserId(
    new Gs2.Gs2Dictionary.Request.DescribeEntriesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
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="namespace-0001",
    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['errorMessage'])
end

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

addEntriesByUserId

Add entries by specifying a user ID

Registers one or more entry model names to the specified user’s dictionary. Multiple entry model names can be specified at once in a batch operation. If an entry has already been registered, it is silently skipped without causing an error. The returned list contains only the entries that were newly added.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
entryModelNamesList<string>[]0 ~ 100 itemsList of Entry Model names
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<Entry>List of Added Entries

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->addEntriesByUserId(
        (new AddEntriesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.AddEntriesByUserIdResult> asyncResult = null;
yield return client.AddEntriesByUserId(
    new Gs2.Gs2Dictionary.Request.AddEntriesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    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['errorMessage'])
end

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

api_result_handler = client.add_entries_by_user_id_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
items = result.items;

getEntry

Get an Entry

Retrieves whether the currently logged-in user has collected a specific entry identified by entry model name.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
entryModelNamestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).

Result

TypeDescription
itemEntryEntry

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->getEntry(
        (new GetEntryRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withEntryModelName("entry-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.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("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withEntryModelName("entry-0001")
    );
    Entry item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.GetEntryResult> asyncResult = null;
yield return client.GetEntry(
    new Gs2.Gs2Dictionary.Request.GetEntryRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .with_access_token('accessToken-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="namespace-0001",
    accessToken="accessToken-0001",
    entryModelName="entry-0001",
})

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

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

api_result_handler = client.get_entry_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
item = result.item;

getEntryByUserId

Get Entry by specifying a user ID

Retrieves whether the specified user has collected a specific entry identified by entry model name.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
entryModelNamestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemEntryEntry

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->getEntryByUserId(
        (new GetEntryByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withUserId("user-0001")
            .withEntryModelName("entry-0001")
            .withTimeOffsetToken(null)
    );
    Entry item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.GetEntryByUserIdResult> asyncResult = null;
yield return client.GetEntryByUserId(
    new Gs2.Gs2Dictionary.Request.GetEntryByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    userId="user-0001",
    entryModelName="entry-0001",
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.get_entry_by_user_id_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
item = result.item;

getEntryWithSignature

Get Entry with cryptographic signature

Retrieves the entry for the currently logged-in user along with a cryptographic signature. The entry data is serialized to JSON and signed using the specified encryption key. The response includes the entry item, the serialized body, and the signature string, which can be used for tamper-proof verification on external systems.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
entryModelNamestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024 charsEncryption Key GRN

Result

TypeDescription
itemEntryEntry
bodystringEntry information for signature subject
signaturestringsignature

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->getEntryWithSignature(
        (new GetEntryWithSignatureRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withEntryModelName("entry-0001")
            ->withKeyId("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("namespace-0001")
            .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.GetEntryWithSignatureResult> asyncResult = null;
yield return client.GetEntryWithSignature(
    new Gs2.Gs2Dictionary.Request.GetEntryWithSignatureRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_entry_model_name('entry-0001')
            .with_key_id('key-0001')
    )
    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="namespace-0001",
    accessToken="accessToken-0001",
    entryModelName="entry-0001",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
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="namespace-0001",
    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['errorMessage'])
end

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

getEntryWithSignatureByUserId

Get Entry with cryptographic signature by specifying a user ID

Retrieves the entry for the specified user along with a cryptographic signature. The entry data is serialized to JSON and signed using the specified encryption key. The response includes the entry item, the serialized body, and the signature string, which can be used for tamper-proof verification on external systems.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
entryModelNamestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024 charsEncryption Key GRN
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemEntryEntry
bodystringEntry information for signature subject
signaturestringsignature

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->getEntryWithSignatureByUserId(
        (new GetEntryWithSignatureByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withEntryModelName("entry-0001")
            ->withKeyId("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("namespace-0001")
            .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.GetEntryWithSignatureByUserIdResult> asyncResult = null;
yield return client.GetEntryWithSignatureByUserId(
    new Gs2.Gs2Dictionary.Request.GetEntryWithSignatureByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .with_user_id('user-0001')
            .with_entry_model_name('entry-0001')
            .with_key_id('key-0001')
            .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="namespace-0001",
    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['errorMessage'])
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="namespace-0001",
    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['errorMessage'])
end

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

resetByUserId

Reset entries

Deletes all entries collected by the specified user, resetting their dictionary to an empty state. All collected entries are cleared at once. This action cannot be undone.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->resetByUserId(
        (new ResetByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.ResetByUserIdResult> asyncResult = null;
yield return client.ResetByUserId(
    new Gs2.Gs2Dictionary.Request.ResetByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.reset_by_user_id_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result

verifyEntry

Verify Entry

Verifies whether the currently logged-in user has or has not collected a specific entry. The verify type specifies the condition: ‘have’ checks that the user has the entry, ‘havent’ checks that the user does not have it. If the verification fails, an error is returned. This is useful for implementing prerequisites (e.g., requiring a specific entry before allowing a quest).

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
entryModelNamestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
verifyTypeString Enum
enum {
  “havent”,
  “have”
}
Type of verification
DefinitionDescription
“havent”The specified entry must not be held
“have”The specified entry must be held

Result

TypeDescription

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->verifyEntry(
        (new VerifyEntryRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->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("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withEntryModelName("entry-0001")
            .withVerifyType("havent")
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.VerifyEntryResult> asyncResult = null;
yield return client.VerifyEntry(
    new Gs2.Gs2Dictionary.Request.VerifyEntryRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .with_access_token('accessToken-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="namespace-0001",
    accessToken="accessToken-0001",
    entryModelName="entry-0001",
    verifyType="havent",
})

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

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

api_result_handler = client.verify_entry_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result

verifyEntryByUserId

Verify Entry by specifying a user ID

Verifies whether the specified user has or has not collected a specific entry. The verify type specifies the condition: ‘have’ checks that the user has the entry, ‘havent’ checks that the user does not have it. If the verification fails, an error is returned.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
entryModelNamestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
verifyTypeString Enum
enum {
  “havent”,
  “have”
}
Type of verification
DefinitionDescription
“havent”The specified entry must not be held
“have”The specified entry must be held
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->verifyEntryByUserId(
        (new VerifyEntryByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withUserId("user-0001")
            .withEntryModelName("entry-0001")
            .withVerifyType("havent")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.VerifyEntryByUserIdResult> asyncResult = null;
yield return client.VerifyEntryByUserId(
    new Gs2.Gs2Dictionary.Request.VerifyEntryByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    userId="user-0001",
    entryModelName="entry-0001",
    verifyType="havent",
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.verify_entry_by_user_id_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result

deleteEntries

Delete entries

Removes specific entries from the currently logged-in user’s dictionary by specifying a list of entry model names. Multiple entries can be deleted at once in a batch operation. The returned list contains the entries that were actually deleted.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
entryModelNamesList<string>[]0 ~ 100 itemsList of Entry Model names

Result

TypeDescription
itemsList<Entry>List of Deleted Entries

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->deleteEntries(
        (new DeleteEntriesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withEntryModelNames([
                "entry-0001",
                "entry-0002",
                "entry-0003",
            ])
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.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("namespace-0001")
            .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.DeleteEntriesResult> asyncResult = null;
yield return client.DeleteEntries(
    new Gs2.Gs2Dictionary.Request.DeleteEntriesRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .with_access_token('accessToken-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="namespace-0001",
    accessToken="accessToken-0001",
    entryModelNames={
        "entry-0001",
        "entry-0002",
        "entry-0003"
    },
})

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

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

api_result_handler = client.delete_entries_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
items = result.items;

deleteEntriesByUserId

Delete entries by specifying a user ID

Removes specific entries from the specified user’s dictionary by specifying a list of entry model names. Multiple entries can be deleted at once in a batch operation. The returned list contains the entries that were actually deleted.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
entryModelNamesList<string>[]0 ~ 100 itemsList of Entry Model names
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<Entry>List of Deleted Entries

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->deleteEntriesByUserId(
        (new DeleteEntriesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.DeleteEntriesByUserIdResult> asyncResult = null;
yield return client.DeleteEntriesByUserId(
    new Gs2.Gs2Dictionary.Request.DeleteEntriesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    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['errorMessage'])
end

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

api_result_handler = client.delete_entries_by_user_id_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
items = result.items;

describeLikes

Get a list of Likes

Retrieves a paginated list of entries that the currently logged-in user has marked as liked (favorited). Likes are separate from entry collection and represent user preferences for specific dictionary items.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<Like>List of Likes
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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.DescribeLikes(
    &dictionary.DescribeLikesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\DescribeLikesRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->describeLikes(
        (new DescribeLikesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.DescribeLikesRequest;
import io.gs2.dictionary.result.DescribeLikesResult;

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

try {
    DescribeLikesResult result = client.describeLikes(
        new DescribeLikesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Like> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.DescribeLikesResult> asyncResult = null;
yield return client.DescribeLikes(
    new Gs2.Gs2Dictionary.Request.DescribeLikesRequest()
        .WithNamespaceName("namespace-0001")
        .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.describeLikes(
        new Gs2Dictionary.DescribeLikesRequest()
            .withNamespaceName("namespace-0001")
            .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_likes(
        dictionary.DescribeLikesRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-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_likes({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

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

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

api_result_handler = client.describe_likes_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

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

describeLikesByUserId

Get a list of Likes by specifying a user ID

Retrieves a paginated list of entries that the specified user has marked as liked (favorited). Likes are separate from entry collection and represent user preferences for specific dictionary items.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<Like>List of Likes
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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.DescribeLikesByUserId(
    &dictionary.DescribeLikesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\DescribeLikesByUserIdRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->describeLikesByUserId(
        (new DescribeLikesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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.DescribeLikesByUserIdRequest;
import io.gs2.dictionary.result.DescribeLikesByUserIdResult;

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

try {
    DescribeLikesByUserIdResult result = client.describeLikesByUserId(
        new DescribeLikesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Like> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.DescribeLikesByUserIdResult> asyncResult = null;
yield return client.DescribeLikesByUserId(
    new Gs2.Gs2Dictionary.Request.DescribeLikesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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.describeLikesByUserId(
        new Gs2Dictionary.DescribeLikesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .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_likes_by_user_id(
        dictionary.DescribeLikesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .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_likes_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.describe_likes_by_user_id_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

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

addLikes

Add likes

Marks one or more entries as liked by the currently logged-in user. Multiple entry model names can be specified at once in a batch operation. If an entry is already liked, it is silently skipped without causing an error. The returned list contains only the likes that were newly added.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
entryModelNamesList<string>[]0 ~ 100 itemsList of Entry Model names

Result

TypeDescription
itemsList<Like>List of Added Likes

Implementation Example

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.AddLikes(
    &dictionary.AddLikesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\AddLikesRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->addLikes(
        (new AddLikesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withEntryModelNames([
                "entry-0001",
                "entry-0002",
                "entry-0003",
            ])
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.AddLikesRequest;
import io.gs2.dictionary.result.AddLikesResult;

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

try {
    AddLikesResult result = client.addLikes(
        new AddLikesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withEntryModelNames(Arrays.asList(
                "entry-0001",
                "entry-0002",
                "entry-0003"
            ))
    );
    List<Like> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.AddLikesResult> asyncResult = null;
yield return client.AddLikes(
    new Gs2.Gs2Dictionary.Request.AddLikesRequest()
        .WithNamespaceName("namespace-0001")
        .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.addLikes(
        new Gs2Dictionary.AddLikesRequest()
            .withNamespaceName("namespace-0001")
            .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.add_likes(
        dictionary.AddLikesRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-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.add_likes({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    entryModelNames={
        "entry-0001",
        "entry-0002",
        "entry-0003"
    },
})

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

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

api_result_handler = client.add_likes_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
items = result.items;

addLikesByUserId

Add likes by specifying a user ID

Marks one or more entries as liked by the specified user. Multiple entry model names can be specified at once in a batch operation. If an entry is already liked, it is silently skipped without causing an error. The returned list contains only the likes that were newly added.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
entryModelNamesList<string>[]0 ~ 100 itemsList of Entry Model names
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<Like>List of Added Likes

Implementation Example

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.AddLikesByUserId(
    &dictionary.AddLikesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\AddLikesByUserIdRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->addLikesByUserId(
        (new AddLikesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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.AddLikesByUserIdRequest;
import io.gs2.dictionary.result.AddLikesByUserIdResult;

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

try {
    AddLikesByUserIdResult result = client.addLikesByUserId(
        new AddLikesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withEntryModelNames(Arrays.asList(
                "entry-0001",
                "entry-0002",
                "entry-0003"
            ))
            .withTimeOffsetToken(null)
    );
    List<Like> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.AddLikesByUserIdResult> asyncResult = null;
yield return client.AddLikesByUserId(
    new Gs2.Gs2Dictionary.Request.AddLikesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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.addLikesByUserId(
        new Gs2Dictionary.AddLikesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .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_likes_by_user_id(
        dictionary.AddLikesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .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_likes_by_user_id({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

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

api_result_handler = client.add_likes_by_user_id_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
items = result.items;

getLike

Get Like

Retrieves whether the currently logged-in user has liked a specific entry identified by entry model name.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
entryModelNamestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).

Result

TypeDescription
itemLikeLike Entry

Implementation Example

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.GetLike(
    &dictionary.GetLikeRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\GetLikeRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->getLike(
        (new GetLikeRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withEntryModelName("entry-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.GetLikeRequest;
import io.gs2.dictionary.result.GetLikeResult;

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

try {
    GetLikeResult result = client.getLike(
        new GetLikeRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withEntryModelName("entry-0001")
    );
    Like item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.GetLikeResult> asyncResult = null;
yield return client.GetLike(
    new Gs2.Gs2Dictionary.Request.GetLikeRequest()
        .WithNamespaceName("namespace-0001")
        .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.getLike(
        new Gs2Dictionary.GetLikeRequest()
            .withNamespaceName("namespace-0001")
            .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_like(
        dictionary.GetLikeRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_entry_model_name('entry-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

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

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

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

api_result_handler = client.get_like_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
item = result.item;

getLikeByUserId

Get Like by specifying a user ID

Retrieves whether the specified user has liked a specific entry identified by entry model name.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
entryModelNamestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.).
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemLikeLike Entry

Implementation Example

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.GetLikeByUserId(
    &dictionary.GetLikeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\GetLikeByUserIdRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->getLikeByUserId(
        (new GetLikeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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.GetLikeByUserIdRequest;
import io.gs2.dictionary.result.GetLikeByUserIdResult;

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

try {
    GetLikeByUserIdResult result = client.getLikeByUserId(
        new GetLikeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withEntryModelName("entry-0001")
            .withTimeOffsetToken(null)
    );
    Like item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.GetLikeByUserIdResult> asyncResult = null;
yield return client.GetLikeByUserId(
    new Gs2.Gs2Dictionary.Request.GetLikeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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.getLikeByUserId(
        new Gs2Dictionary.GetLikeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .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_like_by_user_id(
        dictionary.GetLikeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .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_like_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    entryModelName="entry-0001",
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.get_like_by_user_id_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
item = result.item;

resetLikes

Reset likes

Deletes all likes for the currently logged-in user, resetting their favorites to an empty state. All liked entries are cleared at once. This action cannot be undone. Entry collection status is not affected.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token

Result

TypeDescription

Implementation Example

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.ResetLikes(
    &dictionary.ResetLikesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\ResetLikesRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->resetLikes(
        (new ResetLikesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.ResetLikesRequest;
import io.gs2.dictionary.result.ResetLikesResult;

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

try {
    ResetLikesResult result = client.resetLikes(
        new ResetLikesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.ResetLikesResult> asyncResult = null;
yield return client.ResetLikes(
    new Gs2.Gs2Dictionary.Request.ResetLikesRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';

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

try {
    const result = await client.resetLikes(
        new Gs2Dictionary.ResetLikesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
    );
} 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_likes(
        dictionary.ResetLikesRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.reset_likes({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
})

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

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

api_result_handler = client.reset_likes_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-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['errorMessage'])
end

result = api_result.result

resetLikesByUserId

Reset likes by specifying a user ID

Deletes all likes for the specified user, resetting their favorites to an empty state. All liked entries are cleared at once. This action cannot be undone. Entry collection status is not affected.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

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.ResetLikesByUserId(
    &dictionary.ResetLikesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\ResetLikesByUserIdRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->resetLikesByUserId(
        (new ResetLikesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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.ResetLikesByUserIdRequest;
import io.gs2.dictionary.result.ResetLikesByUserIdResult;

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

try {
    ResetLikesByUserIdResult result = client.resetLikesByUserId(
        new ResetLikesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.ResetLikesByUserIdResult> asyncResult = null;
yield return client.ResetLikesByUserId(
    new Gs2.Gs2Dictionary.Request.ResetLikesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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.resetLikesByUserId(
        new Gs2Dictionary.ResetLikesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .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_likes_by_user_id(
        dictionary.ResetLikesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

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

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

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

api_result_handler = client.reset_likes_by_user_id_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result

deleteLikes

Delete likes

Removes specific likes from the currently logged-in user by specifying a list of entry model names. Multiple likes can be removed at once in a batch operation. The returned list contains the likes that were actually deleted.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
entryModelNamesList<string>[]0 ~ 100 itemsList of Entry Model names

Result

TypeDescription
itemsList<Like>List of Deleted Likes

Implementation Example

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.DeleteLikes(
    &dictionary.DeleteLikesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\DeleteLikesRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->deleteLikes(
        (new DeleteLikesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withEntryModelNames([
                "entry-0001",
                "entry-0002",
                "entry-0003",
            ])
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.DeleteLikesRequest;
import io.gs2.dictionary.result.DeleteLikesResult;

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

try {
    DeleteLikesResult result = client.deleteLikes(
        new DeleteLikesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withEntryModelNames(Arrays.asList(
                "entry-0001",
                "entry-0002",
                "entry-0003"
            ))
    );
    List<Like> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.DeleteLikesResult> asyncResult = null;
yield return client.DeleteLikes(
    new Gs2.Gs2Dictionary.Request.DeleteLikesRequest()
        .WithNamespaceName("namespace-0001")
        .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.deleteLikes(
        new Gs2Dictionary.DeleteLikesRequest()
            .withNamespaceName("namespace-0001")
            .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_likes(
        dictionary.DeleteLikesRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-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_likes({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    entryModelNames={
        "entry-0001",
        "entry-0002",
        "entry-0003"
    },
})

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

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

api_result_handler = client.delete_likes_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
items = result.items;

deleteLikesByUserId

Delete likes by specifying a user ID

Removes specific likes from the specified user by specifying a list of entry model names. Multiple likes can be removed at once in a batch operation. The returned list contains the likes that were actually deleted.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
entryModelNamesList<string>[]0 ~ 100 itemsList of Entry Model names
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<Like>List of Deleted Likes

Implementation Example

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.DeleteLikesByUserId(
    &dictionary.DeleteLikesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\DeleteLikesByUserIdRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->deleteLikesByUserId(
        (new DeleteLikesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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.DeleteLikesByUserIdRequest;
import io.gs2.dictionary.result.DeleteLikesByUserIdResult;

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

try {
    DeleteLikesByUserIdResult result = client.deleteLikesByUserId(
        new DeleteLikesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withEntryModelNames(Arrays.asList(
                "entry-0001",
                "entry-0002",
                "entry-0003"
            ))
            .withTimeOffsetToken(null)
    );
    List<Like> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.DeleteLikesByUserIdResult> asyncResult = null;
yield return client.DeleteLikesByUserId(
    new Gs2.Gs2Dictionary.Request.DeleteLikesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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.deleteLikesByUserId(
        new Gs2Dictionary.DeleteLikesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .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_likes_by_user_id(
        dictionary.DeleteLikesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .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_likes_by_user_id({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

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

api_result_handler = client.delete_likes_by_user_id_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
items = result.items;

describeEntryModels

Get a list of Entry Models

Retrieves all currently active (published) Entry Models in the specified namespace. Entry Models define the types of dictionary items that users can collect. Only models that have been activated via the current master data are returned; editable master data is not included.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemsList<EntryModel>List of Entry Models

Implementation Example

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("namespace-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\DescribeEntryModelsRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->describeEntryModels(
        (new DescribeEntryModelsRequest())
            ->withNamespaceName("namespace-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.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("namespace-0001")
    );
    List<EntryModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.DescribeEntryModelsResult> asyncResult = null;
yield return client.DescribeEntryModels(
    new Gs2.Gs2Dictionary.Request.DescribeEntryModelsRequest()
        .WithNamespaceName("namespace-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.describeEntryModels(
        new Gs2Dictionary.DescribeEntryModelsRequest()
            .withNamespaceName("namespace-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.describe_entry_models(
        dictionary.DescribeEntryModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.describe_entry_models({
    namespaceName="namespace-0001",
})

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

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

api_result_handler = client.describe_entry_models_async({
    namespaceName="namespace-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['errorMessage'])
end

result = api_result.result
items = result.items;

getEntryModel

Get Entry Model

Retrieves the detailed information of a specific active Entry Model by name. The returned information includes the model’s name, metadata, and description.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
entryNamestring
~ 128 charsEntry Model name

Result

TypeDescription
itemEntryModelEntry Model

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->getEntryModel(
        (new GetEntryModelRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withEntryName("entry-0001")
    );
    EntryModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.GetEntryModelResult> asyncResult = null;
yield return client.GetEntryModel(
    new Gs2.Gs2Dictionary.Request.GetEntryModelRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    entryName="entry-0001",
})

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

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

api_result_handler = client.get_entry_model_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
item = result.item;

exportMaster

Export Entry Model Master in a master data format that can be activated

Exports the current Entry Model Master data in a format that can be used for activation. The exported data can be used to back up the current master configuration, or to import it into another namespace.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCurrentEntryMasterEntry Model master data that can be activated

Implementation Example

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("namespace-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\ExportMasterRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->exportMaster(
        (new ExportMasterRequest())
            ->withNamespaceName("namespace-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.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("namespace-0001")
    );
    CurrentEntryMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Dictionary.Request.ExportMasterRequest()
        .WithNamespaceName("namespace-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.exportMaster(
        new Gs2Dictionary.ExportMasterRequest()
            .withNamespaceName("namespace-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.export_master(
        dictionary.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.export_master({
    namespaceName="namespace-0001",
})

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

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

api_result_handler = client.export_master_async({
    namespaceName="namespace-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['errorMessage'])
end

result = api_result.result
item = result.item;

getCurrentEntryMaster

Get currently active Entry Model master data

Retrieves the master data of the Entry Models that are currently active (published) in the specified namespace. This represents the configuration that is actually being used in production, as opposed to the editable master data.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCurrentEntryMasterCurrently active Entry Model master data

Implementation Example

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("namespace-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\GetCurrentEntryMasterRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->getCurrentEntryMaster(
        (new GetCurrentEntryMasterRequest())
            ->withNamespaceName("namespace-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.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("namespace-0001")
    );
    CurrentEntryMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.GetCurrentEntryMasterResult> asyncResult = null;
yield return client.GetCurrentEntryMaster(
    new Gs2.Gs2Dictionary.Request.GetCurrentEntryMasterRequest()
        .WithNamespaceName("namespace-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.getCurrentEntryMaster(
        new Gs2Dictionary.GetCurrentEntryMasterRequest()
            .withNamespaceName("namespace-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_current_entry_master(
        dictionary.GetCurrentEntryMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.get_current_entry_master({
    namespaceName="namespace-0001",
})

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

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

api_result_handler = client.get_current_entry_master_async({
    namespaceName="namespace-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['errorMessage'])
end

result = api_result.result
item = result.item;

preUpdateCurrentEntryMaster

Update currently active Entry Model master data (3-phase version)

When uploading master data larger than 1MB, the update is performed in 3 phases.

  1. Execute this API to obtain a token and URL for uploading.
  2. Upload the master data to the obtained URL.
  3. Execute UpdateCurrentModelMaster by passing the token obtained from the the upload to reflect the master data.
Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
uploadTokenstringToken used to reflect results after upload
uploadUrlstringURL used to upload

Implementation Example

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.PreUpdateCurrentEntryMaster(
    &dictionary.PreUpdateCurrentEntryMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
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\PreUpdateCurrentEntryMasterRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentEntryMaster(
        (new PreUpdateCurrentEntryMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $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.PreUpdateCurrentEntryMasterRequest;
import io.gs2.dictionary.result.PreUpdateCurrentEntryMasterResult;

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

try {
    PreUpdateCurrentEntryMasterResult result = client.preUpdateCurrentEntryMaster(
        new PreUpdateCurrentEntryMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.PreUpdateCurrentEntryMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentEntryMaster(
    new Gs2.Gs2Dictionary.Request.PreUpdateCurrentEntryMasterRequest()
        .WithNamespaceName("namespace-0001"),
    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.preUpdateCurrentEntryMaster(
        new Gs2Dictionary.PreUpdateCurrentEntryMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    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.pre_update_current_entry_master(
        dictionary.PreUpdateCurrentEntryMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.pre_update_current_entry_master({
    namespaceName="namespace-0001",
})

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

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

api_result_handler = client.pre_update_current_entry_master_async({
    namespaceName="namespace-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['errorMessage'])
end

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

updateCurrentEntryMaster

Update currently active Entry Model master data

Updates and activates (publishes) the master data of the Entry Models in the specified namespace. Supports two modes: ‘direct’ mode for inline master data, and ‘preUpload’ mode for master data that was uploaded in advance. For master data larger than 1MB, use the 3-phase update flow: PreUpdate -> Upload -> Update (preUpload mode). The uploaded master data is validated before being applied.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
modeString Enum
enum {
  “direct”,
  “preUpload”
}
“direct”Update mode
DefinitionDescription
“direct”Directly update master data
“preUpload”Upload master data and then update
settingsstring{mode} == “direct”
✓*
~ 5242880 charsMaster Data
* Required if mode is “direct”
uploadTokenstring{mode} == “preUpload”
✓*
~ 1024 charsToken obtained by pre-upload
Used to apply the uploaded master data.
* Required if mode is “preUpload”

Result

TypeDescription
itemCurrentEntryMasterUpdated master data of the currently active Entry Models

Implementation Example

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("namespace-0001"),
        Mode: pointy.String("direct"),
        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}"),
        UploadToken: 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\UpdateCurrentEntryMasterRequest;

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

$session->open();

$client = new Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->updateCurrentEntryMaster(
        (new UpdateCurrentEntryMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->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}")
            ->withUploadToken(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.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("namespace-0001")
            .withMode("direct")
            .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}")
            .withUploadToken(null)
    );
    CurrentEntryMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.UpdateCurrentEntryMasterResult> asyncResult = null;
yield return client.UpdateCurrentEntryMaster(
    new Gs2.Gs2Dictionary.Request.UpdateCurrentEntryMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .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}")
        .WithUploadToken(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.updateCurrentEntryMaster(
        new Gs2Dictionary.UpdateCurrentEntryMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .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}")
            .withUploadToken(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.update_current_entry_master(
        dictionary.UpdateCurrentEntryMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .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}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('dictionary')

api_result = client.update_current_entry_master({
    namespaceName="namespace-0001",
    mode="direct",
    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}",
    uploadToken=nil,
})

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

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

api_result_handler = client.update_current_entry_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    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}",
    uploadToken=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['errorMessage'])
end

result = api_result.result
item = result.item;

updateCurrentEntryMasterFromGitHub

Update currently active Entry Model master data from GitHub

Updates and activates (publishes) the master data by fetching it directly from a GitHub repository. The checkout settings specify the repository, branch/tag, and file path to use. This is useful for managing master data in version control and deploying it directly.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
checkoutSettingGitHubCheckoutSetting
Setup to check out master data from GitHub

Result

TypeDescription
itemCurrentEntryMasterUpdated master data of the currently active Entry Models

Implementation Example

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("namespace-0001"),
        CheckoutSetting: &dictionary.GitHubCheckoutSetting{
            ApiKeyId: pointy.String("apiKeyId-0001"),
            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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->updateCurrentEntryMasterFromGitHub(
        (new UpdateCurrentEntryMasterFromGitHubRequest())
            ->withNamespaceName("namespace-0001")
            ->withCheckoutSetting((new GitHubCheckoutSetting())
                ->withApiKeyId("apiKeyId-0001")
                ->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("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.UpdateCurrentEntryMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentEntryMasterFromGitHub(
    new Gs2.Gs2Dictionary.Request.UpdateCurrentEntryMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Dictionary.Model.GitHubCheckoutSetting()
            .WithApiKeyId("apiKeyId-0001")
            .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("namespace-0001")
            .withCheckoutSetting(new Gs2Dictionary.model.GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .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('namespace-0001')
            .with_checkout_setting(dictionary.GitHubCheckoutSetting()
                .with_api_key_id('apiKeyId-0001')
                .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="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        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['errorMessage'])
end

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

api_result_handler = client.update_current_entry_master_from_git_hub_async({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        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['errorMessage'])
end

result = api_result.result
item = result.item;

describeEntryModelMasters

Get a list of Entry Model Masters

Retrieves a paginated list of editable Entry Model Masters with optional name prefix filtering. Entry Model Masters are the editable definitions for dictionary item types. Changes to masters do not take effect until the master data is activated via the CurrentEntryMaster API.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefixstring~ 64 charsFilter by Entry Model name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<EntryModelMaster>List of Entry Model Masters
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("namespace-0001"),
        NamePrefix: nil,
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->describeEntryModelMasters(
        (new DescribeEntryModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->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("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<EntryModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.DescribeEntryModelMastersResult> asyncResult = null;
yield return client.DescribeEntryModelMasters(
    new Gs2.Gs2Dictionary.Request.DescribeEntryModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .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("namespace-0001")
            .withNamePrefix(null)
            .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('namespace-0001')
            .with_name_prefix(None)
            .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="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

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

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

api_result_handler = client.describe_entry_model_masters_async({
    namespaceName="namespace-0001",
    namePrefix=nil,
    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['errorMessage'])
end

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

createEntryModelMaster

Create a new Entry Model Master

Creates a new editable Entry Model Master definition with a name, description, and metadata. The created master defines a dictionary item type that users can collect. Changes do not take effect until the master data is activated via the CurrentEntryMaster API.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.

Result

TypeDescription
itemEntryModelMasterCreated Entry Model Master

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->createEntryModelMaster(
        (new CreateEntryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withName("monster-0001")
            .withDescription(null)
            .withMetadata("MONSTER-0001")
    );
    EntryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.CreateEntryModelMasterResult> asyncResult = null;
yield return client.CreateEntryModelMaster(
    new Gs2.Gs2Dictionary.Request.CreateEntryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    name="monster-0001",
    description=nil,
    metadata="MONSTER-0001",
})

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

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

api_result_handler = client.create_entry_model_master_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
item = result.item;

getEntryModelMaster

Get Entry Model Master

Retrieves the detailed information of a specific editable Entry Model Master by name. This is used for viewing and editing the master definition before activation.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
entryNamestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemEntryModelMasterEntry Model Master

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->getEntryModelMaster(
        (new GetEntryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withEntryName(null)
    );
    EntryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.GetEntryModelMasterResult> asyncResult = null;
yield return client.GetEntryModelMaster(
    new Gs2.Gs2Dictionary.Request.GetEntryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    entryName=nil,
})

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

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

api_result_handler = client.get_entry_model_master_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
item = result.item;

updateEntryModelMaster

Update Entry Model Master

Updates the description and metadata of an existing Entry Model Master. The entry model name cannot be changed after creation. Changes do not take effect until the master data is re-activated via the CurrentEntryMaster API.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
entryNamestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.

Result

TypeDescription
itemEntryModelMasterEntry Model Master updated

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->updateEntryModelMaster(
        (new UpdateEntryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withEntryName(null)
            .withDescription("description1")
            .withMetadata("MONSTER-0001")
    );
    EntryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.UpdateEntryModelMasterResult> asyncResult = null;
yield return client.UpdateEntryModelMaster(
    new Gs2.Gs2Dictionary.Request.UpdateEntryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    entryName=nil,
    description="description1",
    metadata="MONSTER-0001",
})

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

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

api_result_handler = client.update_entry_model_master_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
item = result.item;

deleteEntryModelMaster

Delete Entry Model Master

Deletes an editable Entry Model Master definition. This only affects the master data; the currently active (published) model is not affected until the master data is re-activated. Existing user entries associated with the deleted model are not automatically removed.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
entryNamestring
~ 128 charsEntry Model name
Entry Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemEntryModelMasterEntry Model Master deleted

Implementation Example

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("namespace-0001"),
        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 Gs2DictionaryRestClient(
    $session
);

try {
    $result = $client->deleteEntryModelMaster(
        (new DeleteEntryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->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("namespace-0001")
            .withEntryName(null)
    );
    EntryModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2DictionaryRestClient(session);

AsyncResult<Gs2.Gs2Dictionary.Result.DeleteEntryModelMasterResult> asyncResult = null;
yield return client.DeleteEntryModelMaster(
    new Gs2.Gs2Dictionary.Request.DeleteEntryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .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("namespace-0001")
            .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('namespace-0001')
            .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="namespace-0001",
    entryName=nil,
})

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

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

api_result_handler = client.delete_entry_model_master_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

result = api_result.result
item = result.item;