API Reference of GS2-Dictionary SDK
Model
Namespace
Namespace
Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.
Therefore, it is necessary to create a namespace before starting to use each service.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024 chars | Namespace GRN | ||
name | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
entryScript | ScriptSetting | Script to be executed when registering an entry | ||||
duplicateEntryScript | string | ~ 1024 chars | Script to run when an attempt is made to re-register an entry that has already been registered | |||
logSetting | LogSetting | Log output settings | ||||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
EntryModel
EntryModel
The entry model is the entity to be recorded in the index. This section defines what kind of entities can be recorded in the index.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
entryModelId | string | ✓ | ~ 1024 chars | Entry Model GRN | ||
name | string | ✓ | ~ 128 chars | Entry Name | ||
metadata | string | ~ 2048 chars | metadata |
EntryModelMaster
EntryModel
The entry model is the entity to be recorded in the index. This section defines what kind of entities can be recorded in the index.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
entryModelId | string | ✓ | ~ 1024 chars | Entry Model Master GRN | ||
name | string | ✓ | ~ 128 chars | Entry Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
Entry
Entries obtained by game players
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
entryId | string | ~ 1024 chars | Entry GRN | |||
userId | string | ~ 128 chars | User Id | |||
name | string | ✓ | ~ 128 chars | Entry Name | ||
acquiredAt | long | ✓ | Now | Date of acquisition (Unix time unit:milliseconds) |
Like
Entry registered as a favorite
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
likeId | string | ~ 1024 chars | Like Entry GRN | |||
userId | string | ~ 128 chars | User Id | |||
name | string | ✓ | ~ 128 chars | Like Name |
CurrentEntryMaster
Currently available master data
GS2 uses JSON format files for master data management. By uploading the file, you can actually reflect the settings on the server.
We provide a master data editor on the management console as a way to create JSON files, but you can also create JSON files using the The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.
Note
Please refer to Master Data Reference of GS2-Dictionary for the JSON file format.Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024 chars | Currently available entry settings GRN | ||
settings | string | ✓ | ~ 5242880 chars | Master data |
Config
Configration
Set values to be applied to transaction variables
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
key | string | ✓ | ~ 64 chars | Name | ||
value | string | ~ 51200 chars | Value |
GitHubCheckoutSetting
Setup to check out master data from GitHub
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
apiKeyId | string | ✓ | ~ 1024 chars | GitHub API key GRN | ||
repositoryName | string | ✓ | ~ 1024 chars | Repository Name | ||
sourcePath | string | ✓ | ~ 1024 chars | Source code file path | ||
referenceType | enum { “commit_hash”, “branch”, “tag” } | ✓ | ~ 128 chars | Source of code | ||
commitHash | string | {referenceType} == “commit_hash” | ✓ | ~ 1024 chars | Commit hash If referenceType is “commit_hash”, then required | |
branchName | string | {referenceType} == “branch” | ✓ | ~ 1024 chars | Branch Name If referenceType is “branch”, then required | |
tagName | string | {referenceType} == “tag” | ✓ | ~ 1024 chars | Tag Name If referenceType is “tag”, then required |
Definition of enumeration type to be specified for referenceType
Enumerator String Definition | Description |
---|---|
commit_hash | Commit hash |
branch | Branch |
tag | Tag |
ScriptSetting
Script settings
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 execution result to stop the execution of the API or to tamper with the result of the API.
On the other hand, asynchronous execution does not block processing until the script has finished executing. Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API. However, asynchronous execution does not block processing until the script has finished executing, so it is generally recommended to use asynchronous execution.
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.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
triggerScriptId | string | ~ 1024 chars | Script GRN | |||
doneTriggerTargetType | enum { “none”, “gs2_script”, “aws” } | ✓ | “none” | ~ 128 chars | Notification of Completion | |
doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | Script GRN If doneTriggerTargetType is “gs2_script”, then enabled | ||
doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | Namespace GRN If doneTriggerTargetType is “gs2_script”, then enabled |
Definition of enumeration type to be specified for doneTriggerTargetType
Enumerator String Definition | Description |
---|---|
none | None |
gs2_script | GS2-Script |
aws | Amazon EventBridge |
LogSetting
Log setting
This type manages log output settings. 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.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
loggingNamespaceId | string | ✓ | ~ 1024 chars | Namespace GRN |
Methods
describeNamespaces
Get list of namespaces
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<Namespace> | List of Namespace |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/dictionary"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := dictionary.Gs2DictionaryRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&dictionary.DescribeNamespacesRequest {
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\DescribeNamespacesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeNamespaces(
(new DescribeNamespacesRequest())
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.DescribeNamespacesRequest;
import io.gs2.dictionary.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DictionaryRestClient client = new Gs2DictionaryRestClient(session);
try {
DescribeNamespacesResult result = client.describeNamespaces(
new DescribeNamespacesRequest()
.withPageToken(null)
.withLimit(null)
);
List<Namespace> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DescribeNamespacesRequest;
using Gs2.Gs2Dictionary.Result.DescribeNamespacesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Dictionary.Request.DescribeNamespacesRequest()
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Dictionary.Gs2DictionaryRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2Dictionary.DescribeNamespacesRequest()
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import dictionary
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = dictionary.Gs2DictionaryRestClient(session)
try:
result = client.describe_namespaces(
dictionary.DescribeNamespacesRequest()
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('dictionary')
api_result = client.describe_namespaces({
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('dictionary')
api_result_handler = client.describe_namespaces_async({
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createNamespace
Create a new namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
entryScript | ScriptSetting | Script to be executed when registering an entry | ||||
duplicateEntryScript | string | ~ 1024 chars | Script to run when an attempt is made to re-register an entry that has already been registered | |||
logSetting | LogSetting | Log output settings |
Result
Type | Description | |
---|---|---|
item | Namespace | Namespace created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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,
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 Gs2AccountRestClient(
$session
);
try {
$result = $client->createNamespace(
(new CreateNamespaceRequest())
->withName("namespace-0001")
->withDescription(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)
.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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.CreateNamespaceRequest;
using Gs2.Gs2Dictionary.Result.CreateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Dictionary.Request.CreateNamespaceRequest()
.WithName("namespace-0001")
.WithDescription(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)
.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_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,
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['message'])
end
result = api_result.result
item = result.item;
client = gs2('dictionary')
api_result_handler = client.create_namespace_async({
name="namespace-0001",
description=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['message'])
end
result = api_result.result
item = result.item;
getNamespaceStatus
Get namespace status
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
status | string |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Dictionary.Result.GetNamespaceStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Dictionary.Request.GetNamespaceStatusRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
status = result.status;
getNamespace
Get namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | Namespace | 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.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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetNamespaceRequest;
using Gs2.Gs2Dictionary.Result.GetNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Dictionary.Request.GetNamespaceRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
item = result.item;
updateNamespace
Update namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
entryScript | ScriptSetting | Script to be executed when registering an entry | ||||
duplicateEntryScript | string | ~ 1024 chars | Script to run when an attempt is made to re-register an entry that has already been registered | |||
logSetting | LogSetting | Log output settings |
Result
Type | Description | |
---|---|---|
item | Namespace | Updated namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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"),
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 Gs2AccountRestClient(
$session
);
try {
$result = $client->updateNamespace(
(new UpdateNamespaceRequest())
->withNamespaceName("namespace-0001")
->withDescription("description1")
->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")
.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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.UpdateNamespaceRequest;
using Gs2.Gs2Dictionary.Result.UpdateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Dictionary.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace-0001")
.WithDescription("description1")
.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")
.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_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",
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['message'])
end
result = api_result.result
item = result.item;
client = gs2('dictionary')
api_result_handler = client.update_namespace_async({
namespaceName="namespace-0001",
description="description1",
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['message'])
end
result = api_result.result
item = result.item;
deleteNamespace
Delete namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | Namespace | Deleted namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DeleteNamespaceRequest;
using Gs2.Gs2Dictionary.Result.DeleteNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Dictionary.Request.DeleteNamespaceRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
item = result.item;
getServiceVersion
Get version of microservice
Request
Type | Condition | Require | Default | Limitation | Description |
---|
Result
Type | Description | |
---|---|---|
item | string | Version |
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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetServiceVersionRequest;
using Gs2.Gs2Dictionary.Result.GetServiceVersionResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.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['message'])
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['message'])
end
result = api_result.result
item = result.item;
dumpUserDataByUserId
Get dump data of the data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
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 Gs2AccountRestClient(
$session
);
try {
$result = $client->dumpUserDataByUserId(
(new DumpUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.DumpUserDataByUserIdRequest;
import io.gs2.dictionary.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DictionaryRestClient client = new Gs2DictionaryRestClient(session);
try {
DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
new DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Dictionary.Result.DumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2Dictionary.Request.DumpUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Dictionary.Gs2DictionaryRestClient(session);
try {
const result = await client.dumpUserDataByUserId(
new Gs2Dictionary.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import dictionary
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = dictionary.Gs2DictionaryRestClient(session)
try:
result = client.dump_user_data_by_user_id(
dictionary.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('dictionary')
api_result = client.dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('dictionary')
api_result_handler = client.dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
checkDumpUserDataByUserId
Check if the dump of the data associated with the specified user ID is complete
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
url | string | URL 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 Gs2AccountRestClient(
$session
);
try {
$result = $client->checkDumpUserDataByUserId(
(new CheckDumpUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$url = $result->getUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.dictionary.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DictionaryRestClient client = new Gs2DictionaryRestClient(session);
try {
CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
new CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
String url = result.getUrl();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Dictionary.Result.CheckDumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2Dictionary.Request.CheckDumpUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Dictionary.Gs2DictionaryRestClient(session);
try {
const result = await client.checkDumpUserDataByUserId(
new Gs2Dictionary.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import dictionary
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = dictionary.Gs2DictionaryRestClient(session)
try:
result = client.check_dump_user_data_by_user_id(
dictionary.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('dictionary')
api_result = client.check_dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
client = gs2('dictionary')
api_result_handler = client.check_dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
cleanUserDataByUserId
Get clean data of the data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
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 Gs2AccountRestClient(
$session
);
try {
$result = $client->cleanUserDataByUserId(
(new CleanUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.CleanUserDataByUserIdRequest;
import io.gs2.dictionary.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DictionaryRestClient client = new Gs2DictionaryRestClient(session);
try {
CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
new CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Dictionary.Result.CleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2Dictionary.Request.CleanUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Dictionary.Gs2DictionaryRestClient(session);
try {
const result = await client.cleanUserDataByUserId(
new Gs2Dictionary.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import dictionary
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = dictionary.Gs2DictionaryRestClient(session)
try:
result = client.clean_user_data_by_user_id(
dictionary.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('dictionary')
api_result = client.clean_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('dictionary')
api_result_handler = client.clean_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
checkCleanUserDataByUserId
Check if the clean of the data associated with the specified user ID is complete
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
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 Gs2AccountRestClient(
$session
);
try {
$result = $client->checkCleanUserDataByUserId(
(new CheckCleanUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.dictionary.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DictionaryRestClient client = new Gs2DictionaryRestClient(session);
try {
CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
new CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Dictionary.Result.CheckCleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2Dictionary.Request.CheckCleanUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Dictionary.Gs2DictionaryRestClient(session);
try {
const result = await client.checkCleanUserDataByUserId(
new Gs2Dictionary.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import dictionary
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = dictionary.Gs2DictionaryRestClient(session)
try:
result = client.check_clean_user_data_by_user_id(
dictionary.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('dictionary')
api_result = client.check_clean_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('dictionary')
api_result_handler = client.check_clean_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
prepareImportUserDataByUserId
Start importing data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
uploadToken | string | Token used to reflect results after upload |
uploadUrl | string | URL 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 Gs2AccountRestClient(
$session
);
try {
$result = $client->prepareImportUserDataByUserId(
(new PrepareImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$uploadToken = $result->getUploadToken();
$uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.dictionary.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DictionaryRestClient client = new Gs2DictionaryRestClient(session);
try {
PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
new PrepareImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
String uploadToken = result.getUploadToken();
String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Dictionary.Result.PrepareImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2Dictionary.Request.PrepareImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Dictionary.Gs2DictionaryRestClient(session);
try {
const result = await client.prepareImportUserDataByUserId(
new Gs2Dictionary.PrepareImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const uploadToken = result.getUploadToken();
const uploadUrl = result.getUploadUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import dictionary
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = dictionary.Gs2DictionaryRestClient(session)
try:
result = client.prepare_import_user_data_by_user_id(
dictionary.PrepareImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
upload_token = result.upload_token
upload_url = result.upload_url
except core.Gs2Exception as e:
exit(1)
client = gs2('dictionary')
api_result = client.prepare_import_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('dictionary')
api_result_handler = client.prepare_import_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
importUserDataByUserId
Start importing data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
uploadToken | string | ✓ | ~ 1024 chars | Token received in preparation for upload | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
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 Gs2AccountRestClient(
$session
);
try {
$result = $client->importUserDataByUserId(
(new ImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withUploadToken("upload-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.ImportUserDataByUserIdRequest;
import io.gs2.dictionary.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DictionaryRestClient client = new Gs2DictionaryRestClient(session);
try {
ImportUserDataByUserIdResult result = client.importUserDataByUserId(
new ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Dictionary.Result.ImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2Dictionary.Request.ImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithUploadToken("upload-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Dictionary.Gs2DictionaryRestClient(session);
try {
const result = await client.importUserDataByUserId(
new Gs2Dictionary.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import dictionary
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = dictionary.Gs2DictionaryRestClient(session)
try:
result = client.import_user_data_by_user_id(
dictionary.ImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_upload_token('upload-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('dictionary')
api_result = client.import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('dictionary')
api_result_handler = client.import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
checkImportUserDataByUserId
Check if the import of the data associated with the specified user ID is complete
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
uploadToken | string | ✓ | ~ 1024 chars | Token received in preparation for upload | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
url | string | URL 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 Gs2AccountRestClient(
$session
);
try {
$result = $client->checkImportUserDataByUserId(
(new CheckImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withUploadToken("upload-0001")
->withTimeOffsetToken(null)
);
$url = $result->getUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.CheckImportUserDataByUserIdRequest;
import io.gs2.dictionary.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DictionaryRestClient client = new Gs2DictionaryRestClient(session);
try {
CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
new CheckImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
String url = result.getUrl();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Dictionary.Result.CheckImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2Dictionary.Request.CheckImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithUploadToken("upload-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Dictionary.Gs2DictionaryRestClient(session);
try {
const result = await client.checkImportUserDataByUserId(
new Gs2Dictionary.CheckImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import dictionary
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = dictionary.Gs2DictionaryRestClient(session)
try:
result = client.check_import_user_data_by_user_id(
dictionary.CheckImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_upload_token('upload-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('dictionary')
api_result = client.check_import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
client = gs2('dictionary')
api_result_handler = client.check_import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
describeEntryModels
Get list of entry models
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
items | List<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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DescribeEntryModelsRequest;
using Gs2.Gs2Dictionary.Result.DescribeEntryModelsResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.DescribeEntryModelsResult> asyncResult = null;
yield return client.DescribeEntryModels(
new Gs2.Gs2Dictionary.Request.DescribeEntryModelsRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
items = result.items;
getEntryModel
Get an entry model
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
entryName | string | ✓ | ~ 128 chars | Entry Name |
Result
Type | Description | |
---|---|---|
item | EntryModel | Entry 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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetEntryModelRequest;
using Gs2.Gs2Dictionary.Result.GetEntryModelResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.GetEntryModelResult> asyncResult = null;
yield return client.GetEntryModel(
new Gs2.Gs2Dictionary.Request.GetEntryModelRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
item = result.item;
describeEntryModelMasters
List of entry model masters
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<EntryModelMaster> | List of Entry Model Masters |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\DescribeEntryModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeEntryModelMasters(
(new DescribeEntryModelMastersRequest())
->withNamespaceName("namespace-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.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")
.withPageToken(null)
.withLimit(null)
);
List<EntryModelMaster> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DescribeEntryModelMastersRequest;
using Gs2.Gs2Dictionary.Result.DescribeEntryModelMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.DescribeEntryModelMastersResult> asyncResult = null;
yield return client.DescribeEntryModelMasters(
new Gs2.Gs2Dictionary.Request.DescribeEntryModelMastersRequest()
.WithNamespaceName("namespace-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.describeEntryModelMasters(
new Gs2Dictionary.DescribeEntryModelMastersRequest()
.withNamespaceName("namespace-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_entry_model_masters(
dictionary.DescribeEntryModelMastersRequest()
.with_namespace_name('namespace-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_entry_model_masters({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('dictionary')
api_result_handler = client.describe_entry_model_masters_async({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createEntryModelMaster
Create a new entry model master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
name | string | ✓ | ~ 128 chars | Entry Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata |
Result
Type | Description | |
---|---|---|
item | EntryModelMaster | Created 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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.CreateEntryModelMasterRequest;
using Gs2.Gs2Dictionary.Result.CreateEntryModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.CreateEntryModelMasterResult> asyncResult = null;
yield return client.CreateEntryModelMaster(
new Gs2.Gs2Dictionary.Request.CreateEntryModelMasterRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
item = result.item;
getEntryModelMaster
Get Entry Model Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
entryName | string | ✓ | ~ 128 chars | Entry Model Name |
Result
Type | Description | |
---|---|---|
item | EntryModelMaster | 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.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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetEntryModelMasterRequest;
using Gs2.Gs2Dictionary.Result.GetEntryModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.GetEntryModelMasterResult> asyncResult = null;
yield return client.GetEntryModelMaster(
new Gs2.Gs2Dictionary.Request.GetEntryModelMasterRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
item = result.item;
updateEntryModelMaster
Updated Entry Model Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
entryName | string | ✓ | ~ 128 chars | Entry Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata |
Result
Type | Description | |
---|---|---|
item | EntryModelMaster | Updated 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.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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.UpdateEntryModelMasterRequest;
using Gs2.Gs2Dictionary.Result.UpdateEntryModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.UpdateEntryModelMasterResult> asyncResult = null;
yield return client.UpdateEntryModelMaster(
new Gs2.Gs2Dictionary.Request.UpdateEntryModelMasterRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
item = result.item;
deleteEntryModelMaster
Delete entry model master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
entryName | string | ✓ | ~ 128 chars | Entry Model Name |
Result
Type | Description | |
---|---|---|
item | EntryModelMaster | Deleted 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.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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DeleteEntryModelMasterRequest;
using Gs2.Gs2Dictionary.Result.DeleteEntryModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.DeleteEntryModelMasterResult> asyncResult = null;
yield return client.DeleteEntryModelMaster(
new Gs2.Gs2Dictionary.Request.DeleteEntryModelMasterRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
item = result.item;
describeEntries
Get list of entries
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | Access token | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 10000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<Entry> | List of Entries |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DescribeEntriesRequest;
using Gs2.Gs2Dictionary.Result.DescribeEntriesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.DescribeEntriesResult> asyncResult = null;
yield return client.DescribeEntries(
new Gs2.Gs2Dictionary.Request.DescribeEntriesRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
describeEntriesByUserId
Get list of entries by user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 10000 | Number of data acquired | |
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
items | List<Entry> | List of Entries |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DescribeEntriesByUserIdRequest;
using Gs2.Gs2Dictionary.Result.DescribeEntriesByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.DescribeEntriesByUserIdResult> asyncResult = null;
yield return client.DescribeEntriesByUserId(
new Gs2.Gs2Dictionary.Request.DescribeEntriesByUserIdRequest()
.WithNamespaceName("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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('dictionary')
api_result_handler = client.describe_entries_by_user_id_async({
namespaceName="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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
addEntriesByUserId
Add entries by specifying a user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
entryModelNames | List<string> | [] | ~ 100 items | List of Entry Names | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
items | List<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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.AddEntriesByUserIdRequest;
using Gs2.Gs2Dictionary.Result.AddEntriesByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.AddEntriesByUserIdResult> asyncResult = null;
yield return client.AddEntriesByUserId(
new Gs2.Gs2Dictionary.Request.AddEntriesByUserIdRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
items = result.items;
getEntry
Get an entry
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | Access token | ||
entryModelName | string | ✓ | ~ 128 chars | Entry Name |
Result
Type | Description | |
---|---|---|
item | Entry | 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.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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetEntryRequest;
using Gs2.Gs2Dictionary.Result.GetEntryResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.GetEntryResult> asyncResult = null;
yield return client.GetEntry(
new Gs2.Gs2Dictionary.Request.GetEntryRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
item = result.item;
getEntryByUserId
Get entry by user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
entryModelName | string | ✓ | ~ 128 chars | Entry Name | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | Entry | 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.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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetEntryByUserIdRequest;
using Gs2.Gs2Dictionary.Result.GetEntryByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.GetEntryByUserIdResult> asyncResult = null;
yield return client.GetEntryByUserId(
new Gs2.Gs2Dictionary.Request.GetEntryByUserIdRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
item = result.item;
getEntryWithSignature
Get entry with signature information
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | Access token | ||
entryModelName | string | ✓ | ~ 128 chars | Entry Name | ||
keyId | string | ✓ | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
item | Entry | Entry |
body | string | Entry information for signature subject |
signature | string | signature |
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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetEntryWithSignatureRequest;
using Gs2.Gs2Dictionary.Result.GetEntryWithSignatureResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.GetEntryWithSignatureResult> asyncResult = null;
yield return client.GetEntryWithSignature(
new Gs2.Gs2Dictionary.Request.GetEntryWithSignatureRequest()
.WithNamespaceName("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['message'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;
client = gs2('dictionary')
api_result_handler = client.get_entry_with_signature_async({
namespaceName="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['message'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;
getEntryWithSignatureByUserId
Get entry with signature information by user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
entryModelName | string | ✓ | ~ 128 chars | Entry Name | ||
keyId | string | ✓ | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024 chars | encryption key GRN | |
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | Entry | Entry |
body | string | Entry information for signature subject |
signature | string | signature |
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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetEntryWithSignatureByUserIdRequest;
using Gs2.Gs2Dictionary.Result.GetEntryWithSignatureByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.GetEntryWithSignatureByUserIdResult> asyncResult = null;
yield return client.GetEntryWithSignatureByUserId(
new Gs2.Gs2Dictionary.Request.GetEntryWithSignatureByUserIdRequest()
.WithNamespaceName("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['message'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;
client = gs2('dictionary')
api_result_handler = client.get_entry_with_signature_by_user_id_async({
namespaceName="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['message'])
end
result = api_result.result
item = result.item;
body = result.body;
signature = result.signature;
resetByUserId
Reset entries
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.ResetByUserIdRequest;
using Gs2.Gs2Dictionary.Result.ResetByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.ResetByUserIdResult> asyncResult = null;
yield return client.ResetByUserId(
new Gs2.Gs2Dictionary.Request.ResetByUserIdRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
verifyEntry
Verify entry
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | Access token | ||
entryModelName | string | ✓ | ~ 128 chars | Entry Name | ||
verifyType | enum { “havent”, “have” } | ✓ | ~ 128 chars | Type of verification |
Definition of enumeration type to be specified for verifyType
Enumerator String Definition | Description |
---|---|
havent | The specified entry must not be held |
have | The specified entry must be held |
Result
Type | Description |
---|
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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.VerifyEntryRequest;
using Gs2.Gs2Dictionary.Result.VerifyEntryResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.VerifyEntryResult> asyncResult = null;
yield return client.VerifyEntry(
new Gs2.Gs2Dictionary.Request.VerifyEntryRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
verifyEntryByUserId
Verify entry by user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
entryModelName | string | ✓ | ~ 128 chars | Entry Name | ||
verifyType | enum { “havent”, “have” } | ✓ | ~ 128 chars | Type of verification | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Definition of enumeration type to be specified for verifyType
Enumerator String Definition | Description |
---|---|
havent | The specified entry must not be held |
have | The specified entry must be held |
Result
Type | Description |
---|
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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.VerifyEntryByUserIdRequest;
using Gs2.Gs2Dictionary.Result.VerifyEntryByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.VerifyEntryByUserIdResult> asyncResult = null;
yield return client.VerifyEntryByUserId(
new Gs2.Gs2Dictionary.Request.VerifyEntryByUserIdRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
deleteEntries
Delete entries
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | Access token | ||
entryModelNames | List<string> | [] | ~ 100 items | List of Entry Names |
Result
Type | Description | |
---|---|---|
items | List<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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DeleteEntriesRequest;
using Gs2.Gs2Dictionary.Result.DeleteEntriesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.DeleteEntriesResult> asyncResult = null;
yield return client.DeleteEntries(
new Gs2.Gs2Dictionary.Request.DeleteEntriesRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
items = result.items;
deleteEntriesByUserId
Delete entries by specifying a user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
entryModelNames | List<string> | [] | ~ 100 items | List of Entry Names | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
items | List<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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DeleteEntriesByUserIdRequest;
using Gs2.Gs2Dictionary.Result.DeleteEntriesByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.DeleteEntriesByUserIdResult> asyncResult = null;
yield return client.DeleteEntriesByUserId(
new Gs2.Gs2Dictionary.Request.DeleteEntriesByUserIdRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
items = result.items;
addEntriesByStampSheet
Execute the entry addition as an acquire action
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stampSheet | string | ✓ | ~ 5242880 chars | Transaction | ||
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
items | List<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.AddEntriesByStampSheet(
&dictionary.AddEntriesByStampSheetRequest {
StampSheet: pointy.String("stampSheet"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\AddEntriesByStampSheetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->addEntriesByStampSheet(
(new AddEntriesByStampSheetRequest())
->withStampSheet("stampSheet")
->withKeyId("key-0001")
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.AddEntriesByStampSheetRequest;
import io.gs2.dictionary.result.AddEntriesByStampSheetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DictionaryRestClient client = new Gs2DictionaryRestClient(session);
try {
AddEntriesByStampSheetResult result = client.addEntriesByStampSheet(
new AddEntriesByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
List<Entry> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.AddEntriesByStampSheetRequest;
using Gs2.Gs2Dictionary.Result.AddEntriesByStampSheetResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.AddEntriesByStampSheetResult> asyncResult = null;
yield return client.AddEntriesByStampSheet(
new Gs2.Gs2Dictionary.Request.AddEntriesByStampSheetRequest()
.WithStampSheet("stampSheet")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Dictionary.Gs2DictionaryRestClient(session);
try {
const result = await client.addEntriesByStampSheet(
new Gs2Dictionary.AddEntriesByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import dictionary
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = dictionary.Gs2DictionaryRestClient(session)
try:
result = client.add_entries_by_stamp_sheet(
dictionary.AddEntriesByStampSheetRequest()
.with_stamp_sheet('stampSheet')
.with_key_id('key-0001')
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('dictionary')
api_result = client.add_entries_by_stamp_sheet({
stampSheet="stampSheet",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('dictionary')
api_result_handler = client.add_entries_by_stamp_sheet_async({
stampSheet="stampSheet",
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
deleteEntriesByStampTask
Execute the entry deletion as a consume action
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stampTask | string | ✓ | ~ 5242880 chars | Consume Action | ||
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
items | List<Entry> | List of Deleted Entries |
newContextStack | string | Request of context in which consume action execution results are recorded |
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.DeleteEntriesByStampTask(
&dictionary.DeleteEntriesByStampTaskRequest {
StampTask: pointy.String("stampTask"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\DeleteEntriesByStampTaskRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteEntriesByStampTask(
(new DeleteEntriesByStampTaskRequest())
->withStampTask("stampTask")
->withKeyId("key-0001")
);
$items = $result->getItems();
$newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.DeleteEntriesByStampTaskRequest;
import io.gs2.dictionary.result.DeleteEntriesByStampTaskResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DictionaryRestClient client = new Gs2DictionaryRestClient(session);
try {
DeleteEntriesByStampTaskResult result = client.deleteEntriesByStampTask(
new DeleteEntriesByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
List<Entry> items = result.getItems();
String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DeleteEntriesByStampTaskRequest;
using Gs2.Gs2Dictionary.Result.DeleteEntriesByStampTaskResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.DeleteEntriesByStampTaskResult> asyncResult = null;
yield return client.DeleteEntriesByStampTask(
new Gs2.Gs2Dictionary.Request.DeleteEntriesByStampTaskRequest()
.WithStampTask("stampTask")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Dictionary.Gs2DictionaryRestClient(session);
try {
const result = await client.deleteEntriesByStampTask(
new Gs2Dictionary.DeleteEntriesByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
const items = result.getItems();
const newContextStack = result.getNewContextStack();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import dictionary
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = dictionary.Gs2DictionaryRestClient(session)
try:
result = client.delete_entries_by_stamp_task(
dictionary.DeleteEntriesByStampTaskRequest()
.with_stamp_task('stampTask')
.with_key_id('key-0001')
)
items = result.items
new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
exit(1)
client = gs2('dictionary')
api_result = client.delete_entries_by_stamp_task({
stampTask="stampTask",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
newContextStack = result.newContextStack;
client = gs2('dictionary')
api_result_handler = client.delete_entries_by_stamp_task_async({
stampTask="stampTask",
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
newContextStack = result.newContextStack;
verifyEntryByStampTask
Execute the entry verification as a verify action
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stampTask | string | ✓ | ~ 5242880 chars | Verify Action | ||
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
newContextStack | string | Request of context in which verify action execution results are recorded |
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.VerifyEntryByStampTask(
&dictionary.VerifyEntryByStampTaskRequest {
StampTask: pointy.String("stampTask"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Dictionary\Gs2DictionaryRestClient;
use Gs2\Dictionary\Request\VerifyEntryByStampTaskRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyEntryByStampTask(
(new VerifyEntryByStampTaskRequest())
->withStampTask("stampTask")
->withKeyId("key-0001")
);
$newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.dictionary.rest.Gs2DictionaryRestClient;
import io.gs2.dictionary.request.VerifyEntryByStampTaskRequest;
import io.gs2.dictionary.result.VerifyEntryByStampTaskResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DictionaryRestClient client = new Gs2DictionaryRestClient(session);
try {
VerifyEntryByStampTaskResult result = client.verifyEntryByStampTask(
new VerifyEntryByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.VerifyEntryByStampTaskRequest;
using Gs2.Gs2Dictionary.Result.VerifyEntryByStampTaskResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.VerifyEntryByStampTaskResult> asyncResult = null;
yield return client.VerifyEntryByStampTask(
new Gs2.Gs2Dictionary.Request.VerifyEntryByStampTaskRequest()
.WithStampTask("stampTask")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Dictionary from '@/gs2/dictionary';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Dictionary.Gs2DictionaryRestClient(session);
try {
const result = await client.verifyEntryByStampTask(
new Gs2Dictionary.VerifyEntryByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
const newContextStack = result.getNewContextStack();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import dictionary
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = dictionary.Gs2DictionaryRestClient(session)
try:
result = client.verify_entry_by_stamp_task(
dictionary.VerifyEntryByStampTaskRequest()
.with_stamp_task('stampTask')
.with_key_id('key-0001')
)
new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
exit(1)
client = gs2('dictionary')
api_result = client.verify_entry_by_stamp_task({
stampTask="stampTask",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
newContextStack = result.newContextStack;
client = gs2('dictionary')
api_result_handler = client.verify_entry_by_stamp_task_async({
stampTask="stampTask",
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
newContextStack = result.newContextStack;
describeLikes
Get list of likes
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | Access token | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<Like> | List of Likes |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DescribeLikesRequest;
using Gs2.Gs2Dictionary.Result.DescribeLikesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.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['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
describeLikesByUserId
Get list of likes by user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired | |
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
items | List<Like> | List of Likes |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DescribeLikesByUserIdRequest;
using Gs2.Gs2Dictionary.Result.DescribeLikesByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.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['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
addLikes
Add likes
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | Access token | ||
entryModelNames | List<string> | [] | ~ 100 items | List of Like Names |
Result
Type | Description | |
---|---|---|
items | List<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("like-0002"),
pointy.String("like-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 Gs2AccountRestClient(
$session
);
try {
$result = $client->addLikes(
(new AddLikesRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withEntryModelNames([
"entry-0001",
"like-0002",
"like-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",
"like-0002",
"like-0003"
))
);
List<Like> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.AddLikesRequest;
using Gs2.Gs2Dictionary.Result.AddLikesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.AddLikesResult> asyncResult = null;
yield return client.AddLikes(
new Gs2.Gs2Dictionary.Request.AddLikesRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithEntryModelNames(new string[] {
"entry-0001",
"like-0002",
"like-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",
"like-0002",
"like-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',
'like-0002',
'like-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",
"like-0002",
"like-0003"
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('dictionary')
api_result_handler = client.add_likes_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
entryModelNames={
"entry-0001",
"like-0002",
"like-0003"
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
addLikesByUserId
Add likes by specifying a user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
entryModelNames | List<string> | [] | ~ 100 items | List of Like Names | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
items | List<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("like-0002"),
pointy.String("like-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 Gs2AccountRestClient(
$session
);
try {
$result = $client->addLikesByUserId(
(new AddLikesByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withEntryModelNames([
"entry-0001",
"like-0002",
"like-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",
"like-0002",
"like-0003"
))
.withTimeOffsetToken(null)
);
List<Like> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.AddLikesByUserIdRequest;
using Gs2.Gs2Dictionary.Result.AddLikesByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.AddLikesByUserIdResult> asyncResult = null;
yield return client.AddLikesByUserId(
new Gs2.Gs2Dictionary.Request.AddLikesByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithEntryModelNames(new string[] {
"entry-0001",
"like-0002",
"like-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",
"like-0002",
"like-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',
'like-0002',
'like-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",
"like-0002",
"like-0003"
},
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('dictionary')
api_result_handler = client.add_likes_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
entryModelNames={
"entry-0001",
"like-0002",
"like-0003"
},
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
getLike
Get an like
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | Access token | ||
entryModelName | string | ✓ | ~ 128 chars | Like Name |
Result
Type | Description | |
---|---|---|
item | Like | Like 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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetLikeRequest;
using Gs2.Gs2Dictionary.Result.GetLikeResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.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['message'])
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['message'])
end
result = api_result.result
item = result.item;
getLikeByUserId
Get like by user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
entryModelName | string | ✓ | ~ 128 chars | Like Name | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | Like | Like 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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetLikeByUserIdRequest;
using Gs2.Gs2Dictionary.Result.GetLikeByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.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['message'])
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['message'])
end
result = api_result.result
item = result.item;
resetLikes
Reset likes
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | Access token |
Result
Type | Description |
---|
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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.ResetLikesRequest;
using Gs2.Gs2Dictionary.Result.ResetLikesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.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['message'])
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['message'])
end
result = api_result.result
resetLikesByUserId
Reset likes by specifying a user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.ResetLikesByUserIdRequest;
using Gs2.Gs2Dictionary.Result.ResetLikesByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.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['message'])
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['message'])
end
result = api_result.result
deleteLikes
Delete likes
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | Access token | ||
entryModelNames | List<string> | [] | ~ 100 items | List of Like Names |
Result
Type | Description | |
---|---|---|
items | List<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("like-0002"),
pointy.String("like-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 Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteLikes(
(new DeleteLikesRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withEntryModelNames([
"entry-0001",
"like-0002",
"like-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",
"like-0002",
"like-0003"
))
);
List<Like> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DeleteLikesRequest;
using Gs2.Gs2Dictionary.Result.DeleteLikesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.DeleteLikesResult> asyncResult = null;
yield return client.DeleteLikes(
new Gs2.Gs2Dictionary.Request.DeleteLikesRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithEntryModelNames(new string[] {
"entry-0001",
"like-0002",
"like-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",
"like-0002",
"like-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',
'like-0002',
'like-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",
"like-0002",
"like-0003"
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('dictionary')
api_result_handler = client.delete_likes_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
entryModelNames={
"entry-0001",
"like-0002",
"like-0003"
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
deleteLikesByUserId
Delete likes by specifying a user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
entryModelNames | List<string> | [] | ~ 100 items | List of Like Names | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
items | List<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("like-0002"),
pointy.String("like-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 Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteLikesByUserId(
(new DeleteLikesByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withEntryModelNames([
"entry-0001",
"like-0002",
"like-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",
"like-0002",
"like-0003"
))
.withTimeOffsetToken(null)
);
List<Like> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.DeleteLikesByUserIdRequest;
using Gs2.Gs2Dictionary.Result.DeleteLikesByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.DeleteLikesByUserIdResult> asyncResult = null;
yield return client.DeleteLikesByUserId(
new Gs2.Gs2Dictionary.Request.DeleteLikesByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithEntryModelNames(new string[] {
"entry-0001",
"like-0002",
"like-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",
"like-0002",
"like-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',
'like-0002',
'like-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",
"like-0002",
"like-0003"
},
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('dictionary')
api_result_handler = client.delete_likes_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
entryModelNames={
"entry-0001",
"like-0002",
"like-0003"
},
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
exportMaster
Export master data for currently available entry settings
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | CurrentEntryMaster | Currently available entry settings |
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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.ExportMasterRequest;
using Gs2.Gs2Dictionary.Result.ExportMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
new Gs2.Gs2Dictionary.Request.ExportMasterRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
item = result.item;
getCurrentEntryMaster
Get the currently available entry settings
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | CurrentEntryMaster | Currently available entry settings |
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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.GetCurrentEntryMasterRequest;
using Gs2.Gs2Dictionary.Result.GetCurrentEntryMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.GetCurrentEntryMasterResult> asyncResult = null;
yield return client.GetCurrentEntryMaster(
new Gs2.Gs2Dictionary.Request.GetCurrentEntryMasterRequest()
.WithNamespaceName("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['message'])
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['message'])
end
result = api_result.result
item = result.item;
preUpdateCurrentEntryMaster
Update the currently available model settings
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
uploadToken | string | Token used to reflect results after upload |
uploadUrl | string | URL 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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.PreUpdateCurrentEntryMasterRequest;
using Gs2.Gs2Dictionary.Result.PreUpdateCurrentEntryMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.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['message'])
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['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
updateCurrentEntryMaster
Update the currently available entry settings
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
mode | enum { “direct”, “preUpload” } | ✓ | “direct” | ~ 128 chars | Update mode | |
settings | string | {mode} == “direct” | ✓ | ~ 5242880 chars | Master data If mode is “direct”, then required | |
uploadToken | string | {mode} == “preUpload” | ✓ | ~ 1024 chars | Token used to reflect results after upload If mode is “preUpload”, then required |
Definition of enumeration type to be specified for mode
Enumerator String Definition | Description |
---|---|
direct | Directly update the settings |
preUpload | Upload the settings and then update |
Result
Type | Description | |
---|---|---|
item | CurrentEntryMaster | Updated and currently available entry settings |
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: nil,
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 Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentEntryMaster(
(new UpdateCurrentEntryMasterRequest())
->withNamespaceName("namespace-0001")
->withMode(null)
->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(null)
.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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.UpdateCurrentEntryMasterRequest;
using Gs2.Gs2Dictionary.Result.UpdateCurrentEntryMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.UpdateCurrentEntryMasterResult> asyncResult = null;
yield return client.UpdateCurrentEntryMaster(
new Gs2.Gs2Dictionary.Request.UpdateCurrentEntryMasterRequest()
.WithNamespaceName("namespace-0001")
.WithMode(null)
.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(null)
.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(None)
.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=nil,
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['message'])
end
result = api_result.result
item = result.item;
client = gs2('dictionary')
api_result_handler = client.update_current_entry_master_async({
namespaceName="namespace-0001",
mode=nil,
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['message'])
end
result = api_result.result
item = result.item;
updateCurrentEntryMasterFromGitHub
Update the currently available entry settings
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
checkoutSetting | GitHubCheckoutSetting | ✓ | Setup to check out master data from GitHub |
Result
Type | Description | |
---|---|---|
item | CurrentEntryMaster | Updated currently available entry settings |
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 Gs2AccountRestClient(
$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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Dictionary.Gs2DictionaryRestClient;
using Gs2.Gs2Dictionary.Request.UpdateCurrentEntryMasterFromGitHubRequest;
using Gs2.Gs2Dictionary.Result.UpdateCurrentEntryMasterFromGitHubResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DictionaryRestClient(session);
AsyncResult<Gs2.Gs2Dictionary.Result.UpdateCurrentEntryMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentEntryMasterFromGitHub(
new Gs2.Gs2Dictionary.Request.UpdateCurrentEntryMasterFromGitHubRequest()
.WithNamespaceName("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['message'])
end
result = api_result.result
item = result.item;
client = gs2('dictionary')
api_result_handler = client.update_current_entry_master_from_git_hub_async({
namespaceName="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['message'])
end
result = api_result.result
item = result.item;